OpenMAXAL_Android.h revision ebc8fd365b402e498d499fa8737a7591c290347c
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
35extern XA_API const XAInterfaceID XA_IID_ANDROIDBUFFERQUEUE;
36
37struct XAAndroidBufferQueueItf_;
38typedef const struct XAAndroidBufferQueueItf_ * const * XAAndroidBufferQueueItf;
39
40#define XA_ANDROIDBUFFERQUEUE_EVENT_NONE              ((XAuint32) 0x00000000)
41#define XA_ANDROIDBUFFERQUEUE_EVENT_EOS               ((XAuint32) 0x00000001)
42#define XA_ANDROIDBUFFERQUEUE_EVENT_DISCONTINUITY     ((XAuint32) 0x00000002)
43
44typedef XAresult (XAAPIENTRY *xaAndroidBufferQueueCallback)(
45    XAAndroidBufferQueueItf caller,/* input */
46    void *pContext,                /* input */
47    XAuint32 bufferId,             /* input */
48    XAuint32 bufferLength,         /* input */
49    void *pBufferDataLocation      /* input */
50);
51
52struct XAAndroidBufferQueueItf_ {
53    XAresult (*RegisterCallback) (
54        XAAndroidBufferQueueItf self,
55        xaAndroidBufferQueueCallback callback,
56        void* pContext
57    );
58
59    XAresult (*Clear) (
60        XAAndroidBufferQueueItf self
61    );
62
63    XAresult (*Enqueue) (
64        XAAndroidBufferQueueItf self,
65        XAuint32 bufferId,
66        XAuint32 length,
67        XAAbufferQueueEvent event,
68        void *pData // FIXME ignored for now, subject to change
69    );
70};
71
72
73/*---------------------------------------------------------------------------*/
74/* Android Buffer Queue Data Locator                                         */
75/*---------------------------------------------------------------------------*/
76
77/** Addendum to Data locator macros  */
78#define XA_DATALOCATOR_ANDROIDBUFFERQUEUE       ((XAuint32) 0x800007BE)
79
80/** Android Buffer Queue-based data locator definition,
81 *  locatorType must be XA_DATALOCATOR_ANDROIDBUFFERQUEUE */
82typedef struct XADataLocator_AndroidBufferQueue_ {
83    XAuint32    locatorType;
84    XAuint32    numBuffers;  // FIXME ignored for now, subject to change
85    XAuint32    queueSize;   // FIXME ignored for now, subject to change
86} XADataLocator_AndroidBufferQueue;
87
88#ifdef __cplusplus
89}
90#endif /* __cplusplus */
91
92#endif /* OPENMAX_AL_ANDROID_H_ */
93