diff options
author | Andreas Huber <andih@google.com> | 2012-05-10 16:43:19 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2012-05-11 10:12:45 -0700 |
commit | eb61431af13741aa8b7e57a39f69bba5a6c190dc (patch) | |
tree | 160d4951d23a4ee5cb7d7880df3afb923dad4eb6 /media/libstagefright/ACodec.cpp | |
parent | 240d8a84dec9f9482257a8037457a1d63193b7ff (diff) | |
download | frameworks_av-eb61431af13741aa8b7e57a39f69bba5a6c190dc.zip frameworks_av-eb61431af13741aa8b7e57a39f69bba5a6c190dc.tar.gz frameworks_av-eb61431af13741aa8b7e57a39f69bba5a6c190dc.tar.bz2 |
Increase AAC software decoder's buffer count. Refactor how clients
of ACodec get notified about codec buffers and buffer ids.
Change-Id: I962f873262dae7aa7b43f5f68a6d60268282f91e
related-to-bug: 6478823
Diffstat (limited to 'media/libstagefright/ACodec.cpp')
-rw-r--r-- | media/libstagefright/ACodec.cpp | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index 3fd6cef..7ac0f23 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -472,14 +472,16 @@ status_t ACodec::allocateBuffersOnPort(OMX_U32 portIndex) { notify->setInt32("what", ACodec::kWhatBuffersAllocated); notify->setInt32("portIndex", portIndex); + + sp<PortDescription> desc = new PortDescription; + for (size_t i = 0; i < mBuffers[portIndex].size(); ++i) { - AString name = StringPrintf("buffer-id_%d", i); - notify->setPointer(name.c_str(), mBuffers[portIndex][i].mBufferID); + const BufferInfo &info = mBuffers[portIndex][i]; - name = StringPrintf("data_%d", i); - notify->setBuffer(name.c_str(), mBuffers[portIndex][i].mData); + desc->addBuffer(info.mBufferID, info.mData); } + notify->setObject("portDesc", desc); notify->post(); return OK; @@ -2110,6 +2112,29 @@ void ACodec::signalError(OMX_ERRORTYPE error, status_t internalError) { //////////////////////////////////////////////////////////////////////////////// +ACodec::PortDescription::PortDescription() { +} + +void ACodec::PortDescription::addBuffer( + IOMX::buffer_id id, const sp<ABuffer> &buffer) { + mBufferIDs.push_back(id); + mBuffers.push_back(buffer); +} + +size_t ACodec::PortDescription::countBuffers() { + return mBufferIDs.size(); +} + +IOMX::buffer_id ACodec::PortDescription::bufferIDAt(size_t index) const { + return mBufferIDs.itemAt(index); +} + +sp<ABuffer> ACodec::PortDescription::bufferAt(size_t index) const { + return mBuffers.itemAt(index); +} + +//////////////////////////////////////////////////////////////////////////////// + ACodec::BaseState::BaseState(ACodec *codec, const sp<AState> &parentState) : AState(parentState), mCodec(codec) { |