diff options
author | Lajos Molnar <lajos@google.com> | 2013-11-18 17:34:39 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-11-18 17:34:39 -0800 |
commit | 72afcd5da296b1f5fb38ef037054855aaea88054 (patch) | |
tree | 86e133dd9ddae1ba252c156e1a41d8e4c8f99486 /media | |
parent | 2381f06f374ee0cb8bca0edf5388394432b00e6d (diff) | |
parent | 5ea5b020b311a68f513d4a40aca5551abc6a07d8 (diff) | |
download | frameworks_av-72afcd5da296b1f5fb38ef037054855aaea88054.zip frameworks_av-72afcd5da296b1f5fb38ef037054855aaea88054.tar.gz frameworks_av-72afcd5da296b1f5fb38ef037054855aaea88054.tar.bz2 |
am 5ea5b020: Merge "WA: Queue extra buffers on output port during reconfig if input EOS-ed" into klp-dev
* commit '5ea5b020b311a68f513d4a40aca5551abc6a07d8':
WA: Queue extra buffers on output port during reconfig if input EOS-ed
Diffstat (limited to 'media')
-rw-r--r-- | media/libstagefright/ACodec.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index 528fdb9..5d5220f 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -452,6 +452,18 @@ void ACodec::signalRequestIDRFrame() { (new AMessage(kWhatRequestIDRFrame, id()))->post(); } +// *** NOTE: THE FOLLOWING WORKAROUND WILL BE REMOVED *** +// Some codecs may return input buffers before having them processed. +// This causes a halt if we already signaled an EOS on the input +// port. For now keep submitting an output buffer if there was an +// EOS on the input port, but not yet on the output port. +void ACodec::signalSubmitOutputMetaDataBufferIfEOS_workaround() { + if (mPortEOS[kPortIndexInput] && !mPortEOS[kPortIndexOutput] && + mMetaDataBuffersToSubmit > 0) { + (new AMessage(kWhatSubmitOutputMetaDataBufferIfEOS, id()))->post(); + } +} + status_t ACodec::allocateBuffersOnPort(OMX_U32 portIndex) { CHECK(portIndex == kPortIndexInput || portIndex == kPortIndexOutput); @@ -4036,6 +4048,9 @@ void ACodec::ExecutingState::submitOutputMetaBuffers() { break; } } + + // *** NOTE: THE FOLLOWING WORKAROUND WILL BE REMOVED *** + mCodec->signalSubmitOutputMetaDataBufferIfEOS_workaround(); } void ACodec::ExecutingState::submitRegularOutputBuffers() { @@ -4184,6 +4199,19 @@ bool ACodec::ExecutingState::onMessageReceived(const sp<AMessage> &msg) { break; } + // *** NOTE: THE FOLLOWING WORKAROUND WILL BE REMOVED *** + case kWhatSubmitOutputMetaDataBufferIfEOS: + { + if (mCodec->mPortEOS[kPortIndexInput] && + !mCodec->mPortEOS[kPortIndexOutput]) { + status_t err = mCodec->submitOutputMetaDataBuffer(); + if (err == OK) { + mCodec->signalSubmitOutputMetaDataBufferIfEOS_workaround(); + } + } + return true; + } + default: handled = BaseState::onMessageReceived(msg); break; |