vdec: removed FlushXXBufferReturn function.
authorTaehwan Kim <t_h.kim@samsung.com>
Thu, 22 Nov 2012 04:30:12 +0000 (04:30 +0000)
committerTaehwan Kim <t_h.kim@samsung.com>
Thu, 22 Nov 2012 09:08:49 +0000 (09:08 +0000)
modified to use Exynos_XXBufferReturn
instead of Exynos_FlushXXBufferReturn.

Change-Id: Ie6e1b6110ef03ec69cb7799a90b177be570fb8d0
Signed-off-by: Taehwan Kim <t_h.kim@samsung.com>
component/video/dec/Exynos_OMX_Vdec.c
component/video/dec/Exynos_OMX_VdecControl.c
component/video/dec/Exynos_OMX_VdecControl.h

index 098e646d71b0dc74d2ecbf93207be5c439ba1a68..94ce5f0d030770889cce5bdf1eafe4120fe8fb6f 100644 (file)
@@ -395,7 +395,7 @@ OMX_BOOL Exynos_Preprocessor_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_
                 ret = OMX_FALSE;
             }
 
-            Exynos_InputBufferReturn(pOMXComponent);
+            Exynos_InputBufferReturn(pOMXComponent, inputUseBuffer);
         }
 
         if ((srcInputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) {
@@ -513,7 +513,7 @@ OMX_BOOL Exynos_Postprocess_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_
                     if ((outputUseBuffer->remainDataLen > 0) ||
                         ((outputUseBuffer->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) ||
                         (CHECK_PORT_BEING_FLUSHED(exynosOutputPort))) {
-                        Exynos_OutputBufferReturn(pOMXComponent);
+                        Exynos_OutputBufferReturn(pOMXComponent, outputUseBuffer);
                     }
                 } else {
                     Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "csc_convert Error");
@@ -527,7 +527,7 @@ OMX_BOOL Exynos_Postprocess_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_
                 outputUseBuffer->remainDataLen = 0;
                 outputUseBuffer->nFlags = dstOutputData->nFlags;
                 outputUseBuffer->timeStamp = dstOutputData->timeStamp;
-                Exynos_OutputBufferReturn(pOMXComponent);
+                Exynos_OutputBufferReturn(pOMXComponent, outputUseBuffer);
             } else {
                 Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "output buffer is smaller than decoded data size Out Length");
                 pExynosComponent->pCallbacks->EventHandler((OMX_HANDLETYPE)pOMXComponent,
@@ -539,7 +539,7 @@ OMX_BOOL Exynos_Postprocess_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_
             if ((outputUseBuffer->remainDataLen > 0) ||
                 ((outputUseBuffer->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) ||
                 (CHECK_PORT_BEING_FLUSHED(exynosOutputPort)))
-                Exynos_OutputBufferReturn(pOMXComponent);
+                Exynos_OutputBufferReturn(pOMXComponent, outputUseBuffer);
         }
     } else {
         ret = OMX_FALSE;
@@ -680,7 +680,7 @@ OMX_ERRORTYPE Exynos_OMX_SrcOutputBufferProcess(OMX_HANDLETYPE hComponent)
                 }
                 if (exynosInputPort->bufferProcessType & BUFFER_SHARE) {
                     Exynos_Shared_DataToBuffer(&srcOutputData, srcOutputUseBuffer);
-                    Exynos_InputBufferReturn(pOMXComponent);
+                    Exynos_InputBufferReturn(pOMXComponent, srcOutputUseBuffer);
                 }
                 Exynos_ResetCodecData(&srcOutputData);
             }
index a99b8bed4e2525909f5598739195955b9d18b7cb..35d951dd870210d0450584df21ca4d039f7456f8 100644 (file)
@@ -448,14 +448,14 @@ OMX_ERRORTYPE Exynos_OMX_FlushPort(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 por
     Exynos_OMX_GetFlushBuffer(pExynosPort, pDataPortBuffer);
     if (portIndex == INPUT_PORT_INDEX) {
         if (pDataPortBuffer[0]->dataValid == OMX_TRUE)
-            Exynos_FlushInputBufferReturn(pOMXComponent, pDataPortBuffer[0]);
+            Exynos_InputBufferReturn(pOMXComponent, pDataPortBuffer[0]);
         if (pDataPortBuffer[1]->dataValid == OMX_TRUE)
-            Exynos_FlushInputBufferReturn(pOMXComponent, pDataPortBuffer[1]);
+            Exynos_InputBufferReturn(pOMXComponent, pDataPortBuffer[1]);
     } else if (portIndex == OUTPUT_PORT_INDEX) {
         if (pDataPortBuffer[0]->dataValid == OMX_TRUE)
-            Exynos_FlushOutputBufferReturn(pOMXComponent, pDataPortBuffer[0]);
+            Exynos_OutputBufferReturn(pOMXComponent, pDataPortBuffer[0]);
         if (pDataPortBuffer[1]->dataValid == OMX_TRUE)
-            Exynos_FlushOutputBufferReturn(pOMXComponent, pDataPortBuffer[1]);
+            Exynos_OutputBufferReturn(pOMXComponent, pDataPortBuffer[1]);
     }
 
     if (pExynosComponent->bMultiThreadProcess == OMX_TRUE) {
@@ -588,96 +588,46 @@ EXIT:
     return ret;
 }
 
-OMX_ERRORTYPE Exynos_InputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent)
+OMX_ERRORTYPE Exynos_InputBufferReturn(
+    OMX_COMPONENTTYPE       *pOMXComponent,
+    EXYNOS_OMX_DATABUFFER   *pDataBuffer)
 {
-    OMX_ERRORTYPE          ret = OMX_ErrorNone;
-    EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
-    EXYNOS_OMX_BASEPORT      *exynosOMXInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
-    EXYNOS_OMX_DATABUFFER    *dataBuffer = NULL;
-    OMX_BUFFERHEADERTYPE     *bufferHeader = NULL;
+    OMX_ERRORTYPE                ret                = OMX_ErrorNone;
+    EXYNOS_OMX_BASECOMPONENT    *pExynosComponent   = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
+    EXYNOS_OMX_BASEPORT         *pInputPort         = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
+    OMX_BUFFERHEADERTYPE        *pBufferHdr         = NULL;
 
     FunctionIn();
 
-    if (exynosOMXInputPort->bufferProcessType & BUFFER_COPY) {
-        dataBuffer = &(exynosOMXInputPort->way.port2WayDataBuffer.inputDataBuffer);
-    } else if (exynosOMXInputPort->bufferProcessType & BUFFER_SHARE) {
-        dataBuffer = &(exynosOMXInputPort->way.port2WayDataBuffer.outputDataBuffer);
-    }
-
-    bufferHeader = dataBuffer->bufferHeader;
+    pBufferHdr = pDataBuffer->bufferHeader;
 
-    if (bufferHeader != NULL) {
-        if (exynosOMXInputPort->markType.hMarkTargetComponent != NULL ) {
-            bufferHeader->hMarkTargetComponent      = exynosOMXInputPort->markType.hMarkTargetComponent;
-            bufferHeader->pMarkData                 = exynosOMXInputPort->markType.pMarkData;
-            exynosOMXInputPort->markType.hMarkTargetComponent = NULL;
-            exynosOMXInputPort->markType.pMarkData = NULL;
+    if (pBufferHdr != NULL) {
+        if (pInputPort->markType.hMarkTargetComponent != NULL) {
+            pBufferHdr->hMarkTargetComponent            = pInputPort->markType.hMarkTargetComponent;
+            pBufferHdr->pMarkData                       = pInputPort->markType.pMarkData;
+            pInputPort->markType.hMarkTargetComponent   = NULL;
+            pInputPort->markType.pMarkData              = NULL;
         }
 
-        if (bufferHeader->hMarkTargetComponent != NULL) {
-            if (bufferHeader->hMarkTargetComponent == pOMXComponent) {
+        if (pBufferHdr->hMarkTargetComponent != NULL) {
+            if (pBufferHdr->hMarkTargetComponent == pOMXComponent) {
                 pExynosComponent->pCallbacks->EventHandler(pOMXComponent,
                                 pExynosComponent->callbackData,
                                 OMX_EventMark,
-                                0, 0, bufferHeader->pMarkData);
+                                0, 0, pBufferHdr->pMarkData);
             } else {
-                pExynosComponent->propagateMarkType.hMarkTargetComponent = bufferHeader->hMarkTargetComponent;
-                pExynosComponent->propagateMarkType.pMarkData = bufferHeader->pMarkData;
+                pExynosComponent->propagateMarkType.hMarkTargetComponent    = pBufferHdr->hMarkTargetComponent;
+                pExynosComponent->propagateMarkType.pMarkData               = pBufferHdr->pMarkData;
             }
         }
 
-        bufferHeader->nFilledLen = 0;
-        bufferHeader->nOffset = 0;
-        Exynos_OMX_InputBufferReturn(pOMXComponent, bufferHeader);
+        pBufferHdr->nFilledLen  = 0;
+        pBufferHdr->nOffset     = 0;
+        Exynos_OMX_InputBufferReturn(pOMXComponent, pBufferHdr);
     }
 
     /* reset dataBuffer */
-    Exynos_ResetDataBuffer(dataBuffer);
-
-EXIT:
-    FunctionOut();
-
-    return ret;
-}
-
-OMX_ERRORTYPE Exynos_FlushInputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATABUFFER *dataBuffer)
-{
-    OMX_ERRORTYPE          ret = OMX_ErrorNone;
-    EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
-    EXYNOS_OMX_BASEPORT      *exynosOMXInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
-    OMX_BUFFERHEADERTYPE     *bufferHeader = NULL;
-
-    FunctionIn();
-
-    bufferHeader = dataBuffer->bufferHeader;
-
-    if (bufferHeader != NULL) {
-        if (exynosOMXInputPort->markType.hMarkTargetComponent != NULL ) {
-            bufferHeader->hMarkTargetComponent      = exynosOMXInputPort->markType.hMarkTargetComponent;
-            bufferHeader->pMarkData                 = exynosOMXInputPort->markType.pMarkData;
-            exynosOMXInputPort->markType.hMarkTargetComponent = NULL;
-            exynosOMXInputPort->markType.pMarkData = NULL;
-        }
-
-        if (bufferHeader->hMarkTargetComponent != NULL) {
-            if (bufferHeader->hMarkTargetComponent == pOMXComponent) {
-                pExynosComponent->pCallbacks->EventHandler(pOMXComponent,
-                                pExynosComponent->callbackData,
-                                OMX_EventMark,
-                                0, 0, bufferHeader->pMarkData);
-            } else {
-                pExynosComponent->propagateMarkType.hMarkTargetComponent = bufferHeader->hMarkTargetComponent;
-                pExynosComponent->propagateMarkType.pMarkData = bufferHeader->pMarkData;
-            }
-        }
-
-        bufferHeader->nFilledLen = 0;
-        bufferHeader->nOffset = 0;
-        Exynos_OMX_InputBufferReturn(pOMXComponent, bufferHeader);
-    }
-
-    /* reset dataBuffer */
-    Exynos_ResetDataBuffer(dataBuffer);
+    Exynos_ResetDataBuffer(pDataBuffer);
 
 EXIT:
     FunctionOut();
@@ -736,92 +686,44 @@ EXIT:
     return ret;
 }
 
-OMX_ERRORTYPE Exynos_OutputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent)
+OMX_ERRORTYPE Exynos_OutputBufferReturn(
+    OMX_COMPONENTTYPE       *pOMXComponent,
+    EXYNOS_OMX_DATABUFFER   *pDataBuffer)
 {
-    OMX_ERRORTYPE          ret = OMX_ErrorNone;
-    EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
-    EXYNOS_OMX_BASEPORT      *exynosOMXOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
-    EXYNOS_OMX_DATABUFFER    *dataBuffer = NULL;
-    OMX_BUFFERHEADERTYPE     *bufferHeader = NULL;
+    OMX_ERRORTYPE                ret                = OMX_ErrorNone;
+    EXYNOS_OMX_BASECOMPONENT    *pExynosComponent   = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
+    OMX_BUFFERHEADERTYPE        *pBufferHdr         = pDataBuffer->bufferHeader;
 
     FunctionIn();
 
-    dataBuffer = &(exynosOMXOutputPort->way.port2WayDataBuffer.outputDataBuffer);
-    bufferHeader = dataBuffer->bufferHeader;
-
-    if (bufferHeader != NULL) {
-        bufferHeader->nFilledLen = dataBuffer->remainDataLen;
-        bufferHeader->nOffset    = 0;
-        bufferHeader->nFlags     = dataBuffer->nFlags;
-        bufferHeader->nTimeStamp = dataBuffer->timeStamp;
+    if (pBufferHdr != NULL) {
+        pBufferHdr->nFilledLen = pDataBuffer->remainDataLen;
+        pBufferHdr->nOffset    = 0;
+        pBufferHdr->nFlags     = pDataBuffer->nFlags;
+        pBufferHdr->nTimeStamp = pDataBuffer->timeStamp;
 
         if (pExynosComponent->propagateMarkType.hMarkTargetComponent != NULL) {
-            bufferHeader->hMarkTargetComponent = pExynosComponent->propagateMarkType.hMarkTargetComponent;
-            bufferHeader->pMarkData = pExynosComponent->propagateMarkType.pMarkData;
-            pExynosComponent->propagateMarkType.hMarkTargetComponent = NULL;
-            pExynosComponent->propagateMarkType.pMarkData = NULL;
-        }
+            pBufferHdr->hMarkTargetComponent = pExynosComponent->propagateMarkType.hMarkTargetComponent;
+            pBufferHdr->pMarkData            = pExynosComponent->propagateMarkType.pMarkData;
 
-        if ((bufferHeader->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) {
-            bufferHeader->nFilledLen = 0;
-            Exynos_OSAL_Log(EXYNOS_LOG_TRACE,"event OMX_BUFFERFLAG_EOS!!!");
-            pExynosComponent->pCallbacks->EventHandler(pOMXComponent,
-                            pExynosComponent->callbackData,
-                            OMX_EventBufferFlag,
-                            OUTPUT_PORT_INDEX,
-                            bufferHeader->nFlags, NULL);
+            pExynosComponent->propagateMarkType.hMarkTargetComponent    = NULL;
+            pExynosComponent->propagateMarkType.pMarkData               = NULL;
         }
 
-        Exynos_OMX_OutputBufferReturn(pOMXComponent, bufferHeader);
-    }
-
-    /* reset dataBuffer */
-    Exynos_ResetDataBuffer(dataBuffer);
-
-EXIT:
-    FunctionOut();
-
-    return ret;
-}
-
-OMX_ERRORTYPE Exynos_FlushOutputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATABUFFER *dataBuffer)
-{
-    OMX_ERRORTYPE          ret = OMX_ErrorNone;
-    EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
-    EXYNOS_OMX_BASEPORT      *exynosOMXOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
-    OMX_BUFFERHEADERTYPE     *bufferHeader = NULL;
-
-    FunctionIn();
-
-    bufferHeader = dataBuffer->bufferHeader;
-
-    if (bufferHeader != NULL) {
-        bufferHeader->nFilledLen = dataBuffer->remainDataLen;
-        bufferHeader->nOffset    = 0;
-        bufferHeader->nFlags     = dataBuffer->nFlags;
-        bufferHeader->nTimeStamp = dataBuffer->timeStamp;
-
-        if (pExynosComponent->propagateMarkType.hMarkTargetComponent != NULL) {
-            bufferHeader->hMarkTargetComponent = pExynosComponent->propagateMarkType.hMarkTargetComponent;
-            bufferHeader->pMarkData = pExynosComponent->propagateMarkType.pMarkData;
-            pExynosComponent->propagateMarkType.hMarkTargetComponent = NULL;
-            pExynosComponent->propagateMarkType.pMarkData = NULL;
-        }
-
-        if ((bufferHeader->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) {
-            bufferHeader->nFilledLen = 0;
+        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,
                             OMX_EventBufferFlag,
                             OUTPUT_PORT_INDEX,
-                            bufferHeader->nFlags, NULL);
+                            pBufferHdr->nFlags, NULL);
         }
-        Exynos_OMX_OutputBufferReturn(pOMXComponent, bufferHeader);
+        Exynos_OMX_OutputBufferReturn(pOMXComponent, pBufferHdr);
     }
 
     /* reset dataBuffer */
-    Exynos_ResetDataBuffer(dataBuffer);
+    Exynos_ResetDataBuffer(pDataBuffer);
 
 EXIT:
     FunctionOut();
index 23011fad972704548008333877065afee2a28f57..15d22717e124b86019cc6a6e19aa0ffced9f6d0b 100644 (file)
@@ -87,11 +87,9 @@ OMX_ERRORTYPE Exynos_OMX_VideoDecodeGetExtensionIndex(
     OMX_IN OMX_HANDLETYPE  hComponent,
     OMX_IN OMX_STRING      cParameterName,
     OMX_OUT OMX_INDEXTYPE *pIndexType);
-OMX_ERRORTYPE Exynos_InputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent);
-OMX_ERRORTYPE Exynos_OutputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent);
+OMX_ERRORTYPE Exynos_InputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATABUFFER *pDataBuffer);
+OMX_ERRORTYPE Exynos_OutputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATABUFFER *pDataBuffer);
 OMX_ERRORTYPE Exynos_OMX_BufferFlush(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 nPortIndex, OMX_BOOL bEvent);
-OMX_ERRORTYPE Exynos_FlushInputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATABUFFER *dataBuffer);
-OMX_ERRORTYPE Exynos_FlushOutputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATABUFFER *dataBuffer);
 
 #ifdef USE_ANB
 OMX_ERRORTYPE Exynos_Shared_ANBBufferToData(EXYNOS_OMX_DATABUFFER *pUseBuffer, EXYNOS_OMX_DATA *pData, EXYNOS_OMX_BASEPORT *pExynosPort, EXYNOS_OMX_PLANE nPlane);