From c3d6dd225415ac68b1868575e793eb352c7105e2 Mon Sep 17 00:00:00 2001 From: Glenn Kasten Date: Mon, 29 Aug 2011 14:32:10 -0700 Subject: [PATCH] Rename Android buffer queue GUID for future sink This change will make it easier to have Android buffer queue as a sink in the future. For backwards source code compatibility with beta developers, retain the old name temporarily. As soon as they have switched to the new name, we will remove the old name. Details: - rename XA_IID_ANDROIDBUFFERQUEUE to XA_IID_ANDROIDBUFFERQUEUESOURCE - rename SL_IID_ANDROIDBUFFERQUEUE to SL_IID_ANDROIDBUFFERQUEUESOURCE - rename MPH_ANDROIDBUFFERQUEUE to MPH_ANDROIDBUFFERQUEUESOURCE - did not rename the data locators and interface struct, as they can be shared across both source and sink - did not rename the member field mAndroidBufferQueue in CAudioPlayer / CMediaPlayer as that would be a huge change; can do that later if necessary - the SINK definition will be added later when needed Change-Id: I36dc01050efb99d4d7802b2ca2b870f4d978ee21 --- wilhelm/include/OMXAL/OpenMAXAL_Android.h | 4 +++- wilhelm/include/SLES/OpenSLES_Android.h | 4 +++- wilhelm/src/MPH.h | 2 +- wilhelm/src/MPH_to.c | 4 ++-- wilhelm/src/OpenSLES_IID.c | 2 +- wilhelm/src/autogen/IID_to_MPH.c | 2 +- wilhelm/src/classes.c | 4 ++-- wilhelm/src/interfaces.c | 2 +- wilhelm/src/sl_iid.c | 2 +- wilhelm/src/sles.c | 4 ++-- wilhelm/src/xa_iid.c | 4 ++-- wilhelm/tests/native-media/jni/native-media-jni.c | 5 +++-- wilhelm/tests/sandbox/streamSource/slesTestPlayStream.cpp | 4 ++-- wilhelm/tests/sandbox/xaplay.c | 4 ++-- 14 files changed, 26 insertions(+), 21 deletions(-) diff --git a/wilhelm/include/OMXAL/OpenMAXAL_Android.h b/wilhelm/include/OMXAL/OpenMAXAL_Android.h index 7ab20075..e96c9cf5 100644 --- a/wilhelm/include/OMXAL/OpenMAXAL_Android.h +++ b/wilhelm/include/OMXAL/OpenMAXAL_Android.h @@ -46,7 +46,9 @@ typedef xa_uint64_t XAAuint64; /* 64 bit unsigned integer */ /* Android Buffer Queue Interface */ /*---------------------------------------------------------------------------*/ -extern XA_API const XAInterfaceID XA_IID_ANDROIDBUFFERQUEUE; +extern XA_API const XAInterfaceID XA_IID_ANDROIDBUFFERQUEUESOURCE; +// FIXME temporary definition to be removed +#define XA_IID_ANDROIDBUFFERQUEUE XA_IID_ANDROIDBUFFERQUEUESOURCE struct XAAndroidBufferQueueItf_; typedef const struct XAAndroidBufferQueueItf_ * const * XAAndroidBufferQueueItf; diff --git a/wilhelm/include/SLES/OpenSLES_Android.h b/wilhelm/include/SLES/OpenSLES_Android.h index dee731c3..0f228ca8 100644 --- a/wilhelm/include/SLES/OpenSLES_Android.h +++ b/wilhelm/include/SLES/OpenSLES_Android.h @@ -211,7 +211,9 @@ struct SLAndroidSimpleBufferQueueItf_ { /* Android Buffer Queue Interface */ /*---------------------------------------------------------------------------*/ -extern SL_API const SLInterfaceID SL_IID_ANDROIDBUFFERQUEUE; +extern SL_API const SLInterfaceID SL_IID_ANDROIDBUFFERQUEUESOURCE; +// FIXME temporary definition to be removed +#define SL_IID_ANDROIDBUFFERQUEUE SL_IID_ANDROIDBUFFERQUEUESOURCE struct SLAndroidBufferQueueItf_; typedef const struct SLAndroidBufferQueueItf_ * const * SLAndroidBufferQueueItf; diff --git a/wilhelm/src/MPH.h b/wilhelm/src/MPH.h index a489ae9f..f822390d 100644 --- a/wilhelm/src/MPH.h +++ b/wilhelm/src/MPH.h @@ -81,7 +81,7 @@ // Android API level 12 extended interfaces // GUID and MPH are shared by SL and XA, but currently documented for XA only -#define MPH_ANDROIDBUFFERQUEUE 50 +#define MPH_ANDROIDBUFFERQUEUESOURCE 50 // OpenMAX AL 1.0.1 interfaces #define MPH_XAAUDIODECODERCAPABILITIES 51 diff --git a/wilhelm/src/MPH_to.c b/wilhelm/src/MPH_to.c index e1fe6c99..638117a3 100644 --- a/wilhelm/src/MPH_to.c +++ b/wilhelm/src/MPH_to.c @@ -85,7 +85,7 @@ const signed char MPH_to_AudioPlayer[MPH_MAX] = { [MPH_ANDROIDEFFECTSEND] = 27, [MPH_ANDROIDCONFIGURATION] = 28, [MPH_ANDROIDSIMPLEBUFFERQUEUE] = 7, // alias for [MPH_BUFFERQUEUE] - [MPH_ANDROIDBUFFERQUEUE] = 29 + [MPH_ANDROIDBUFFERQUEUESOURCE] = 29 #endif #else #include "MPH_to_AudioPlayer.h" @@ -255,7 +255,7 @@ const signed char MPH_to_MediaPlayer[MPH_MAX] = { [MPH_XASEEK] = 5, [MPH_XAPREFETCHSTATUS] = 6, #ifdef ANDROID - [MPH_ANDROIDBUFFERQUEUE] = 7, + [MPH_ANDROIDBUFFERQUEUESOURCE] = 7, #endif #else #include "MPH_to_MediaPlayer.h" diff --git a/wilhelm/src/OpenSLES_IID.c b/wilhelm/src/OpenSLES_IID.c index bbcf7dc7..95f05999 100644 --- a/wilhelm/src/OpenSLES_IID.c +++ b/wilhelm/src/OpenSLES_IID.c @@ -165,7 +165,7 @@ const struct SLInterfaceID_ SL_IID_array[MPH_MAX] = { // Android API level 12 extended interfaces // GUID and MPH shared by SL and XA, but currently documented for XA only - // SL_IID_ANDROIDBUFFERQUEUE + // SL_IID_ANDROIDBUFFERQUEUESOURCE { 0x7fc1a460, 0xeec1, 0x11df, 0xa306, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } }, // OpenMAX AL 1.0.1 interfaces diff --git a/wilhelm/src/autogen/IID_to_MPH.c b/wilhelm/src/autogen/IID_to_MPH.c index 1982029e..35046cee 100644 --- a/wilhelm/src/autogen/IID_to_MPH.c +++ b/wilhelm/src/autogen/IID_to_MPH.c @@ -144,7 +144,7 @@ int IID_to_MPH(const SLInterfaceID iid) -1, MPH_BUFFERQUEUE, -1, - MPH_ANDROIDBUFFERQUEUE, + MPH_ANDROIDBUFFERQUEUESOURCE, MPH_PLAY, -1, MPH_XAMETADATAINSERTION, diff --git a/wilhelm/src/classes.c b/wilhelm/src/classes.c index 5c6c982c..bf707bd7 100644 --- a/wilhelm/src/classes.c +++ b/wilhelm/src/classes.c @@ -89,7 +89,7 @@ static const struct iid_vtable AudioPlayer_interfaces[INTERFACES_AudioPlayer] = {MPH_ANDROIDEFFECTSEND, INTERFACE_EXPLICIT, offsetof(CAudioPlayer, mAndroidEffectSend)}, {MPH_ANDROIDCONFIGURATION, INTERFACE_EXPLICIT_PREREALIZE, offsetof(CAudioPlayer, mAndroidConfiguration)}, - {MPH_ANDROIDBUFFERQUEUE, INTERFACE_EXPLICIT, offsetof(CAudioPlayer, mAndroidBufferQueue)}, + {MPH_ANDROIDBUFFERQUEUESOURCE, INTERFACE_EXPLICIT, offsetof(CAudioPlayer, mAndroidBufferQueue)}, #endif }; @@ -412,7 +412,7 @@ static const struct iid_vtable MediaPlayer_interfaces[INTERFACES_MediaPlayer] = {MPH_XASEEK, INTERFACE_EXPLICIT, offsetof(CMediaPlayer, mSeek)}, {MPH_XAPREFETCHSTATUS, INTERFACE_EXPLICIT, offsetof(CMediaPlayer, mPrefetchStatus)}, #ifdef ANDROID - {MPH_ANDROIDBUFFERQUEUE, INTERFACE_EXPLICIT, offsetof(CMediaPlayer, mAndroidBufferQueue)}, + {MPH_ANDROIDBUFFERQUEUESOURCE, INTERFACE_EXPLICIT, offsetof(CMediaPlayer, mAndroidBufferQueue)}, #endif }; diff --git a/wilhelm/src/interfaces.c b/wilhelm/src/interfaces.c index 02cbd8ed..b0cbd9d7 100644 --- a/wilhelm/src/interfaces.c +++ b/wilhelm/src/interfaces.c @@ -79,7 +79,7 @@ const char * const interface_names[MPH_MAX] = { "ANDROIDSIMPLEBUFFERQUEUE", // Android API level 12 extended interfaces - "ANDROIDBUFFERQUEUE", + "ANDROIDBUFFERQUEUESOURCE", // OpenMAX AL 1.0.1 interfaces "XAAUDIODECODERCAPABILITIES", diff --git a/wilhelm/src/sl_iid.c b/wilhelm/src/sl_iid.c index 8f2adb0e..02078997 100644 --- a/wilhelm/src/sl_iid.c +++ b/wilhelm/src/sl_iid.c @@ -80,7 +80,7 @@ const SLInterfaceID SL_IID_ANDROIDSIMPLEBUFFERQUEUE = &SL_IID_array[MPH_ANDROIDS // Android API level 12 extended interfaces // GUID and MPH are shared by SL and XA -const SLInterfaceID SL_IID_ANDROIDBUFFERQUEUE = &SL_IID_array[MPH_ANDROIDBUFFERQUEUE]; +const SLInterfaceID SL_IID_ANDROIDBUFFERQUEUESOURCE = &SL_IID_array[MPH_ANDROIDBUFFERQUEUESOURCE]; #ifdef __cplusplus } diff --git a/wilhelm/src/sles.c b/wilhelm/src/sles.c index 49892f7b..342ab683 100644 --- a/wilhelm/src/sles.c +++ b/wilhelm/src/sles.c @@ -424,8 +424,8 @@ extern bool { /* MPH_ANDROIDCONFIGURATION */ IAndroidConfiguration_init, NULL, NULL, NULL, NULL }, { /* MPH_ANDROIDSIMPLEBUFFERQUEUE */ IBufferQueue_init /* alias */, NULL, NULL, NULL, NULL }, // Android API level 10 extended interfaces - { /* MPH_ANDROIDBUFFERQUEUE */ IAndroidBufferQueue_init, NULL, IAndroidBufferQueue_deinit, NULL, - NULL }, + { /* MPH_ANDROIDBUFFERQUEUESOURCE */ IAndroidBufferQueue_init, NULL, IAndroidBufferQueue_deinit, + NULL, NULL }, // OpenMAX AL 1.0.1 interfaces { /* MPH_XAAUDIODECODERCAPABILITIES */ NULL, NULL, NULL, NULL, NULL }, { /* MPH_XAAUDIOENCODER */ NULL, NULL, NULL, NULL, NULL }, diff --git a/wilhelm/src/xa_iid.c b/wilhelm/src/xa_iid.c index 0580ef86..0f51ae59 100644 --- a/wilhelm/src/xa_iid.c +++ b/wilhelm/src/xa_iid.c @@ -79,8 +79,8 @@ const XAInterfaceID XA_IID_VOLUME = (XAInterfaceID) &SL_IID_array[MPH_XAVOLUME]; // OpenMAX AL 1.0.1 Android API level 12 extended interfaces // GUID and MPH are shared by SL and XA -const XAInterfaceID XA_IID_ANDROIDBUFFERQUEUE = - (XAInterfaceID) &SL_IID_array[MPH_ANDROIDBUFFERQUEUE]; +const XAInterfaceID XA_IID_ANDROIDBUFFERQUEUESOURCE = + (XAInterfaceID) &SL_IID_array[MPH_ANDROIDBUFFERQUEUESOURCE]; #ifdef __cplusplus } diff --git a/wilhelm/tests/native-media/jni/native-media-jni.c b/wilhelm/tests/native-media/jni/native-media-jni.c index 1a75388c..2845b3cd 100644 --- a/wilhelm/tests/native-media/jni/native-media-jni.c +++ b/wilhelm/tests/native-media/jni/native-media-jni.c @@ -363,7 +363,8 @@ jboolean Java_com_example_nativemedia_NativeMedia_createStreamingMediaPlayer(JNI XAboolean required[NB_MAXAL_INTERFACES] = {XA_BOOLEAN_TRUE, XA_BOOLEAN_TRUE, XA_BOOLEAN_TRUE}; XAInterfaceID iidArray[NB_MAXAL_INTERFACES] - = {XA_IID_PLAY, XA_IID_ANDROIDBUFFERQUEUE, XA_IID_STREAMINFORMATION}; + = {XA_IID_PLAY, XA_IID_ANDROIDBUFFERQUEUESOURCE, + XA_IID_STREAMINFORMATION}; // create media player @@ -394,7 +395,7 @@ jboolean Java_com_example_nativemedia_NativeMedia_createStreamingMediaPlayer(JNI assert(XA_RESULT_SUCCESS == res); // get the Android buffer queue interface - res = (*playerObj)->GetInterface(playerObj, XA_IID_ANDROIDBUFFERQUEUE, &playerBQItf); + res = (*playerObj)->GetInterface(playerObj, XA_IID_ANDROIDBUFFERQUEUESOURCE, &playerBQItf); assert(XA_RESULT_SUCCESS == res); // specify which events we want to be notified of diff --git a/wilhelm/tests/sandbox/streamSource/slesTestPlayStream.cpp b/wilhelm/tests/sandbox/streamSource/slesTestPlayStream.cpp index 71c72004..f616d7b3 100644 --- a/wilhelm/tests/sandbox/streamSource/slesTestPlayStream.cpp +++ b/wilhelm/tests/sandbox/streamSource/slesTestPlayStream.cpp @@ -221,7 +221,7 @@ void TestPlayStream( SLObjectItf sl, const char* path) required[0] = SL_BOOLEAN_TRUE; iidArray[0] = SL_IID_VOLUME; required[1] = SL_BOOLEAN_TRUE; - iidArray[1] = SL_IID_ANDROIDBUFFERQUEUE; + iidArray[1] = SL_IID_ANDROIDBUFFERQUEUESOURCE; // Create Output Mix object to be used by player res = (*EngineItf)->CreateOutputMix(EngineItf, &OutputMix, 0, iidArray, required); CheckErr(res); @@ -259,7 +259,7 @@ void TestPlayStream( SLObjectItf sl, const char* path) res = (*player)->GetInterface(player, SL_IID_VOLUME, (void*)&volItf); CheckErr(res); - res = (*player)->GetInterface(player, SL_IID_ANDROIDBUFFERQUEUE, (void*)&abqItf); + res = (*player)->GetInterface(player, SL_IID_ANDROIDBUFFERQUEUESOURCE, (void*)&abqItf); CheckErr(res); res = (*abqItf)->RegisterCallback(abqItf, AndroidBufferQueueCallback, diff --git a/wilhelm/tests/sandbox/xaplay.c b/wilhelm/tests/sandbox/xaplay.c index 18a3e54c..2e72d120 100644 --- a/wilhelm/tests/sandbox/xaplay.c +++ b/wilhelm/tests/sandbox/xaplay.c @@ -347,7 +347,7 @@ reinitialize: ; // create media player XAObjectItf playerObject; XAInterfaceID ids[4] = {XA_IID_STREAMINFORMATION, XA_IID_PREFETCHSTATUS, XA_IID_SEEK, - XA_IID_ANDROIDBUFFERQUEUE}; + XA_IID_ANDROIDBUFFERQUEUESOURCE}; XAboolean req[4] = {XA_BOOLEAN_TRUE, XA_BOOLEAN_TRUE, XA_BOOLEAN_TRUE, XA_BOOLEAN_TRUE}; result = (*engineEngine)->CreateMediaPlayer(engineEngine, &playerObject, &dataSrc, NULL, &audioSnk, nativeWindow != NULL ? &imageVideoSink : NULL, NULL, NULL, abq ? 4 : 3, ids, @@ -362,7 +362,7 @@ reinitialize: ; // get the Android buffer queue interface XAAndroidBufferQueueItf playerAndroidBufferQueue; - result = (*playerObject)->GetInterface(playerObject, XA_IID_ANDROIDBUFFERQUEUE, + result = (*playerObject)->GetInterface(playerObject, XA_IID_ANDROIDBUFFERQUEUESOURCE, &playerAndroidBufferQueue); assert(XA_RESULT_SUCCESS == result); -- 2.11.0