openmax: Change DPB setting scheme.
authorSeungBeom Kim <sbcrux.kim@samsung.com>
Tue, 19 Feb 2013 04:56:51 +0000 (13:56 +0900)
committerHuisung Kang <hs1218.kang@samsung.com>
Wed, 20 Feb 2013 04:35:47 +0000 (13:35 +0900)
Change DPB setting scheme on buffer shared mode for init and buffer reconfigure.
In the case of DPB buffer setting to MFC FW before incomming buffer to OpenMAX component,
Need for the Improved stability of buffer processing.

Depends On
 - Change-Id: If008de62a40baa262085fcf9dbadfe4b80ac2619

Change-Id: Iae6843dfc23708f4b80faa1fceeeccef09148482
Signed-off-by: SeungBeom Kim <sbcrux.kim@samsung.com>
component/video/dec/h264/Exynos_OMX_H264dec.c
component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c
component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c
component/video/dec/vc1/Exynos_OMX_Wmvdec.c
component/video/dec/vp8/Exynos_OMX_Vp8dec.c

index 5269d4cf1601170c4be9ca3631479276d713bcae..f7a0d453a9bfb7f1ee1b0f8b54d6c2d1c82fe4d2 100644 (file)
@@ -1064,6 +1064,12 @@ OMX_ERRORTYPE H264CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent)
             pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pVideoDec->pMFCDecOutputBuffer[i]->pVirAddr,
                             (unsigned int *)dataLen, MFC_OUTPUT_BUFFER_PLANE, NULL);
         }
+
+        if (pOutbufOps->Run(hMFCHandle) != VIDEO_ERROR_NONE) {
+            Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to run output buffer");
+            ret = OMX_ErrorInsufficientResources;
+            goto EXIT;
+        }
     } else if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) {
         ExynosVideoPlane planes[MFC_OUTPUT_BUFFER_PLANE];
         int plane;
@@ -1097,6 +1103,12 @@ OMX_ERRORTYPE H264CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent)
                 pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pExynosOutputPort->extendBufferHeader[i].pYUVBuf,
                                (unsigned int *)dataLen, MFC_OUTPUT_BUFFER_PLANE, NULL);
             }
+
+            if (pOutbufOps->Apply_RegisteredBuffer(hMFCHandle) != VIDEO_ERROR_NONE) {
+                Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to Apply output buffer");
+                ret = OMX_ErrorHardware;
+                goto EXIT;
+            }
         } else {
             ret = OMX_ErrorNotImplemented;
             goto EXIT;
@@ -1107,15 +1119,6 @@ OMX_ERRORTYPE H264CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent)
 #endif
     }
 
-    if (pOutbufOps->Run(hMFCHandle) != VIDEO_ERROR_NONE) {
-        Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to run output buffer");
-        ret = OMX_ErrorInsufficientResources;
-        goto EXIT;
-    }
-
-    if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) {
-        H264CodecStop(pOMXComponent, OUTPUT_PORT_INDEX);
-    }
     pH264Dec->hMFCH264Handle.bConfiguredMFCDst = OMX_TRUE;
 
     ret = OMX_ErrorNone;
index 3bd76e97ed552546b9f6e553a6951a1a648fb74d..7d12fa361473aa865b9c92577da11936b1e8b722 100644 (file)
@@ -782,6 +782,12 @@ OMX_ERRORTYPE Mpeg2CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent)
             pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pVideoDec->pMFCDecOutputBuffer[i]->pVirAddr,
                             (unsigned int *)dataLen, MFC_OUTPUT_BUFFER_PLANE, NULL);
         }
+
+        if (pOutbufOps->Run(hMFCHandle) != VIDEO_ERROR_NONE) {
+            Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to run output buffer");
+            ret = OMX_ErrorInsufficientResources;
+            goto EXIT;
+        }
     } else if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) {
         ExynosVideoPlane planes[MFC_OUTPUT_BUFFER_PLANE];
         int plane;
@@ -815,6 +821,12 @@ OMX_ERRORTYPE Mpeg2CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent)
                 pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pExynosOutputPort->extendBufferHeader[i].pYUVBuf,
                               (unsigned int *)dataLen, MFC_OUTPUT_BUFFER_PLANE, NULL);
             }
+
+            if (pOutbufOps->Apply_RegisteredBuffer(hMFCHandle) != VIDEO_ERROR_NONE) {
+                Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to Apply output buffer");
+                ret = OMX_ErrorHardware;
+                goto EXIT;
+            }
         } else {
             ret = OMX_ErrorNotImplemented;
             goto EXIT;
@@ -825,15 +837,6 @@ OMX_ERRORTYPE Mpeg2CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent)
 #endif
     }
 
-    if (pOutbufOps->Run(hMFCHandle) != VIDEO_ERROR_NONE) {
-        Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to run output buffer");
-        ret = OMX_ErrorInsufficientResources;
-        goto EXIT;
-    }
-
-    if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) {
-        Mpeg2CodecStop (pOMXComponent, OUTPUT_PORT_INDEX);
-    }
     pMpeg2Dec->hMFCMpeg2Handle.bConfiguredMFCDst = OMX_TRUE;
 
     ret = OMX_ErrorNone;
index 680d49f8d84adc6a3eaad13ce341a1e6aa5cc5b7..3ef67f74af10ab23661ffcd1122d5dc9bdac8028 100644 (file)
@@ -1003,6 +1003,12 @@ OMX_ERRORTYPE Mpeg4CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent)
             pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pVideoDec->pMFCDecOutputBuffer[i]->pVirAddr,
                             (unsigned int *)dataLen, MFC_OUTPUT_BUFFER_PLANE, NULL);
         }
+
+        if (pOutbufOps->Run(hMFCHandle) != VIDEO_ERROR_NONE) {
+            Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to run output buffer");
+            ret = OMX_ErrorInsufficientResources;
+            goto EXIT;
+        }
     } else if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) {
         ExynosVideoPlane planes[MFC_OUTPUT_BUFFER_PLANE];
         int plane;
@@ -1036,6 +1042,12 @@ OMX_ERRORTYPE Mpeg4CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent)
                 pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pExynosOutputPort->extendBufferHeader[i].pYUVBuf,
                                (unsigned int *)dataLen, MFC_OUTPUT_BUFFER_PLANE, NULL);
             }
+
+            if (pOutbufOps->Apply_RegisteredBuffer(hMFCHandle) != VIDEO_ERROR_NONE) {
+                Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to Apply output buffer");
+                ret = OMX_ErrorHardware;
+                goto EXIT;
+            }
         } else {
             ret = OMX_ErrorNotImplemented;
             goto EXIT;
@@ -1046,15 +1058,6 @@ OMX_ERRORTYPE Mpeg4CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent)
 #endif
     }
 
-    if (pOutbufOps->Run(hMFCHandle) != VIDEO_ERROR_NONE) {
-        Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to run output buffer");
-        ret = OMX_ErrorInsufficientResources;
-        goto EXIT;
-    }
-
-    if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) {
-        Mpeg4CodecStop(pOMXComponent, OUTPUT_PORT_INDEX);
-    }
     pMpeg4Dec->hMFCMpeg4Handle.bConfiguredMFCDst = OMX_TRUE;
 
     ret = OMX_ErrorNone;
index a0b31d9994508e9117cc3e18906fe74136e55de3..4bd3854ca90c2568ad77cb42fa1f96becfa08dd2 100644 (file)
@@ -1046,6 +1046,12 @@ OMX_ERRORTYPE WmvCodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent)
             pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pVideoDec->pMFCDecOutputBuffer[i]->pVirAddr,
                             (unsigned int *)dataLen, MFC_OUTPUT_BUFFER_PLANE, NULL);
         }
+
+        if (pOutbufOps->Run(hMFCHandle) != VIDEO_ERROR_NONE) {
+            Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to run output buffer");
+            ret = OMX_ErrorInsufficientResources;
+            goto EXIT;
+        }
     } else if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) {
         ExynosVideoPlane planes[MFC_OUTPUT_BUFFER_PLANE];
         int plane;
@@ -1079,6 +1085,12 @@ OMX_ERRORTYPE WmvCodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent)
                 pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pExynosOutputPort->extendBufferHeader[i].pYUVBuf,
                               (unsigned int *)dataLen, MFC_OUTPUT_BUFFER_PLANE, NULL);
             }
+
+            if (pOutbufOps->Apply_RegisteredBuffer(hMFCHandle) != VIDEO_ERROR_NONE) {
+                Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to Apply output buffer");
+                ret = OMX_ErrorHardware;
+                goto EXIT;
+            }
         } else {
             ret = OMX_ErrorNotImplemented;
             goto EXIT;
@@ -1089,15 +1101,6 @@ OMX_ERRORTYPE WmvCodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent)
 #endif
     }
 
-    if (pOutbufOps->Run(hMFCHandle) != VIDEO_ERROR_NONE) {
-        Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to run output buffer");
-        ret = OMX_ErrorInsufficientResources;
-        goto EXIT;
-    }
-
-    if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) {
-        WmvCodecStop (pOMXComponent, OUTPUT_PORT_INDEX);
-    }
     pWmvDec->hMFCWmvHandle.bConfiguredMFCDst = OMX_TRUE;
 
     ret = OMX_ErrorNone;
index c1af2c749377e4cd521b900e7539f386764a9e18..2e56a61370866df4962c591c2e67faa5208f3843 100644 (file)
@@ -814,6 +814,12 @@ OMX_ERRORTYPE VP8CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent)
             pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pVideoDec->pMFCDecOutputBuffer[i]->pVirAddr,
                             (unsigned int *)dataLen, MFC_OUTPUT_BUFFER_PLANE, NULL);
         }
+
+        if (pOutbufOps->Run(hMFCHandle) != VIDEO_ERROR_NONE) {
+            Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to run output buffer");
+            ret = OMX_ErrorInsufficientResources;
+            goto EXIT;
+        }
     } else if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) {
         ExynosVideoPlane planes[MFC_OUTPUT_BUFFER_PLANE];
         int plane;
@@ -847,6 +853,12 @@ OMX_ERRORTYPE VP8CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent)
                 pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pExynosOutputPort->extendBufferHeader[i].pYUVBuf,
                               (unsigned int *)dataLen, MFC_OUTPUT_BUFFER_PLANE, NULL);
             }
+
+            if (pOutbufOps->Apply_RegisteredBuffer(hMFCHandle) != VIDEO_ERROR_NONE) {
+                Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to Apply output buffer");
+                ret = OMX_ErrorHardware;
+                goto EXIT;
+            }
         } else {
             ret = OMX_ErrorNotImplemented;
             goto EXIT;
@@ -857,15 +869,6 @@ OMX_ERRORTYPE VP8CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent)
 #endif
     }
 
-    if (pOutbufOps->Run(hMFCHandle) != VIDEO_ERROR_NONE) {
-        Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to run output buffer");
-        ret = OMX_ErrorInsufficientResources;
-        goto EXIT;
-    }
-
-    if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) {
-        VP8CodecStop (pOMXComponent, OUTPUT_PORT_INDEX);
-    }
     pVp8Dec->hMFCVp8Handle.bConfiguredMFCDst = OMX_TRUE;
 
     ret = OMX_ErrorNone;