Simplify code for the AAC decode use case
Details:
AacBqToPcmCbRenderer constructor
now takes an additional parameter: the IAndroidBufferQueue * interface.
So now there is no need to register a callback after construction,
and AacBqToPcmCbRenderer::registerSourceQueueCallback
can be deleted.
This allows android_audioPlayer_androidBufferQueue_registerCallback_l
to be deleted.
AacBqToPcmCbRenderer::mBqSource is always non-NULL and const, so this
allows removal of mBqSourceLock and some error-checking code.
BufferQueueSource source constructor now takes the IAndroidBufferQueue *
interface instead of the list [user, context, caller].
This allows mAndroidBufferQueueSource to be const, which then allows
more code to be deleted in IAndroidBufferQueue_RegisterCallback.
new AacAdtsExtractor can't fail.
Change-Id: I1f39ccc1e69833fe6df616feb76edbe4ce82fca7
diff --git a/src/itf/IAndroidBufferQueue.c b/src/itf/IAndroidBufferQueue.c
index 278b7fd..76ab546 100644
--- a/src/itf/IAndroidBufferQueue.c
+++ b/src/itf/IAndroidBufferQueue.c
@@ -214,19 +214,7 @@
if (SL_PLAYSTATE_STOPPED == getAssociatedState(thiz)) {
thiz->mCallback = callback;
thiz->mContext = pContext;
-
- // FIXME investigate why these two cases are not handled symmetrically any more
- switch (InterfaceToObjectID(thiz)) {
- case SL_OBJECTID_AUDIOPLAYER:
- result = android_audioPlayer_androidBufferQueue_registerCallback_l(
- (CAudioPlayer*) thiz->mThis);
- break;
- case XA_OBJECTID_MEDIAPLAYER:
- result = SL_RESULT_SUCCESS;
- break;
- default:
- result = SL_RESULT_PARAMETER_INVALID;
- }
+ result = SL_RESULT_SUCCESS;
} else {
result = SL_RESULT_PRECONDITIONS_VIOLATED;