aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorywan171 <yi.a.wang@intel.com>2012-03-26 14:48:49 +0800
committerPatrick Tjin <pattjin@google.com>2014-07-21 22:02:46 -0700
commitd08540b264abd22a4302ffb28ca073ab0e2dd8db (patch)
tree7055d7e262523b66db39e56ef985fcfd963e0ca7
parentf775da472a8f0a626b0615eb283d614e0893f816 (diff)
downloadandroid_hardware_intel_common_omx-components-d08540b264abd22a4302ffb28ca073ab0e2dd8db.tar.gz
android_hardware_intel_common_omx-components-d08540b264abd22a4302ffb28ca073ab0e2dd8db.tar.bz2
android_hardware_intel_common_omx-components-d08540b264abd22a4302ffb28ca073ab0e2dd8db.zip
omx-component: Refine omx IL to output the last few frames in libmix output queue
BZ: 28544 Refine omx IL to output the last few frames in libmix output queue, if output port is not eos, retain the input eos buffer until all the buffers in the output queue are drained out Change-Id: I08ac1e90d82720653558fdc9c509f7d4831ff90d Signed-off-by: ywan171 <yi.a.wang@intel.com> Reviewed-on: http://android.intel.com:8080/40101 Reviewed-by: Qiu, Junhai <junhai.qiu@intel.com> Reviewed-by: Ding, Haitao <haitao.ding@intel.com> Tested-by: Ding, Haitao <haitao.ding@intel.com> Reviewed-by: buildbot <buildbot@intel.com> Tested-by: buildbot <buildbot@intel.com>
-rw-r--r--videocodec/OMXVideoDecoderBase.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/videocodec/OMXVideoDecoderBase.cpp b/videocodec/OMXVideoDecoderBase.cpp
index fd29691..a703d29 100644
--- a/videocodec/OMXVideoDecoderBase.cpp
+++ b/videocodec/OMXVideoDecoderBase.cpp
@@ -347,6 +347,15 @@ OMX_ERRORTYPE OMXVideoDecoderBase::ProcessorProcess(
// drain the decoder output queue when in EOS state and fill the render buffer
ret = FillRenderBuffer(pBuffers[OUTPORT_INDEX], &retains[OUTPORT_INDEX], ((*pBuffers[INPORT_INDEX]))->nFlags);
+ bool inputEoS = ((*pBuffers[INPORT_INDEX])->nFlags & OMX_BUFFERFLAG_EOS);
+ bool outputEoS = ((*pBuffers[OUTPORT_INDEX])->nFlags & OMX_BUFFERFLAG_EOS);
+ //if output port is not eos, retain the input buffer until all the output buffers are drained.
+ if (inputEoS && !outputEoS) {
+ retains[INPORT_INDEX] = BUFFER_RETAIN_GETAGAIN;
+ // the input buffer is retained for draining purpose.set nFilledLen to 0 so buffer will not be decoded again.
+ (*pBuffers[INPORT_INDEX])->nFilledLen = 0;
+ }
+
if (ret == OMX_ErrorNotReady) {
retains[OUTPORT_INDEX] = BUFFER_RETAIN_GETAGAIN;
ret = OMX_ErrorNone;
@@ -467,7 +476,7 @@ OMX_ERRORTYPE OMXVideoDecoderBase::FillRenderBuffer(OMX_BUFFERHEADERTYPE **pBuff
if (renderBuffer == NULL) {
buffer->nFilledLen = 0;
if (draining) {
- LOGI("EOS received");
+ LOGI("output EOS received");
buffer->nFlags = OMX_BUFFERFLAG_EOS;
return OMX_ErrorNone;
}