OpenMAXAL_Android.h revision 1c853a41d9d9886e60618a7c878ce3912f46bf3c
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 xa_int64_t XAAint64; /* 64 bit signed integer */ 29 30 31/*---------------------------------------------------------------------------*/ 32/* Android Buffer Queue Interface */ 33/*---------------------------------------------------------------------------*/ 34 35extern XA_API const XAInterfaceID XA_IID_ANDROIDBUFFERQUEUE; 36 37struct XAAndroidBufferQueueItf_; 38typedef const struct XAAndroidBufferQueueItf_ * const * XAAndroidBufferQueueItf; 39 40#define XA_ANDROID_ITEMKEY_NONE ((XAuint32) 0x00000000) 41#define XA_ANDROID_ITEMKEY_EOS ((XAuint32) 0x00000001) 42#define XA_ANDROID_ITEMKEY_DISCONTINUITY ((XAuint32) 0x00000002) 43#define XA_ANDROID_ITEMKEY_BUFFERQUEUEEVENT ((XAuint32) 0x00000003) 44 45#define XA_ANDROIDBUFFERQUEUEEVENT_NONE ((SLuint32) 0x00000000) 46#define XA_ANDROIDBUFFERQUEUEEVENT_PROCESSED ((SLuint32) 0x00000001) 47#define XA_ANDROIDBUFFERQUEUEEVENT_UNREALIZED ((SLuint32) 0x00000002) 48#define XA_ANDROIDBUFFERQUEUEEVENT_CLEARED ((SLuint32) 0x00000004) 49#define XA_ANDROIDBUFFERQUEUEEVENT_STOPPED ((SLuint32) 0x00000008) 50#define XA_ANDROIDBUFFERQUEUEEVENT_ERROR ((SLuint32) 0x00000010) 51#define XA_ANDROIDBUFFERQUEUEEVENT_CONTENT_END ((SLuint32) 0x00000020) 52 53typedef struct XAAndroidBufferItem_ { 54 XAuint32 itemKey; // identifies the item 55 XAuint32 itemSize; 56 XAuint8 itemData[0]; 57} XAAndroidBufferItem; 58 59typedef XAresult (XAAPIENTRY *xaAndroidBufferQueueCallback)( 60 XAAndroidBufferQueueItf caller,/* input */ 61 void *pCallbackContext, /* input */ 62 void *pBufferContext, /* input */ 63 void *pBufferData, /* input */ 64 XAuint32 dataSize, /* input */ 65 XAuint32 dataUsed, /* input */ 66 const XAAndroidBufferItem *pItems,/* input */ 67 XAuint32 itemsLength /* input */ 68); 69 70typedef struct XAAndroidBufferQueueState_ { 71 XAuint32 count; 72 XAuint32 index; 73} XAAndroidBufferQueueState; 74 75struct XAAndroidBufferQueueItf_ { 76 XAresult (*RegisterCallback) ( 77 XAAndroidBufferQueueItf self, 78 xaAndroidBufferQueueCallback callback, 79 void* pCallbackContext 80 ); 81 82 XAresult (*Clear) ( 83 XAAndroidBufferQueueItf self 84 ); 85 86 XAresult (*Enqueue) ( 87 XAAndroidBufferQueueItf self, 88 void *pBufferContext, 89 void *pData, 90 XAuint32 dataLength, 91 const XAAndroidBufferItem *pItems, 92 XAuint32 itemsLength 93 ); 94 95 XAresult (*GetState) ( 96 XAAndroidBufferQueueItf self, 97 XAAndroidBufferQueueState *pState 98 ); 99 100 101 XAresult (*SetCallbackEventsMask) ( 102 XAAndroidBufferQueueItf self, 103 XAuint32 eventFlags 104 ); 105 106 XAresult (*GetCallbackEventsMask) ( 107 XAAndroidBufferQueueItf self, 108 XAuint32 *pEventFlags 109 ); 110}; 111 112 113/*---------------------------------------------------------------------------*/ 114/* Android Buffer Queue Data Locator */ 115/*---------------------------------------------------------------------------*/ 116 117/** Addendum to Data locator macros */ 118#define XA_DATALOCATOR_ANDROIDBUFFERQUEUE ((XAuint32) 0x800007BE) 119 120/** Android Buffer Queue-based data locator definition, 121 * locatorType must be XA_DATALOCATOR_ANDROIDBUFFERQUEUE */ 122typedef struct XADataLocator_AndroidBufferQueue_ { 123 XAuint32 locatorType; 124 XAuint32 numBuffers; 125} XADataLocator_AndroidBufferQueue; 126 127 128/*---------------------------------------------------------------------------*/ 129/* Android File Descriptor Data Locator */ 130/*---------------------------------------------------------------------------*/ 131 132/** Addendum to Data locator macros */ 133#define XA_DATALOCATOR_ANDROIDFD ((XAuint32) 0x800007BC) 134 135#define XA_DATALOCATOR_ANDROIDFD_USE_FILE_SIZE ((XAAint64) 0xFFFFFFFFFFFFFFFFll) 136 137/** File Descriptor-based data locator definition, locatorType must be XA_DATALOCATOR_ANDROIDFD */ 138typedef struct XADataLocator_AndroidFD_ { 139 XAuint32 locatorType; 140 XAint32 fd; 141 XAAint64 offset; 142 XAAint64 length; 143} XADataLocator_AndroidFD; 144 145#ifdef __cplusplus 146} 147#endif /* __cplusplus */ 148 149#endif /* OPENMAX_AL_ANDROID_H_ */ 150