diff options
author | Wei Jia <wjia@google.com> | 2014-08-20 14:30:09 -0700 |
---|---|---|
committer | Wei Jia <wjia@google.com> | 2014-08-22 14:23:02 -0700 |
commit | 3fb9f68dea5d991288f0ea8037742b50c7df5767 (patch) | |
tree | 763a8fd629b95444c2bd30e3b1eb99d779905d3e /media/libstagefright | |
parent | a8143b2bbaabc3f704b05078ccc930dbc28591b9 (diff) | |
download | frameworks_av-3fb9f68dea5d991288f0ea8037742b50c7df5767.zip frameworks_av-3fb9f68dea5d991288f0ea8037742b50c7df5767.tar.gz frameworks_av-3fb9f68dea5d991288f0ea8037742b50c7df5767.tar.bz2 |
ACodec: handle errors related to native window.
Bug: 17068327
Bug: 13133027
Change-Id: I9875e524222a10d1be26be5a84b9633b4aaeb210
Diffstat (limited to 'media/libstagefright')
-rw-r--r-- | media/libstagefright/ACodec.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index b44d5cc..e4e463a 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -813,7 +813,10 @@ status_t ACodec::allocateOutputBuffersFromNativeWindow() { for (OMX_U32 i = cancelStart; i < cancelEnd; i++) { BufferInfo *info = &mBuffers[kPortIndexOutput].editItemAt(i); - cancelBufferToNativeWindow(info); + status_t error = cancelBufferToNativeWindow(info); + if (err == 0) { + err = error; + } } return err; @@ -888,11 +891,12 @@ status_t ACodec::cancelBufferToNativeWindow(BufferInfo *info) { int err = mNativeWindow->cancelBuffer( mNativeWindow.get(), info->mGraphicBuffer.get(), -1); - CHECK_EQ(err, 0); + ALOGW_IF(err != 0, "[%s] can not return buffer %u to native window", + mComponentName.c_str(), info->mBufferID); info->mStatus = BufferInfo::OWNED_BY_NATIVE_WINDOW; - return OK; + return err; } ACodec::BufferInfo *ACodec::dequeueBufferFromNativeWindow() { @@ -992,7 +996,7 @@ status_t ACodec::freeBuffer(OMX_U32 portIndex, size_t i) { if (portIndex == kPortIndexOutput && mNativeWindow != NULL && info->mStatus == BufferInfo::OWNED_BY_US) { - CHECK_EQ((status_t)OK, cancelBufferToNativeWindow(info)); + cancelBufferToNativeWindow(info); } CHECK_EQ(mOMX->freeBuffer( |