diff options
author | Wei Jia <wjia@google.com> | 2014-09-22 16:22:43 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-09-22 16:22:43 +0000 |
commit | 6f7a0014777a68999c76b48feab4a85d4580c357 (patch) | |
tree | a8c3c65bc36a6968e74f4c3ac9c6feac4eeefa56 /media/libstagefright/ACodec.cpp | |
parent | 43035258db3a7335a3992b50b3e45573b263cd2a (diff) | |
parent | 0079b331227fc1555d7c5305f33917a570d44890 (diff) | |
download | frameworks_av-6f7a0014777a68999c76b48feab4a85d4580c357.zip frameworks_av-6f7a0014777a68999c76b48feab4a85d4580c357.tar.gz frameworks_av-6f7a0014777a68999c76b48feab4a85d4580c357.tar.bz2 |
am 0079b331: Merge "MediaBuffer: ABuffer will release MediaBuffer when it\'s destructed." into lmp-dev
* commit '0079b331227fc1555d7c5305f33917a570d44890':
MediaBuffer: ABuffer will release MediaBuffer when it's destructed.
Diffstat (limited to 'media/libstagefright/ACodec.cpp')
-rw-r--r-- | media/libstagefright/ACodec.cpp | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index 0060b88..cea8300 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -3782,23 +3782,12 @@ bool ACodec::BaseState::onOMXEmptyBufferDone(IOMX::buffer_id bufferID) { CHECK_EQ((int)info->mStatus, (int)BufferInfo::OWNED_BY_COMPONENT); info->mStatus = BufferInfo::OWNED_BY_US; - const sp<AMessage> &bufferMeta = info->mData->meta(); - void *mediaBuffer; - if (bufferMeta->findPointer("mediaBuffer", &mediaBuffer) - && mediaBuffer != NULL) { - // We're in "store-metadata-in-buffers" mode, the underlying - // OMX component had access to data that's implicitly refcounted - // by this "mediaBuffer" object. Now that the OMX component has - // told us that it's done with the input buffer, we can decrement - // the mediaBuffer's reference count. - - ALOGV("releasing mbuf %p", mediaBuffer); - - ((MediaBuffer *)mediaBuffer)->release(); - mediaBuffer = NULL; - - bufferMeta->setPointer("mediaBuffer", NULL); - } + // We're in "store-metadata-in-buffers" mode, the underlying + // OMX component had access to data that's implicitly refcounted + // by this "MediaBuffer" object. Now that the OMX component has + // told us that it's done with the input buffer, we can decrement + // the mediaBuffer's reference count. + info->mData->setMediaBufferBase(NULL); PortMode mode = getPortMode(kPortIndexInput); |