OpenMAXAL_Android.h revision d1fc9c0e89a9d2fd40ba4c48927a47b30ade637d
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/* Android Simple Buffer Queue Interface */ 32/*---------------------------------------------------------------------------*/ 33#if 0 34extern XA_API const SLInterfaceID XA_IID_ANDROIDSIMPLEBUFFERQUEUE; 35 36struct XAAndroidSimpleBufferQueueItf_; 37typedef const struct XAAndroidSimpleBufferQueueItf_ * const * XAAndroidSimpleBufferQueueItf; 38 39typedef void (XAAPIENTRY *xaAndroidSimpleBufferQueueCallback)( 40 xaAndroidSimpleBufferQueueItf caller, 41 void *pContext 42); 43 44/** Android simple buffer queue state **/ 45 46typedef struct XAAndroidSimpleBufferQueueState_ { 47 SLuint32 count; 48 SLuint32 index; 49} XAAndroidSimpleBufferQueueState; 50 51 52struct XAAndroidSimpleBufferQueueItf_ { 53 XAresult (*Enqueue) ( 54 XAAndroidSimpleBufferQueueItf self, 55 const void *pBuffer, 56 XAuint32 size 57 ); 58 XAresult (*Clear) ( 59 XAAndroidSimpleBufferQueueItf self 60 ); 61 XAresult (*GetState) ( 62 XAAndroidSimpleBufferQueueItf self, 63 XAAndroidSimpleBufferQueueState *pState 64 ); 65 XAresult (*RegisterCallback) ( 66 XAAndroidSimpleBufferQueueItf self, 67 xaAndroidSimpleBufferQueueCallback callback, 68 void* pContext 69 ); 70}; 71#endif 72 73/*---------------------------------------------------------------------------*/ 74/* Android Buffer Queue Interface */ 75/*---------------------------------------------------------------------------*/ 76 77extern XA_API const XAInterfaceID XA_IID_ANDROIDBUFFERQUEUE; 78 79struct XAAndroidBufferQueueItf_; 80typedef const struct XAAndroidBufferQueueItf_ * const * XAAndroidBufferQueueItf; 81 82#define XA_ANDROIDBUFFERQUEUE_EVENT_NONE ((XAuint32) 0x00000000) 83#define XA_ANDROIDBUFFERQUEUE_EVENT_EOS ((XAuint32) 0x00000001) 84#define XA_ANDROIDBUFFERQUEUE_EVENT_DISCONTINUITY ((XAuint32) 0x00000002) 85 86typedef XAresult (XAAPIENTRY *xaAndroidBufferQueueCallback)( 87 XAAndroidBufferQueueItf caller,/* input */ 88 void *pContext, /* input */ 89 XAuint32 bufferId, /* input */ 90 XAuint32 bufferLength, /* input */ 91 void *pBufferDataLocation /* input */ 92); 93 94struct XAAndroidBufferQueueItf_ { 95 XAresult (*RegisterCallback) ( 96 XAAndroidBufferQueueItf self, 97 xaAndroidBufferQueueCallback callback, 98 void* pContext 99 ); 100 101 XAresult (*Clear) ( 102 XAAndroidBufferQueueItf self 103 ); 104 105 XAresult (*Enqueue) ( 106 XAAndroidBufferQueueItf self, 107 XAuint32 bufferId, 108 XAuint32 length, 109 XAAbufferQueueEvent event, 110 void *pData // FIXME ignored for now, subject to change 111 ); 112}; 113 114 115/*---------------------------------------------------------------------------*/ 116/* Android Buffer Queue Data Locator */ 117/*---------------------------------------------------------------------------*/ 118 119/** Addendum to Data locator macros */ 120#define XA_DATALOCATOR_ANDROIDBUFFERQUEUE ((XAuint32) 0x800007BE) 121 122/** Android Buffer Queue-based data locator definition, 123 * locatorType must be XA_DATALOCATOR_ANDROIDBUFFERQUEUE */ 124typedef struct XADataLocator_AndroidBufferQueue_ { 125 XAuint32 locatorType; 126 XAuint32 numBuffers; // FIXME ignored for now, subject to change 127 XAuint32 queueSize; // FIXME ignored for now, subject to change 128} XADataLocator_AndroidBufferQueue; 129 130#ifdef __cplusplus 131} 132#endif /* __cplusplus */ 133 134#endif /* OPENMAX_AL_ANDROID_H_ */ 135