venc: modified an error check routine
authorTaehwan Kim <t_h.kim@samsung.com>
Mon, 29 Oct 2012 04:40:32 +0000 (13:40 +0900)
committerHuisung Kang <hs1218.kang@samsung.com>
Mon, 29 Oct 2012 04:54:23 +0000 (13:54 +0900)
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 <t_h.kim@samsung.com>
Signed-off-by: Huisung Kang <hs1218.kang@samsung.com>
component/video/enc/h264/Exynos_OMX_H264enc.c
component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c

index 001e4a05e0c467dbec75feddb88cc638ee64527f..9f2605eb4fc64cdbba39feb0afb40f2653f62592 100644 (file)
@@ -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:
index 8d723b485d19e885e77ff04559afc949b101b2a3..2d37e21eb46e20592a132d4d014b25c5b03da8ed 100644 (file)
@@ -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: