diff options
author | James Dong <jdong@google.com> | 2011-09-14 17:42:22 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-09-14 17:42:22 -0700 |
commit | 5dc2812abddde309234edc786a541d251c4f820a (patch) | |
tree | f4c077a42c5577d4fc9b098583a021f67382ba3e | |
parent | 6de6b48237423a65ec041288c90e3f78fd3fce48 (diff) | |
parent | 9a5e04438df742c297c5dbcdb60e6fd4d8f8321d (diff) | |
download | frameworks_av-5dc2812abddde309234edc786a541d251c4f820a.zip frameworks_av-5dc2812abddde309234edc786a541d251c4f820a.tar.gz frameworks_av-5dc2812abddde309234edc786a541d251c4f820a.tar.bz2 |
Merge "Change an assert failure due to unsupported level by HW AVC decoder and report the error to applications"
-rw-r--r-- | include/media/stagefright/OMXCodec.h | 2 | ||||
-rwxr-xr-x | media/libstagefright/OMXCodec.cpp | 19 |
2 files changed, 11 insertions, 10 deletions
diff --git a/include/media/stagefright/OMXCodec.h b/include/media/stagefright/OMXCodec.h index 2932744..8baf5ec 100644 --- a/include/media/stagefright/OMXCodec.h +++ b/include/media/stagefright/OMXCodec.h @@ -303,7 +303,7 @@ private: bool flushPortAsync(OMX_U32 portIndex); void disablePortAsync(OMX_U32 portIndex); - void enablePortAsync(OMX_U32 portIndex); + status_t enablePortAsync(OMX_U32 portIndex); static size_t countBuffersWeOwn(const Vector<BufferInfo> &buffers); static bool isIntermediateState(State state); diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp index 9ab470b..6280f51 100755 --- a/media/libstagefright/OMXCodec.cpp +++ b/media/libstagefright/OMXCodec.cpp @@ -2452,13 +2452,16 @@ void OMXCodec::onCmdComplete(OMX_COMMANDTYPE cmd, OMX_U32 data) { mOutputPortSettingsHaveChanged = formatChanged; } - enablePortAsync(portIndex); - - status_t err = allocateBuffersOnPort(portIndex); - + status_t err = enablePortAsync(portIndex); if (err != OK) { - CODEC_LOGE("allocateBuffersOnPort failed (err = %d)", err); + CODEC_LOGE("enablePortAsync(%ld) failed (err = %d)", portIndex, err); setState(ERROR); + } else { + err = allocateBuffersOnPort(portIndex); + if (err != OK) { + CODEC_LOGE("allocateBuffersOnPort failed (err = %d)", err); + setState(ERROR); + } } } break; @@ -2773,16 +2776,14 @@ void OMXCodec::disablePortAsync(OMX_U32 portIndex) { freeBuffersOnPort(portIndex, true); } -void OMXCodec::enablePortAsync(OMX_U32 portIndex) { +status_t OMXCodec::enablePortAsync(OMX_U32 portIndex) { CHECK(mState == EXECUTING || mState == RECONFIGURING); CHECK_EQ((int)mPortStatus[portIndex], (int)DISABLED); mPortStatus[portIndex] = ENABLING; CODEC_LOGV("sending OMX_CommandPortEnable(%ld)", portIndex); - status_t err = - mOMX->sendCommand(mNode, OMX_CommandPortEnable, portIndex); - CHECK_EQ(err, (status_t)OK); + return mOMX->sendCommand(mNode, OMX_CommandPortEnable, portIndex); } void OMXCodec::fillOutputBuffers() { |