exynos_omx: multi_thread: Add buffer index reset scheme.
authorSeungBeom Kim <sbcrux.kim@samsung.com>
Wed, 23 Oct 2013 04:54:39 +0000 (13:54 +0900)
committerLajos Molnar <lajos@google.com>
Wed, 4 Jun 2014 00:59:11 +0000 (17:59 -0700)
Add buffer index reset scheme when the Dynamic Resolution Change with dynamic DPB Change working.

Bug: 10916591
Change-Id: I897c81beb2d0c8a83399e0d1e1d5c4658d9bb00c
Signed-off-by: SeungBeom Kim <sbcrux.kim@samsung.com>
exynos_omx/openmax/exynos_omx/component/video/dec/h264/Exynos_OMX_H264dec.c
exynos_omx/openmax/exynos_omx/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c
exynos_omx/openmax/exynos_omx/component/video/dec/vp8/Exynos_OMX_Vp8dec.c

index 10d0a1d429421630713c3d5e475ef43f01a62375..b217a1bd11e79c41478b68b0ea3b6a3e6b55333d 100644 (file)
@@ -461,11 +461,15 @@ OMX_ERRORTYPE H264CodecStop(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortIndex
     pInbufOps  = pH264Dec->hMFCH264Handle.pInbufOps;
     pOutbufOps = pH264Dec->hMFCH264Handle.pOutbufOps;
 
-    if ((nPortIndex == INPUT_PORT_INDEX) && (pInbufOps != NULL))
+    if ((nPortIndex == INPUT_PORT_INDEX) && (pInbufOps != NULL)) {
         pInbufOps->Stop(hMFCHandle);
-    else if ((nPortIndex == OUTPUT_PORT_INDEX) && (pOutbufOps != NULL))
+    } else if ((nPortIndex == OUTPUT_PORT_INDEX) && (pOutbufOps != NULL)) {
+        EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
+        EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
         pOutbufOps->Stop(hMFCHandle);
-
+        if (pExynosOutputPort->bufferProcessType == BUFFER_SHARE)
+            pOutbufOps->Clear_RegisteredBuffer(hMFCHandle);
+    }
     ret = OMX_ErrorNone;
 
 EXIT:
index bae0f2f8a89beb43e6b1bff5b0c2533a3f53864e..389da07a0df3521cfb48aa4f3b0415b55b77aaaf 100644 (file)
@@ -565,11 +565,15 @@ OMX_ERRORTYPE Mpeg4CodecStop(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortInde
     pInbufOps  = pMpeg4Dec->hMFCMpeg4Handle.pInbufOps;
     pOutbufOps = pMpeg4Dec->hMFCMpeg4Handle.pOutbufOps;
 
-    if ((nPortIndex == INPUT_PORT_INDEX) && (pInbufOps != NULL))
+    if ((nPortIndex == INPUT_PORT_INDEX) && (pInbufOps != NULL)) {
         pInbufOps->Stop(hMFCHandle);
-    else if ((nPortIndex == OUTPUT_PORT_INDEX) && (pOutbufOps != NULL))
+    } else if ((nPortIndex == OUTPUT_PORT_INDEX) && (pOutbufOps != NULL)) {
+        EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
+        EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
         pOutbufOps->Stop(hMFCHandle);
-
+        if (pExynosOutputPort->bufferProcessType == BUFFER_SHARE)
+            pOutbufOps->Clear_RegisteredBuffer(hMFCHandle);
+    }
     ret = OMX_ErrorNone;
 
 EXIT:
index e2980bbaec65d3239fbd4e1e9e539f43092a4158..f45a689fb3f83bc004b9d43bd645b176f6028eb6 100644 (file)
@@ -380,11 +380,15 @@ OMX_ERRORTYPE VP8CodecStop(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortIndex)
     pInbufOps  = pVp8Dec->hMFCVp8Handle.pInbufOps;
     pOutbufOps = pVp8Dec->hMFCVp8Handle.pOutbufOps;
 
-    if ((nPortIndex == INPUT_PORT_INDEX) && (pInbufOps != NULL))
+    if ((nPortIndex == INPUT_PORT_INDEX) && (pInbufOps != NULL)) {
         pInbufOps->Stop(hMFCHandle);
-    else if ((nPortIndex == OUTPUT_PORT_INDEX) && (pOutbufOps != NULL))
+    } else if ((nPortIndex == OUTPUT_PORT_INDEX) && (pOutbufOps != NULL)) {
+        EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
+        EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
         pOutbufOps->Stop(hMFCHandle);
-
+        if (pExynosOutputPort->bufferProcessType == BUFFER_SHARE)
+            pOutbufOps->Clear_RegisteredBuffer(hMFCHandle);
+    }
     ret = OMX_ErrorNone;
 
 EXIT: