vdec: modified an error check routine
authorTaehwan Kim <t_h.kim@samsung.com>
Mon, 29 Oct 2012 04:18:30 +0000 (13:18 +0900)
committerHuisung Kang <hs1218.kang@samsung.com>
Mon, 29 Oct 2012 04:54:22 +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: I01e8f421b68d6f66b0939334fc128901fb30210d
Signed-off-by: Taehwan Kim <t_h.kim@samsung.com>
Signed-off-by: Huisung Kang <hs1218.kang@samsung.com>
component/video/dec/h264/Exynos_OMX_H264dec.c
component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c
component/video/dec/vp8/Exynos_OMX_Vp8dec.c

index a681b557f8eb7d5545efc5144892ef2eb90a8e46..b834316ff775722dc93d3a86ecddcd561ac6df3e 100644 (file)
@@ -558,6 +558,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) &&
         (pH264Dec->bSourceStart == OMX_TRUE)) {
         Exynos_CodecBufferReset(pExynosComponent, INPUT_PORT_INDEX);
@@ -584,9 +589,6 @@ OMX_ERRORTYPE H264CodecEnQueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U3
             Exynos_CodecBufferEnQueue(pExynosComponent, OUTPUT_PORT_INDEX, (OMX_PTR)pBuffer);
         }
         pOutbufOps->Clear_Queue(hMFCHandle);
-    } else {
-        ret = OMX_ErrorBadParameter;
-        goto EXIT;
     }
 
 EXIT:
index 1e6f36ad4ad58b86fb72af78cf9276ce9807b2d2..9c7238b6cbd3c0a7bf0abbe9edbea95f597769c0 100644 (file)
@@ -650,6 +650,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) &&
         (pMpeg4Dec->bSourceStart == OMX_TRUE)) {
         Exynos_CodecBufferReset(pExynosComponent, INPUT_PORT_INDEX);
@@ -676,9 +681,6 @@ OMX_ERRORTYPE Mpeg4CodecEnQueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U
             Exynos_CodecBufferEnQueue(pExynosComponent, OUTPUT_PORT_INDEX, (OMX_PTR)pBuffer);
         }
         pOutbufOps->Clear_Queue(hMFCHandle);
-    } else {
-        ret = OMX_ErrorBadParameter;
-        goto EXIT;
     }
 
 EXIT:
index cfb57ca8ce14b6931f4ce0e2c6b78e65292247e0..05650654fbb222dcb892ec88338525d5204ec313 100644 (file)
@@ -465,6 +465,11 @@ OMX_ERRORTYPE VP8CodecEnQueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32
 
     FunctionIn();
 
+    if ((nPortIndex != INPUT_PORT_INDEX) && (nPortIndex != OUTPUT_PORT_INDEX)) {
+        ret = OMX_ErrorBadPortIndex;
+        goto EXIT;
+    }
+
     if ((nPortIndex == INPUT_PORT_INDEX) &&
         (pVp8Dec->bSourceStart == OMX_TRUE)) {
         Exynos_CodecBufferReset(pExynosComponent, INPUT_PORT_INDEX);
@@ -491,9 +496,6 @@ OMX_ERRORTYPE VP8CodecEnQueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32
             Exynos_CodecBufferEnQueue(pExynosComponent, OUTPUT_PORT_INDEX, (OMX_PTR)pBuffer);
         }
         pOutbufOps->Clear_Queue(hMFCHandle);
-    } else {
-        ret = OMX_ErrorBadParameter;
-        goto EXIT;
     }
 
 EXIT: