diff options
author | Xin Wang <xin1.wang@intel.com> | 2016-05-30 10:56:25 +0800 |
---|---|---|
committer | Nick Desaulniers <ndesaulniers@google.com> | 2016-06-02 10:27:54 -0700 |
commit | 6b2c35f759069df850da5c0364cea0657a5cb837 (patch) | |
tree | 72dcdba0d169f72f97487b9f298d02e49adfdc9d | |
parent | 74ffefbf1d5ea6887844738021e02279c3de7547 (diff) | |
download | omx-components-6b2c35f759069df850da5c0364cea0657a5cb837.tar.gz |
Fixed the CTS DecodeAccuracyTest LargerWidth/Height issue.
Bug: 27589011
Bug: IMINAN-49451
By handling format change, in case that the port definition set by
OMX client mismatches with the real dimension of a video clip/stream.
Change-Id: Id081b351c29137360045397b06b9f12398aa5ffe
Signed-off-by: Austin Hu <austin.hu@intel.com>
-rw-r--r-- | videocodec/OMXVideoDecoderVP9Hybrid.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/videocodec/OMXVideoDecoderVP9Hybrid.cpp b/videocodec/OMXVideoDecoderVP9Hybrid.cpp index 8c346cf..aef9821 100644 --- a/videocodec/OMXVideoDecoderVP9Hybrid.cpp +++ b/videocodec/OMXVideoDecoderVP9Hybrid.cpp @@ -209,6 +209,9 @@ bool OMXVideoDecoderVP9Hybrid::isReallocateNeeded(const uint8_t * data,uint32_t bool ret = true; if (gralloc_mode) { ret = mGetFrameResolution(data,data_sz, &width, &height); + if (width == 0 || height == 0) + return false; + if (ret) { if (mAPMode == METADATA_MODE) { ret = (width != mDecodedImageWidth) @@ -292,6 +295,21 @@ OMX_ERRORTYPE OMXVideoDecoderVP9Hybrid::ProcessorProcess( OMX_ERRORTYPE ret; OMX_BUFFERHEADERTYPE *inBuffer = *pBuffers[INPORT_INDEX]; OMX_BUFFERHEADERTYPE *outBuffer = *pBuffers[OUTPORT_INDEX]; + + if ((mWorkingMode == GRAPHICBUFFER_MODE) && (mAPMode == METADATA_MODE) && + (mLastTimeStamp == 0) && (!mFormatChanged)) { + bool mRet = mGetFrameResolution(inBuffer->pBuffer + inBuffer->nOffset, inBuffer->nFilledLen, + &mDecodedImageNewWidth,&mDecodedImageNewHeight); + + if (mRet && ((mDecodedImageNewWidth != 0) && (mDecodedImageNewHeight != 0)) && + ((mDecodedImageWidth != 0) && (mDecodedImageHeight != 0)) && + ((mDecodedImageNewWidth != mDecodedImageWidth || mDecodedImageNewHeight != mDecodedImageHeight))) { + retains[INPORT_INDEX] = BUFFER_RETAIN_GETAGAIN; + HandleFormatChange(); + return OMX_ErrorNone; + } + } + bool eos = (inBuffer->nFlags & OMX_BUFFERFLAG_EOS)? true:false; OMX_BOOL isResolutionChange = OMX_FALSE; bool formatChange = false; |