diff options
author | Angela Stegmaier <angelabaker@ti.com> | 2016-11-02 17:10:35 -0500 |
---|---|---|
committer | Sunita Nadampalli <sunitan@ti.com> | 2017-01-31 14:21:59 -0500 |
commit | f34683746dade715257398e7d5f325094db26afd (patch) | |
tree | 8056ffcf128d701f3c9123c0a3bc31a2b4b53b8c | |
parent | ad15e27f09c64d9a60ba402edecd9ad7f974accd (diff) | |
download | dra7xx-f34683746dade715257398e7d5f325094db26afd.tar.gz |
OMX: Only Call HandleFirstFrame if First Frame Has Been Decoded
In some situations, HandleFirstFrame was being called before a first frame
had been decoded. In this case, the port was being reconfigured to an
invalid width and height, resulting in a subsequent VIDDEC3_create failure.
This patch modifies the OMX to only call HandleFirstFrame if the frame
counter is greater than 0, so that it will have valid status information
for width and height.
Change-Id: I43180540dcf87f94821d425c6815fb2da3f86313
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
-rw-r--r-- | omx/videodecode/omx_videodec_common/src/omx_video_decoder.c | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/omx/videodecode/omx_videodec_common/src/omx_video_decoder.c b/omx/videodecode/omx_videodec_common/src/omx_video_decoder.c index 1979438..93ffde0 100644 --- a/omx/videodecode/omx_videodec_common/src/omx_video_decoder.c +++ b/omx/videodecode/omx_videodec_common/src/omx_video_decoder.c @@ -1167,12 +1167,30 @@ OMX_ERRORTYPE OMXVidDec_DataNotify(OMX_HANDLETYPE hComponent) if( pOutputPortDef->format.video.nFrameWidth < out2DAllocParam.nWidth || pOutputPortDef->format.video.nFrameHeight < out2DAllocParam.nHeight ) { - pVidDecComp->sBase.pPvtData->fpDioCancel(hComponent, - OMX_VIDDEC_INPUT_PORT, pInBufHeader); - pVidDecComp->sBase.pPvtData->fpDioCancel(hComponent, - OMX_VIDDEC_OUTPUT_PORT, pOutBufHeader); + if (pVidDecComp->nFrameCounter) { + pVidDecComp->sBase.pPvtData->fpDioCancel(hComponent, + OMX_VIDDEC_INPUT_PORT, pInBufHeader); + pVidDecComp->sBase.pPvtData->fpDioCancel(hComponent, + OMX_VIDDEC_OUTPUT_PORT, pOutBufHeader); - OMXVidDec_HandleFirstFrame(hComponent, NULL); + OMXVidDec_HandleFirstFrame(hComponent, NULL); + } else { + pOutputPortDef->format.video.nFrameWidth = out2DAllocParam.nWidth; + pOutputPortDef->format.video.nFrameHeight = out2DAllocParam.nHeight; + pOutputPortDef->format.video.nStride = pOutputPortDef->format.video.nFrameWidth; + pOutputPortDef->nBufferSize = pOutputPortDef->format.video.nStride * + ((pOutputPortDef->format.video.nFrameHeight * 3) >> 1); + + pVidDecComp->sBase.pPvtData->fpDioCancel(hComponent, + OMX_VIDDEC_INPUT_PORT, pInBufHeader); + pVidDecComp->sBase.pPvtData->fpDioCancel(hComponent, + OMX_VIDDEC_OUTPUT_PORT, pOutBufHeader); + + /*! Notify to Client change in output port settings */ + eError = pVidDecComp->sBase.fpReturnEventNotify(hComponent, + OMX_EventPortSettingsChanged, OMX_VIDDEC_OUTPUT_PORT, 0, NULL); + pVidDecComp->nOutPortReconfigRequired = 1; + } goto EXIT; } } |