From a3b57b8aadd61e83252a5402b091d88b448a9cb9 Mon Sep 17 00:00:00 2001 From: Taehwan Kim Date: Mon, 29 Oct 2012 13:40:32 +0900 Subject: [PATCH] venc: modified an error check routine If do "buffer flush" without doing srcIn function, In case of BUFFER_COPY, always return OMX_ErrorBadParameter in the codecEnQueueAllBuffer function. Change-Id: Ia1631de9ecb02f83b5cfc8edbacfbef453705864 Signed-off-by: Taehwan Kim Signed-off-by: Huisung Kang --- component/video/enc/h264/Exynos_OMX_H264enc.c | 8 +++++--- component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/component/video/enc/h264/Exynos_OMX_H264enc.c b/component/video/enc/h264/Exynos_OMX_H264enc.c index 001e4a0..9f2605e 100644 --- a/component/video/enc/h264/Exynos_OMX_H264enc.c +++ b/component/video/enc/h264/Exynos_OMX_H264enc.c @@ -703,6 +703,11 @@ OMX_ERRORTYPE H264CodecEnqueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U3 FunctionIn(); + if ((nPortIndex != INPUT_PORT_INDEX) && (nPortIndex != OUTPUT_PORT_INDEX)) { + ret = OMX_ErrorBadPortIndex; + goto EXIT; + } + if ((nPortIndex == INPUT_PORT_INDEX) && (pH264Enc->bSourceStart == OMX_TRUE)) { Exynos_CodecBufferReset(pExynosComponent, INPUT_PORT_INDEX); @@ -731,9 +736,6 @@ OMX_ERRORTYPE H264CodecEnqueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U3 Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "pVideoEnc->pMFCEncInputBuffer[%d]->pVirAddr[1]: 0x%x", i, pVideoEnc->pMFCEncInputBuffer[i]->pVirAddr[1]); } pOutbufOps->Clear_Queue(hMFCHandle); - } else { - ret = OMX_ErrorBadParameter; - goto EXIT; } EXIT: diff --git a/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c b/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c index 8d723b4..2d37e21 100644 --- a/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c +++ b/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c @@ -825,6 +825,11 @@ OMX_ERRORTYPE Mpeg4CodecEnqueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U FunctionIn(); + if ((nPortIndex != INPUT_PORT_INDEX) && (nPortIndex != OUTPUT_PORT_INDEX)) { + ret = OMX_ErrorBadPortIndex; + goto EXIT; + } + if ((nPortIndex == INPUT_PORT_INDEX) && (pMpeg4Enc->bSourceStart == OMX_TRUE)) { Exynos_CodecBufferReset(pExynosComponent, INPUT_PORT_INDEX); @@ -853,9 +858,6 @@ OMX_ERRORTYPE Mpeg4CodecEnqueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "pVideoEnc->pMFCEncInputBuffer[%d]->pVirAddr[1]: 0x%x", i, pVideoEnc->pMFCEncInputBuffer[i]->pVirAddr[1]); } pOutbufOps->Clear_Queue(hMFCHandle); - } else { - ret = OMX_ErrorBadParameter; - goto EXIT; } EXIT: -- 2.20.1