omx: handle csc errors
authorGreg Hackmann <ghackmann@google.com>
Mon, 10 Dec 2012 23:29:38 +0000 (15:29 -0800)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Fri, 11 Jan 2013 23:01:54 +0000 (15:01 -0800)
Change-Id: I652b6edb9687ec063ec2b110c70031e821d34e7f
Signed-off-by: Greg Hackmann <ghackmann@google.com>
exynos_omx/openmax/exynos_omx/component/video/enc/Exynos_OMX_Venc.c

index f863f5c3d1c795fcdc1d76e6bace20c08c335d93..82ef205b5f04262df4587d57264014a61b140281 100644 (file)
@@ -301,8 +301,6 @@ OMX_BOOL Exynos_CSC_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA
     }
 #endif
 
-    ret = OMX_TRUE;
-
 EXIT:
     FunctionOut();
 
@@ -405,18 +403,24 @@ OMX_BOOL Exynos_Preprocessor_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_
             Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "exynos_checkInputFrame : OMX_TRUE");
 
             if (((srcInputData->allocSize) - (srcInputData->dataLen)) >= copySize) {
-                Exynos_CSC_InputData(pOMXComponent, srcInputData);
-
-                inputUseBuffer->dataLen -= copySize;
-                inputUseBuffer->remainDataLen -= copySize;
-                inputUseBuffer->usedDataLen += copySize;
-
-                srcInputData->dataLen += copySize;
-                srcInputData->remainDataLen += copySize;
-
-                srcInputData->timeStamp = inputUseBuffer->timeStamp;
-                srcInputData->nFlags = inputUseBuffer->nFlags;
-                srcInputData->bufferHeader = inputUseBuffer->bufferHeader;
+                ret = Exynos_CSC_InputData(pOMXComponent, srcInputData);
+                if (ret) {
+                    inputUseBuffer->dataLen -= copySize;
+                    inputUseBuffer->remainDataLen -= copySize;
+                    inputUseBuffer->usedDataLen += copySize;
+
+                    srcInputData->dataLen += copySize;
+                    srcInputData->remainDataLen += copySize;
+
+                    srcInputData->timeStamp = inputUseBuffer->timeStamp;
+                    srcInputData->nFlags = inputUseBuffer->nFlags;
+                    srcInputData->bufferHeader = inputUseBuffer->bufferHeader;
+                } else {
+                    Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Exynos_CSC_InputData() failure");
+                    pExynosComponent->pCallbacks->EventHandler((OMX_HANDLETYPE)pOMXComponent,
+                            pExynosComponent->callbackData, OMX_EventError,
+                            OMX_ErrorUndefined, 0, NULL );
+                }
             } else {
                 Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "input codec buffer is smaller than decoded input data size Out Length");
                 pExynosComponent->pCallbacks->EventHandler((OMX_HANDLETYPE)pOMXComponent,