OpenMAXAL_Android.h revision eae4df541ba1d46f65d37e959baf2127aa632c93
1/*
2 * Copyright (C) 2010 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef OPENMAX_AL_ANDROID_H_
18#define OPENMAX_AL_ANDROID_H_
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24/*---------------------------------------------------------------------------*/
25/* Android common types                                                      */
26/*---------------------------------------------------------------------------*/
27
28typedef XAuint32               XAAbufferQueueEvent;
29
30
31/*---------------------------------------------------------------------------*/
32/* Android Buffer Qeueue Interface                                           */
33/*---------------------------------------------------------------------------*/
34
35// FIXME what's wrong with XAAPIENTRY?
36extern SLAPIENTRY const XAInterfaceID XA_IID_ANDROIDBUFFERQUEUE;
37
38struct XAAndroidBufferQueueItf_;
39typedef const struct XAAndroidBufferQueueItf_ * const * XAAndroidBufferQueueItf;
40
41#define XA_ANDROIDBUFFERQUEUE_EVENT_NONE              ((XAuint32) 0x00000000)
42#define XA_ANDROIDBUFFERQUEUE_EVENT_EOS               ((XAuint32) 0x00000001)
43#define XA_ANDROIDBUFFERQUEUE_EVENT_DISCONTINUITY     ((XAuint32) 0x00000002)
44
45typedef XAresult (/*XAAPIENTRY*/ *xaAndroidBufferQueueCallback)(
46    XAAndroidBufferQueueItf caller,/* input */
47    void *pContext,                /* input */
48    XAuint32 bufferId,             /* input */
49    XAuint32 bufferLength,         /* input */
50    void *pBufferDataLocation      /* input */
51);
52
53struct XAAndroidBufferQueueItf_ {
54    XAresult (*RegisterCallback) (
55        XAAndroidBufferQueueItf self,
56        xaAndroidBufferQueueCallback callback,
57        void* pContext
58    );
59
60    XAresult (*Clear) (
61        XAAndroidBufferQueueItf self
62    );
63
64    XAresult (*Enqueue) (
65        XAAndroidBufferQueueItf self,
66        XAuint32 bufferId,
67        XAuint32 length,
68        XAAbufferQueueEvent event,
69        void *pData
70    );
71};
72
73
74/*---------------------------------------------------------------------------*/
75/* Android Buffer Queue Data Locator                                         */
76/*---------------------------------------------------------------------------*/
77
78/** Addendum to Data locator macros  */
79#define XA_DATALOCATOR_ANDROIDBUFFERQUEUE       ((XAuint32) 0x800007BE)
80
81/** Android Buffer Queue-based data locator definition,
82 *  locatorType must be XA_DATALOCATOR_ANDROIDBUFFERQUEUE */
83typedef struct XADataLocator_AndroidBufferQueue_ {
84    XAuint32    locatorType;
85    XAuint32    numBuffers;
86    XAuint32    queueSize;    // FIXME use optional queue size for shared memory size?
87} XADataLocator_AndroidBufferQueue;
88
89#ifdef __cplusplus
90}
91#endif /* __cplusplus */
92
93#endif /* OPENMAX_AL_ANDROID_H_ */
94