venc: removed FlushXXBufferReturn function
authorTaehwan Kim <t_h.kim@samsung.com>
Fri, 1 Feb 2013 06:03:53 +0000 (06:03 +0000)
committerHuisung Kang <hs1218.kang@samsung.com>
Fri, 22 Feb 2013 02:42:10 +0000 (11:42 +0900)
modified to use Exynos_XXBufferReturn
instead of Exynos_FlushXXBufferReturn.

Change-Id: Icb3f26ef9c1e9e46ad97f6a7efc26bd796e73a7f
Signed-off-by: Taehwan Kim <t_h.kim@samsung.com>
component/video/enc/Exynos_OMX_Venc.c
component/video/enc/Exynos_OMX_VencControl.c
component/video/enc/Exynos_OMX_VencControl.h

index d3c1d609554bc23c83066a273d0637142f5a0d51..d50d3ec7b426c2e17f5f835bc590401cba133993 100644 (file)
@@ -574,7 +574,7 @@ OMX_BOOL Exynos_Preprocessor_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_
 
             if (((exynosInputPort->bStoreMetaData == OMX_TRUE) && (eColorFormat == OMX_COLOR_FormatAndroidOpaque)) ||
                 (exynosInputPort->bStoreMetaData == OMX_FALSE)) {
-                Exynos_InputBufferReturn(pOMXComponent);
+                Exynos_InputBufferReturn(pOMXComponent, inputUseBuffer);
             } else {
                 inputUseBuffer->dataValid = OMX_TRUE;
             }
@@ -655,7 +655,7 @@ OMX_BOOL Exynos_Postprocess_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_
 
                 if ((outputUseBuffer->remainDataLen > 0) ||
                     (outputUseBuffer->nFlags & OMX_BUFFERFLAG_EOS)) {
-                    Exynos_OutputBufferReturn(pOMXComponent);
+                    Exynos_OutputBufferReturn(pOMXComponent, outputUseBuffer);
                 }
             } else {
                 Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "output buffer is smaller than encoded data size Out Length");
@@ -668,7 +668,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;
@@ -859,7 +859,7 @@ OMX_ERRORTYPE Exynos_OMX_SrcOutputBufferProcess(OMX_HANDLETYPE hComponent)
                     if (eColorFormat == OMX_COLOR_FormatAndroidOpaque)
                         bNeedUnlock = OMX_TRUE;
                     Exynos_Shared_DataToBuffer(&srcOutputData, srcOutputUseBuffer, bNeedUnlock);
-                    Exynos_InputBufferReturn(pOMXComponent);
+                    Exynos_InputBufferReturn(pOMXComponent, srcOutputUseBuffer);
                 }
                 Exynos_ResetCodecData(&srcOutputData);
             }
index fbd3b6d2a38fc3760cfb44a6cb56414f50b478a5..2fcc0f9b44a8cb8f835734f3e7368a49ac6107d9 100644 (file)
@@ -499,16 +499,16 @@ OMX_ERRORTYPE Exynos_OMX_FlushPort(
     if ((pDataBuffer[0] != NULL) &&
         (pDataBuffer[0]->dataValid == OMX_TRUE)) {
         if (nPortIndex == INPUT_PORT_INDEX)
-            Exynos_FlushInputBufferReturn(pOMXComponent, pDataBuffer[0]);
+            Exynos_InputBufferReturn(pOMXComponent, pDataBuffer[0]);
         else if (nPortIndex == OUTPUT_PORT_INDEX)
-            Exynos_FlushOutputBufferReturn(pOMXComponent, pDataBuffer[0]);
+            Exynos_OutputBufferReturn(pOMXComponent, pDataBuffer[0]);
     }
     if ((pDataBuffer[1] != NULL) &&
         (pDataBuffer[1]->dataValid == OMX_TRUE)) {
         if (nPortIndex == INPUT_PORT_INDEX)
-            Exynos_FlushInputBufferReturn(pOMXComponent, pDataBuffer[1]);
+            Exynos_InputBufferReturn(pOMXComponent, pDataBuffer[1]);
         else if (nPortIndex == OUTPUT_PORT_INDEX)
-            Exynos_FlushOutputBufferReturn(pOMXComponent, pDataBuffer[1]);
+            Exynos_OutputBufferReturn(pOMXComponent, pDataBuffer[1]);
     }
 
     if (pExynosComponent->bMultiThreadProcess == OMX_TRUE) {
@@ -688,12 +688,12 @@ EXIT:
 }
 
 OMX_ERRORTYPE Exynos_InputBufferReturn(
-    OMX_COMPONENTTYPE   *pOMXComponent)
+    OMX_COMPONENTTYPE       *pOMXComponent,
+    EXYNOS_OMX_DATABUFFER   *pDataBuffer)
 {
     OMX_ERRORTYPE                ret                = OMX_ErrorNone;
     EXYNOS_OMX_BASECOMPONENT    *pExynosComponent   = NULL;
     EXYNOS_OMX_BASEPORT         *pExynosPort        = NULL;
-    EXYNOS_OMX_DATABUFFER       *pDataBuffer        = NULL;
     OMX_BUFFERHEADERTYPE        *pBufferHdr         = NULL;
 
     FunctionIn();
@@ -710,80 +710,15 @@ OMX_ERRORTYPE Exynos_InputBufferReturn(
     pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
     pExynosPort = &(pExynosComponent->pExynosPort[INPUT_PORT_INDEX]);
 
-    if (pExynosPort->bufferProcessType & BUFFER_COPY) {
-        pDataBuffer = &(pExynosPort->way.port2WayDataBuffer.inputDataBuffer);
-    } else if (pExynosPort->bufferProcessType & BUFFER_SHARE) {
-        pDataBuffer = &(pExynosPort->way.port2WayDataBuffer.outputDataBuffer);
-    }
-
     if (pDataBuffer != NULL)
         pBufferHdr = pDataBuffer->bufferHeader;
 
     if (pBufferHdr != NULL) {
         if (pExynosPort->markType.hMarkTargetComponent != NULL) {
-            pBufferHdr->hMarkTargetComponent = pExynosPort->markType.hMarkTargetComponent;
-            pBufferHdr->pMarkData            = pExynosPort->markType.pMarkData;
-            pExynosPort->markType.hMarkTargetComponent = NULL;
-            pExynosPort->markType.pMarkData = NULL;
-        }
-
-        if (pBufferHdr->hMarkTargetComponent != NULL) {
-            if (pBufferHdr->hMarkTargetComponent == pOMXComponent) {
-                pExynosComponent->pCallbacks->EventHandler(pOMXComponent,
-                                pExynosComponent->callbackData,
-                                OMX_EventMark,
-                                0, 0, pBufferHdr->pMarkData);
-            } else {
-                pExynosComponent->propagateMarkType.hMarkTargetComponent = pBufferHdr->hMarkTargetComponent;
-                pExynosComponent->propagateMarkType.pMarkData = pBufferHdr->pMarkData;
-            }
-        }
-
-        pBufferHdr->nFilledLen = 0;
-        pBufferHdr->nOffset = 0;
-        Exynos_OMX_InputBufferReturn(pOMXComponent, pBufferHdr);
-    }
-
-    /* reset dataBuffer */
-    Exynos_ResetDataBuffer(pDataBuffer);
-
-EXIT:
-    FunctionOut();
-
-    return ret;
-}
-
-OMX_ERRORTYPE Exynos_FlushInputBufferReturn(
-    OMX_COMPONENTTYPE       *pOMXComponent,
-    EXYNOS_OMX_DATABUFFER   *pDataBuffer)
-{
-    OMX_ERRORTYPE                ret = OMX_ErrorNone;
-    EXYNOS_OMX_BASECOMPONENT    *pExynosComponent   = NULL;
-    EXYNOS_OMX_BASEPORT         *pExynosPort        = NULL;
-    OMX_BUFFERHEADERTYPE        *pBufferHdr         = NULL;
-
-    FunctionIn();
-
-    if (pOMXComponent == NULL) {
-        ret = OMX_ErrorBadParameter;
-        goto EXIT;
-    }
-
-    if (pOMXComponent->pComponentPrivate == NULL) {
-        ret = OMX_ErrorBadParameter;
-        goto EXIT;
-    }
-    pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
-    pExynosPort = &(pExynosComponent->pExynosPort[INPUT_PORT_INDEX]);
-
-    pBufferHdr = pDataBuffer->bufferHeader;
-
-    if (pBufferHdr != NULL) {
-        if (pExynosPort->markType.hMarkTargetComponent != NULL) {
-            pBufferHdr->hMarkTargetComponent  = pExynosPort->markType.hMarkTargetComponent;
-            pBufferHdr->pMarkData             = pExynosPort->markType.pMarkData;
-            pExynosPort->markType.hMarkTargetComponent = NULL;
-            pExynosPort->markType.pMarkData = NULL;
+            pBufferHdr->hMarkTargetComponent            = pExynosPort->markType.hMarkTargetComponent;
+            pBufferHdr->pMarkData                       = pExynosPort->markType.pMarkData;
+            pExynosPort->markType.hMarkTargetComponent  = NULL;
+            pExynosPort->markType.pMarkData             = NULL;
         }
 
         if (pBufferHdr->hMarkTargetComponent != NULL) {
@@ -793,13 +728,13 @@ OMX_ERRORTYPE Exynos_FlushInputBufferReturn(
                                 OMX_EventMark,
                                 0, 0, pBufferHdr->pMarkData);
             } else {
-                pExynosComponent->propagateMarkType.hMarkTargetComponent = pBufferHdr->hMarkTargetComponent;
-                pExynosComponent->propagateMarkType.pMarkData = pBufferHdr->pMarkData;
+                pExynosComponent->propagateMarkType.hMarkTargetComponent    = pBufferHdr->hMarkTargetComponent;
+                pExynosComponent->propagateMarkType.pMarkData               = pBufferHdr->pMarkData;
             }
         }
 
-        pBufferHdr->nFilledLen = 0;
-        pBufferHdr->nOffset = 0;
+        pBufferHdr->nFilledLen  = 0;
+        pBufferHdr->nOffset     = 0;
         Exynos_OMX_InputBufferReturn(pOMXComponent, pBufferHdr);
     }
 
@@ -870,12 +805,12 @@ EXIT:
 }
 
 OMX_ERRORTYPE Exynos_OutputBufferReturn(
-    OMX_COMPONENTTYPE   *pOMXComponent)
+    OMX_COMPONENTTYPE       *pOMXComponent,
+    EXYNOS_OMX_DATABUFFER   *pDataBuffer)
 {
     OMX_ERRORTYPE             ret               = OMX_ErrorNone;
     EXYNOS_OMX_BASECOMPONENT *pExynosComponent  = NULL;
     EXYNOS_OMX_BASEPORT      *pExynosPort       = NULL;
-    EXYNOS_OMX_DATABUFFER    *pDataBuffer       = NULL;
     OMX_BUFFERHEADERTYPE     *pBufferHdr        = NULL;
 
     FunctionIn();
@@ -892,8 +827,8 @@ OMX_ERRORTYPE Exynos_OutputBufferReturn(
     pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
     pExynosPort = &(pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]);
 
-    pDataBuffer = &(pExynosPort->way.port2WayDataBuffer.outputDataBuffer);
-    pBufferHdr = pDataBuffer->bufferHeader;
+    if (pDataBuffer != NULL)
+        pBufferHdr = pDataBuffer->bufferHeader;
 
     if (pBufferHdr != NULL) {
         pBufferHdr->nFilledLen = pDataBuffer->remainDataLen;
@@ -904,8 +839,8 @@ OMX_ERRORTYPE Exynos_OutputBufferReturn(
         if (pExynosComponent->propagateMarkType.hMarkTargetComponent != NULL) {
             pBufferHdr->hMarkTargetComponent = pExynosComponent->propagateMarkType.hMarkTargetComponent;
             pBufferHdr->pMarkData            = pExynosComponent->propagateMarkType.pMarkData;
-            pExynosComponent->propagateMarkType.hMarkTargetComponent = NULL;
-            pExynosComponent->propagateMarkType.pMarkData = NULL;
+            pExynosComponent->propagateMarkType.hMarkTargetComponent    = NULL;
+            pExynosComponent->propagateMarkType.pMarkData               = NULL;
         }
 
         if ((pBufferHdr->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) {
@@ -930,62 +865,6 @@ EXIT:
     return ret;
 }
 
-OMX_ERRORTYPE Exynos_FlushOutputBufferReturn(
-    OMX_COMPONENTTYPE       *pOMXComponent,
-    EXYNOS_OMX_DATABUFFER   *pDataBuffer)
-{
-    OMX_ERRORTYPE             ret               = OMX_ErrorNone;
-    EXYNOS_OMX_BASECOMPONENT *pExynosComponent  = NULL;
-    OMX_BUFFERHEADERTYPE     *pBufferHdr        = NULL;
-
-    FunctionIn();
-
-    if (pOMXComponent == NULL) {
-        ret = OMX_ErrorBadParameter;
-        goto EXIT;
-    }
-
-    if (pOMXComponent->pComponentPrivate == NULL) {
-        ret = OMX_ErrorBadParameter;
-        goto EXIT;
-    }
-    pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
-    pBufferHdr = pDataBuffer->bufferHeader;
-
-    if (pBufferHdr != NULL) {
-        pBufferHdr->nFilledLen = pDataBuffer->remainDataLen;
-        pBufferHdr->nOffset    = 0;
-        pBufferHdr->nFlags     = pDataBuffer->nFlags;
-        pBufferHdr->nTimeStamp = pDataBuffer->timeStamp;
-
-        if (pExynosComponent->propagateMarkType.hMarkTargetComponent != NULL) {
-            pBufferHdr->hMarkTargetComponent    = pExynosComponent->propagateMarkType.hMarkTargetComponent;
-            pBufferHdr->pMarkData               = pExynosComponent->propagateMarkType.pMarkData;
-            pExynosComponent->propagateMarkType.hMarkTargetComponent = NULL;
-            pExynosComponent->propagateMarkType.pMarkData = NULL;
-        }
-
-        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,
-                            pBufferHdr->nFlags, NULL);
-        }
-        Exynos_OMX_OutputBufferReturn(pOMXComponent, pBufferHdr);
-    }
-
-    /* reset dataBuffer */
-    Exynos_ResetDataBuffer(pDataBuffer);
-
-EXIT:
-    FunctionOut();
-
-    return ret;
-}
-
 OMX_ERRORTYPE Exynos_OutputBufferGetQueue(
     EXYNOS_OMX_BASECOMPONENT    *pExynosComponent)
 {
index 777e59ca696fbd2ce0cef410fb2712153118c429..fa618eb40ea3170d71a6e23c32d95f6af2480778 100644 (file)
@@ -87,11 +87,9 @@ OMX_ERRORTYPE Exynos_OMX_VideoEncodeGetExtensionIndex(
     OMX_IN OMX_HANDLETYPE  hComponent,
     OMX_IN OMX_STRING      szParameterName,
     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 *pDataBuffer);
-OMX_ERRORTYPE Exynos_FlushOutputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATABUFFER *pDataBuffer);
 OMX_ERRORTYPE Exynos_Shared_DataToBuffer(EXYNOS_OMX_DATA *pData, EXYNOS_OMX_DATABUFFER *pUseBuffer, OMX_BOOL bNeedUnlock);
 
 #ifdef __cplusplus