From e100a12dae344733f63f73702945be8598731f41 Mon Sep 17 00:00:00 2001 From: SeungBeom Kim Date: Wed, 27 Feb 2013 10:10:02 +0900 Subject: [PATCH] openmax: Support EOSBehavior. Google has updated CTS test. Support EOSBehavior for testEOSBehaviorH263 & testEOSBehaviorH264. In case of "EOS Flag with Data", This Patch is support for normal processing. Depends On - Change I781712a5: libcodec: Support EOSBehavior. Change-Id: I560434c55dd4932f018f973e0093453f493409cb Signed-off-by: SeungBeom Kim --- component/common/Exynos_OMX_Basecomponent.h | 3 +- component/video/dec/Exynos_OMX_Vdec.c | 49 ++++++++++++++- component/video/dec/Exynos_OMX_VdecControl.c | 60 ++++++++++++------- component/video/dec/h264/Exynos_OMX_H264dec.c | 9 +++ .../video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c | 9 +++ .../video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c | 9 +++ component/video/dec/vc1/Exynos_OMX_Wmvdec.c | 9 +++ component/video/dec/vp8/Exynos_OMX_Vp8dec.c | 9 +++ component/video/enc/Exynos_OMX_Venc.c | 8 ++- component/video/enc/Exynos_OMX_VencControl.c | 2 +- component/video/enc/h264/Exynos_OMX_H264enc.c | 8 ++- .../video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c | 8 ++- 12 files changed, 153 insertions(+), 30 deletions(-) diff --git a/component/common/Exynos_OMX_Basecomponent.h b/component/common/Exynos_OMX_Basecomponent.h index 9f9ed3d..2690445 100644 --- a/component/common/Exynos_OMX_Basecomponent.h +++ b/component/common/Exynos_OMX_Basecomponent.h @@ -95,7 +95,8 @@ typedef struct _EXYNOS_OMX_BASECOMPONENT OMX_BOOL reInputData; OMX_BOOL bUseFlagEOF; - OMX_BOOL bSaveFlagEOS; + OMX_BOOL bSaveFlagEOS; /* bSaveFlagEOS is OMX_TRUE, if EOS flag is incoming. */ + OMX_BOOL bBehaviorEOS; /* bBehaviorEOS is OMX_TRUE, if EOS flag with Data are incoming. */ /* Check for Old & New OMX Process type switch */ OMX_BOOL bMultiThreadProcess; diff --git a/component/video/dec/Exynos_OMX_Vdec.c b/component/video/dec/Exynos_OMX_Vdec.c index fefdd0a..7b7dcb4 100644 --- a/component/video/dec/Exynos_OMX_Vdec.c +++ b/component/video/dec/Exynos_OMX_Vdec.c @@ -214,6 +214,47 @@ OMX_BOOL Exynos_Check_BufferProcess_State(EXYNOS_OMX_BASECOMPONENT *pExynosCompo return ret; } +OMX_ERRORTYPE Exynos_ResetAllPortConfig(OMX_COMPONENTTYPE *pOMXComponent) +{ + OMX_ERRORTYPE ret = OMX_ErrorNone; + EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; + EXYNOS_OMX_BASEPORT *pInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; + EXYNOS_OMX_BASEPORT *pOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; + + /* Input port */ + pInputPort->portDefinition.format.video.nFrameWidth = DEFAULT_FRAME_WIDTH; + pInputPort->portDefinition.format.video.nFrameHeight = DEFAULT_FRAME_HEIGHT; + pInputPort->portDefinition.format.video.nStride = 0; /*DEFAULT_FRAME_WIDTH;*/ + pInputPort->portDefinition.format.video.nSliceHeight = 0; + pInputPort->portDefinition.format.video.pNativeRender = 0; + pInputPort->portDefinition.format.video.bFlagErrorConcealment = OMX_FALSE; + pInputPort->portDefinition.format.video.eColorFormat = OMX_COLOR_FormatUnused; + + pInputPort->portDefinition.nBufferSize = DEFAULT_VIDEO_INPUT_BUFFER_SIZE; + pInputPort->portDefinition.bEnabled = OMX_TRUE; + + pInputPort->bufferProcessType = BUFFER_SHARE; + pInputPort->portWayType = WAY2_PORT; + + /* Output port */ + pOutputPort->portDefinition.format.video.nFrameWidth = DEFAULT_FRAME_WIDTH; + pOutputPort->portDefinition.format.video.nFrameHeight = DEFAULT_FRAME_HEIGHT; + pOutputPort->portDefinition.format.video.nStride = 0; /*DEFAULT_FRAME_WIDTH;*/ + pOutputPort->portDefinition.format.video.nSliceHeight = 0; + pOutputPort->portDefinition.format.video.pNativeRender = 0; + pOutputPort->portDefinition.format.video.bFlagErrorConcealment = OMX_FALSE; + pOutputPort->portDefinition.format.video.eColorFormat = OMX_COLOR_FormatYUV420Planar; + + pOutputPort->portDefinition.nBufferSize = DEFAULT_VIDEO_OUTPUT_BUFFER_SIZE; + pOutputPort->portDefinition.bEnabled = OMX_TRUE; + + pOutputPort->bufferProcessType = BUFFER_COPY | BUFFER_ANBSHARE; + pOutputPort->bIsANBEnabled = OMX_FALSE; + pOutputPort->portWayType = WAY2_PORT; + + return ret; +} + OMX_ERRORTYPE Exynos_Input_CodecBufferToData(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, OMX_PTR codecBuffer, EXYNOS_OMX_DATA *pData) { OMX_ERRORTYPE ret = OMX_ErrorNone; @@ -495,9 +536,9 @@ OMX_BOOL Exynos_Preprocessor_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_ if ((srcInputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) { Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "bSaveFlagEOS : OMX_TRUE"); - srcInputData->dataLen = 0; - srcInputData->remainDataLen = 0; pExynosComponent->bSaveFlagEOS = OMX_TRUE; + if (srcInputData->dataLen != 0) + pExynosComponent->bBehaviorEOS = OMX_TRUE; } if (pExynosComponent->checkTimeStamp.needSetStartTimeStamp == OMX_TRUE) { @@ -1128,6 +1169,9 @@ OMX_ERRORTYPE Exynos_OMX_BufferProcess_Terminate(OMX_HANDLETYPE hComponent) Exynos_OSAL_ThreadTerminate(pVideoDec->hDstOutputThread); pVideoDec->hDstOutputThread = NULL; + pExynosComponent->checkTimeStamp.needSetStartTimeStamp = OMX_FALSE; + pExynosComponent->checkTimeStamp.needCheckStartTimeStamp = OMX_FALSE; + EXIT: FunctionOut(); @@ -1185,6 +1229,7 @@ OMX_ERRORTYPE Exynos_OMX_VideoDecodeComponentInit(OMX_IN OMX_HANDLETYPE hCompone pExynosComponent->hComponentHandle = (OMX_HANDLETYPE)pVideoDec; pExynosComponent->bSaveFlagEOS = OMX_FALSE; + pExynosComponent->bBehaviorEOS = OMX_FALSE; pExynosComponent->bMultiThreadProcess = OMX_TRUE; /* Input port */ diff --git a/component/video/dec/Exynos_OMX_VdecControl.c b/component/video/dec/Exynos_OMX_VdecControl.c index 252b29e..e553988 100644 --- a/component/video/dec/Exynos_OMX_VdecControl.c +++ b/component/video/dec/Exynos_OMX_VdecControl.c @@ -577,6 +577,7 @@ OMX_ERRORTYPE Exynos_OMX_BufferFlush(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 n Exynos_OSAL_Memset(pExynosComponent->nFlags, 0, sizeof(OMX_U32) * MAX_FLAGS); pExynosComponent->getAllDelayBuffer = OMX_FALSE; pExynosComponent->bSaveFlagEOS = OMX_FALSE; + pExynosComponent->bBehaviorEOS = OMX_FALSE; pExynosComponent->reInputData = OMX_FALSE; } @@ -728,7 +729,6 @@ OMX_ERRORTYPE Exynos_OutputBufferReturn( } if ((pBufferHdr->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) { - pBufferHdr->nFilledLen = 0; Exynos_OSAL_Log(EXYNOS_LOG_TRACE,"event OMX_BUFFERFLAG_EOS!!!"); pExynosComponent->pCallbacks->EventHandler(pOMXComponent, pExynosComponent->callbackData, @@ -1022,28 +1022,44 @@ OMX_ERRORTYPE Exynos_OMX_VideoDecodeGetParameter( pExynosPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; portDefinition = &pExynosPort->portDefinition; - switch (index) { - case supportFormat_0: - portFormat->eCompressionFormat = OMX_VIDEO_CodingUnused; - portFormat->eColorFormat = OMX_COLOR_FormatYUV420Planar; - portFormat->xFramerate = portDefinition->format.video.xFramerate; - break; - case supportFormat_1: - portFormat->eCompressionFormat = OMX_VIDEO_CodingUnused; - portFormat->eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar; - portFormat->xFramerate = portDefinition->format.video.xFramerate; - break; - case supportFormat_2: - portFormat->eCompressionFormat = OMX_VIDEO_CodingUnused; - portFormat->eColorFormat = OMX_SEC_COLOR_FormatNV12Tiled; - portFormat->xFramerate = portDefinition->format.video.xFramerate; - break; - default: - if (index > supportFormat_0) { - ret = OMX_ErrorNoMore; - goto EXIT; + if (pExynosPort->bIsANBEnabled == OMX_FALSE) { + switch (index) { + case supportFormat_0: + portFormat->eCompressionFormat = OMX_VIDEO_CodingUnused; + portFormat->eColorFormat = OMX_COLOR_FormatYUV420Planar; + portFormat->xFramerate = portDefinition->format.video.xFramerate; + break; + case supportFormat_1: + portFormat->eCompressionFormat = OMX_VIDEO_CodingUnused; + portFormat->eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar; + portFormat->xFramerate = portDefinition->format.video.xFramerate; + break; + case supportFormat_2: + portFormat->eCompressionFormat = OMX_VIDEO_CodingUnused; + portFormat->eColorFormat = OMX_SEC_COLOR_FormatNV12Tiled; + portFormat->xFramerate = portDefinition->format.video.xFramerate; + break; + default: + if (index > supportFormat_0) { + ret = OMX_ErrorNoMore; + goto EXIT; + } + break; + } + } else { + switch (index) { + case supportFormat_0: + portFormat->eCompressionFormat = OMX_VIDEO_CodingUnused; + portFormat->eColorFormat = OMX_SEC_COLOR_FormatNV12Tiled; + portFormat->xFramerate = portDefinition->format.video.xFramerate; + break; + default: + if (index > supportFormat_0) { + ret = OMX_ErrorNoMore; + goto EXIT; + } + break; } - break; } } ret = OMX_ErrorNone; diff --git a/component/video/dec/h264/Exynos_OMX_H264dec.c b/component/video/dec/h264/Exynos_OMX_H264dec.c index fb4737c..4d7e1f3 100644 --- a/component/video/dec/h264/Exynos_OMX_H264dec.c +++ b/component/video/dec/h264/Exynos_OMX_H264dec.c @@ -1657,6 +1657,7 @@ OMX_ERRORTYPE Exynos_H264Dec_Init(OMX_COMPONENTTYPE *pOMXComponent) pH264Dec->hMFCH264Handle.bConfiguredMFCDst = OMX_FALSE; pExynosComponent->bUseFlagEOF = OMX_TRUE; pExynosComponent->bSaveFlagEOS = OMX_FALSE; + pExynosComponent->bBehaviorEOS = OMX_FALSE; /* H.264 Codec Open */ ret = H264CodecOpen(pH264Dec); @@ -1785,6 +1786,8 @@ OMX_ERRORTYPE Exynos_H264Dec_Terminate(OMX_COMPONENTTYPE *pOMXComponent) } H264CodecClose(pH264Dec); + Exynos_ResetAllPortConfig(pOMXComponent); + EXIT: FunctionOut(); @@ -2128,6 +2131,12 @@ OMX_ERRORTYPE Exynos_H264Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX ((pDstOutputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS)) { Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "displayStatus:%d, nFlags0x%x", displayStatus, pDstOutputData->nFlags); pDstOutputData->remainDataLen = 0; + + if (((pDstOutputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) && + (pExynosComponent->bBehaviorEOS == OMX_TRUE)) { + pDstOutputData->remainDataLen = bufferGeometry->nFrameWidth * bufferGeometry->nFrameHeight * 3 / 2; + pExynosComponent->bBehaviorEOS = OMX_FALSE; + } } else { pDstOutputData->remainDataLen = bufferGeometry->nFrameWidth * bufferGeometry->nFrameHeight * 3 / 2; } diff --git a/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c b/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c index b29dda5..32747ac 100644 --- a/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c +++ b/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c @@ -1288,6 +1288,7 @@ OMX_ERRORTYPE Exynos_Mpeg2Dec_Init(OMX_COMPONENTTYPE *pOMXComponent) pMpeg2Dec->hMFCMpeg2Handle.bConfiguredMFCDst = OMX_FALSE; pExynosComponent->bUseFlagEOF = OMX_TRUE; pExynosComponent->bSaveFlagEOS = OMX_FALSE; + pExynosComponent->bBehaviorEOS = OMX_FALSE; /* Mpeg2 Codec Open */ ret = Mpeg2CodecOpen(pMpeg2Dec); @@ -1408,6 +1409,8 @@ OMX_ERRORTYPE Exynos_Mpeg2Dec_Terminate(OMX_COMPONENTTYPE *pOMXComponent) } Mpeg2CodecClose(pMpeg2Dec); + Exynos_ResetAllPortConfig(pOMXComponent); + EXIT: FunctionOut(); @@ -1718,6 +1721,12 @@ OMX_ERRORTYPE Exynos_Mpeg2Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OM ((pDstOutputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS)) { Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "displayStatus:%d, nFlags0x%x", displayStatus, pDstOutputData->nFlags); pDstOutputData->remainDataLen = 0; + + if (((pDstOutputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) && + (pExynosComponent->bBehaviorEOS == OMX_TRUE)) { + pDstOutputData->remainDataLen = bufferGeometry->nFrameWidth * bufferGeometry->nFrameHeight * 3 / 2; + pExynosComponent->bBehaviorEOS = OMX_FALSE; + } } else { pDstOutputData->remainDataLen = bufferGeometry->nFrameWidth * bufferGeometry->nFrameHeight * 3 / 2; } diff --git a/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c b/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c index 7d91d84..ce2c217 100644 --- a/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c +++ b/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c @@ -1641,6 +1641,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_Init(OMX_COMPONENTTYPE *pOMXComponent) pMpeg4Dec->hMFCMpeg4Handle.bConfiguredMFCDst = OMX_FALSE; pExynosComponent->bUseFlagEOF = OMX_TRUE; pExynosComponent->bSaveFlagEOS = OMX_FALSE; + pExynosComponent->bBehaviorEOS = OMX_FALSE; /* Mpeg4 Codec Open */ ret = Mpeg4CodecOpen(pMpeg4Dec); @@ -1761,6 +1762,8 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_Terminate(OMX_COMPONENTTYPE *pOMXComponent) } Mpeg4CodecClose(pMpeg4Dec); + Exynos_ResetAllPortConfig(pOMXComponent); + EXIT: FunctionOut(); @@ -2071,6 +2074,12 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OM ((pDstOutputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS)) { Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "displayStatus:%d, nFlags0x%x", displayStatus, pDstOutputData->nFlags); pDstOutputData->remainDataLen = 0; + + if (((pDstOutputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) && + (pExynosComponent->bBehaviorEOS == OMX_TRUE)) { + pDstOutputData->remainDataLen = bufferGeometry->nFrameWidth * bufferGeometry->nFrameHeight * 3 / 2; + pExynosComponent->bBehaviorEOS = OMX_FALSE; + } } else { pDstOutputData->remainDataLen = bufferGeometry->nFrameWidth * bufferGeometry->nFrameHeight * 3 / 2; } diff --git a/component/video/dec/vc1/Exynos_OMX_Wmvdec.c b/component/video/dec/vc1/Exynos_OMX_Wmvdec.c index 59c01f8..de10d89 100644 --- a/component/video/dec/vc1/Exynos_OMX_Wmvdec.c +++ b/component/video/dec/vc1/Exynos_OMX_Wmvdec.c @@ -1507,6 +1507,7 @@ OMX_ERRORTYPE Exynos_WmvDec_Init(OMX_COMPONENTTYPE *pOMXComponent) pWmvDec->hMFCWmvHandle.bConfiguredMFCDst = OMX_FALSE; pExynosComponent->bUseFlagEOF = OMX_TRUE; pExynosComponent->bSaveFlagEOS = OMX_FALSE; + pExynosComponent->bBehaviorEOS = OMX_FALSE; /* WMV Codec Open */ ret = WmvCodecOpen(pWmvDec); @@ -1629,6 +1630,8 @@ OMX_ERRORTYPE Exynos_WmvDec_Terminate(OMX_COMPONENTTYPE *pOMXComponent) } WmvCodecClose(pWmvDec); + Exynos_ResetAllPortConfig(pOMXComponent); + EXIT: FunctionOut(); @@ -1953,6 +1956,12 @@ OMX_ERRORTYPE Exynos_WmvDec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_ ((pDstOutputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS)) { Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "displayStatus:%d, nFlags0x%x", displayStatus, pDstOutputData->nFlags); pDstOutputData->remainDataLen = 0; + + if (((pDstOutputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) && + (pExynosComponent->bBehaviorEOS == OMX_TRUE)) { + pDstOutputData->remainDataLen = bufferGeometry->nFrameWidth * bufferGeometry->nFrameHeight * 3 / 2; + pExynosComponent->bBehaviorEOS = OMX_FALSE; + } } else { pDstOutputData->remainDataLen = bufferGeometry->nFrameWidth * bufferGeometry->nFrameHeight * 3 / 2; } diff --git a/component/video/dec/vp8/Exynos_OMX_Vp8dec.c b/component/video/dec/vp8/Exynos_OMX_Vp8dec.c index d51cfaf..c8329f9 100644 --- a/component/video/dec/vp8/Exynos_OMX_Vp8dec.c +++ b/component/video/dec/vp8/Exynos_OMX_Vp8dec.c @@ -1232,6 +1232,7 @@ OMX_ERRORTYPE Exynos_VP8Dec_Init(OMX_COMPONENTTYPE *pOMXComponent) pVp8Dec->hMFCVp8Handle.bConfiguredMFCDst = OMX_FALSE; pExynosComponent->bUseFlagEOF = OMX_TRUE; pExynosComponent->bSaveFlagEOS = OMX_FALSE; + pExynosComponent->bBehaviorEOS = OMX_FALSE; /* VP8 Codec Open */ ret = VP8CodecOpen(pVp8Dec); @@ -1352,6 +1353,8 @@ OMX_ERRORTYPE Exynos_VP8Dec_Terminate(OMX_COMPONENTTYPE *pOMXComponent) } VP8CodecClose(pVp8Dec); + Exynos_ResetAllPortConfig(pOMXComponent); + EXIT: FunctionOut(); @@ -1662,6 +1665,12 @@ OMX_ERRORTYPE Exynos_VP8Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_ ((pDstOutputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS)) { Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "displayStatus:%d, nFlags0x%x", displayStatus, pDstOutputData->nFlags); pDstOutputData->remainDataLen = 0; + + if (((pDstOutputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) && + (pExynosComponent->bBehaviorEOS == OMX_TRUE)) { + pDstOutputData->remainDataLen = bufferGeometry->nFrameWidth * bufferGeometry->nFrameHeight * 3 / 2; + pExynosComponent->bBehaviorEOS = OMX_FALSE; + } } else { pDstOutputData->remainDataLen = bufferGeometry->nFrameWidth * bufferGeometry->nFrameHeight * 3 / 2; } diff --git a/component/video/enc/Exynos_OMX_Venc.c b/component/video/enc/Exynos_OMX_Venc.c index d50d3ec..01ecccf 100644 --- a/component/video/enc/Exynos_OMX_Venc.c +++ b/component/video/enc/Exynos_OMX_Venc.c @@ -582,9 +582,9 @@ OMX_BOOL Exynos_Preprocessor_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_ if ((srcInputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) { Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "bSaveFlagEOS : OMX_TRUE"); - srcInputData->dataLen = 0; - srcInputData->remainDataLen = 0; pExynosComponent->bSaveFlagEOS = OMX_TRUE; + if (srcInputData->dataLen != 0) + pExynosComponent->bBehaviorEOS = OMX_TRUE; } if (pExynosComponent->checkTimeStamp.needSetStartTimeStamp == OMX_TRUE) { @@ -1211,6 +1211,9 @@ OMX_ERRORTYPE Exynos_OMX_BufferProcess_Terminate(OMX_HANDLETYPE hComponent) Exynos_OSAL_ThreadTerminate(pVideoEnc->hDstOutputThread); pVideoEnc->hDstOutputThread = NULL; + pExynosComponent->checkTimeStamp.needSetStartTimeStamp = OMX_FALSE; + pExynosComponent->checkTimeStamp.needCheckStartTimeStamp = OMX_FALSE; + EXIT: FunctionOut(); @@ -1265,6 +1268,7 @@ OMX_ERRORTYPE Exynos_OMX_VideoEncodeComponentInit(OMX_IN OMX_HANDLETYPE hCompone pExynosComponent->hComponentHandle = (OMX_HANDLETYPE)pVideoEnc; pExynosComponent->bSaveFlagEOS = OMX_FALSE; + pExynosComponent->bBehaviorEOS = OMX_FALSE; pVideoEnc->bFirstInput = OMX_FALSE; pVideoEnc->bFirstOutput = OMX_FALSE; diff --git a/component/video/enc/Exynos_OMX_VencControl.c b/component/video/enc/Exynos_OMX_VencControl.c index 2fcc0f9..db5d7fc 100644 --- a/component/video/enc/Exynos_OMX_VencControl.c +++ b/component/video/enc/Exynos_OMX_VencControl.c @@ -656,6 +656,7 @@ OMX_ERRORTYPE Exynos_OMX_BufferFlush( Exynos_OSAL_Memset(pExynosComponent->nFlags, 0, sizeof(OMX_U32) * MAX_FLAGS); pExynosComponent->getAllDelayBuffer = OMX_FALSE; pExynosComponent->bSaveFlagEOS = OMX_FALSE; + pExynosComponent->bBehaviorEOS = OMX_FALSE; pExynosComponent->reInputData = OMX_FALSE; } @@ -844,7 +845,6 @@ OMX_ERRORTYPE Exynos_OutputBufferReturn( } if ((pBufferHdr->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) { - pBufferHdr->nFilledLen = 0; Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "event OMX_BUFFERFLAG_EOS!!!"); pExynosComponent->pCallbacks->EventHandler(pOMXComponent, pExynosComponent->callbackData, diff --git a/component/video/enc/h264/Exynos_OMX_H264enc.c b/component/video/enc/h264/Exynos_OMX_H264enc.c index 856d289..fe43839 100644 --- a/component/video/enc/h264/Exynos_OMX_H264enc.c +++ b/component/video/enc/h264/Exynos_OMX_H264enc.c @@ -1566,6 +1566,7 @@ OMX_ERRORTYPE Exynos_H264Enc_Init(OMX_COMPONENTTYPE *pOMXComponent) pVideoEnc->bFirstOutput = OMX_FALSE; pExynosComponent->bUseFlagEOF = OMX_TRUE; pExynosComponent->bSaveFlagEOS = OMX_FALSE; + pExynosComponent->bBehaviorEOS = OMX_FALSE; eColorFormat = pExynosInputPort->portDefinition.format.video.eColorFormat; if (pExynosInputPort->bStoreMetaData == OMX_TRUE) { @@ -2027,11 +2028,16 @@ OMX_ERRORTYPE Exynos_H264Enc_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX } if ((displayStatus == VIDEO_FRAME_STATUS_CHANGE_RESOL) || - ((pDstOutputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS)) { + (((pDstOutputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) && + (pExynosComponent->bBehaviorEOS == OMX_FALSE))) { Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "%x displayStatus:%d, nFlags0x%x", pExynosComponent, displayStatus, pDstOutputData->nFlags); pDstOutputData->remainDataLen = 0; } + if (((pDstOutputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) && + (pExynosComponent->bBehaviorEOS == OMX_TRUE)) + pExynosComponent->bBehaviorEOS = OMX_FALSE; + ret = OMX_ErrorNone; EXIT: diff --git a/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c b/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c index cf0e10a..962002c 100644 --- a/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c +++ b/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c @@ -1757,6 +1757,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_Init(OMX_COMPONENTTYPE *pOMXComponent) pVideoEnc->bFirstOutput = OMX_FALSE; pExynosComponent->bUseFlagEOF = OMX_TRUE; pExynosComponent->bSaveFlagEOS = OMX_FALSE; + pExynosComponent->bBehaviorEOS = OMX_FALSE; eColorFormat = pExynosInputPort->portDefinition.format.video.eColorFormat; if (pExynosInputPort->bStoreMetaData == OMX_TRUE) { @@ -2198,11 +2199,16 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OM } if ((displayStatus == VIDEO_FRAME_STATUS_CHANGE_RESOL) || - ((pDstOutputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS)) { + (((pDstOutputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) && + (pExynosComponent->bBehaviorEOS == OMX_FALSE))) { Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "%x displayStatus:%d, nFlags0x%x", pExynosComponent, displayStatus, pDstOutputData->nFlags); pDstOutputData->remainDataLen = 0; } + if (((pDstOutputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) && + (pExynosComponent->bBehaviorEOS == OMX_TRUE)) + pExynosComponent->bBehaviorEOS = OMX_FALSE; + ret = OMX_ErrorNone; EXIT: -- 2.20.1