venc: added UnlockANB in FlushPort sequence
authorTaehwan Kim <t_h.kim@samsung.com>
Fri, 7 Dec 2012 01:20:09 +0000 (01:20 +0000)
committerTaehwan Kim <t_h.kim@samsung.com>
Fri, 14 Dec 2012 08:30:51 +0000 (08:30 +0000)
added UnlockANB in FlushPort sequence
to support sharing gralloc buffer about input port.
locked ANB is needed unlock before returning.

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

index 07794a1471fc579d10d3a27c64565ab930259592..8ac138f195a8d9ebd24e67e0d1dbe43c11d043e6 100644 (file)
@@ -501,6 +501,12 @@ OMX_ERRORTYPE Exynos_OMX_FlushPort(
         if (pExynosPort->bufferProcessType & BUFFER_SHARE) {
             if (pExynosPort->processData.bufferHeader != NULL) {
                 if (nPortIndex == INPUT_PORT_INDEX) {
+#ifdef USE_METADATABUFFERTYPE
+                    if ((pExynosPort->bStoreMetaData == OMX_TRUE) &&
+                        (pExynosPort->portDefinition.format.video.eColorFormat == OMX_COLOR_FormatAndroidOpaque)) {
+                         Exynos_OSAL_UnlockANB(pExynosPort->processData.bufferHeader->pBuffer);
+                    }
+#endif
                     Exynos_OMX_InputBufferReturn(pOMXComponent, pExynosPort->processData.bufferHeader);
                 } else if (nPortIndex == OUTPUT_PORT_INDEX) {
                     Exynos_OMX_OutputBufferReturn(pOMXComponent, pExynosPort->processData.bufferHeader);
@@ -514,6 +520,12 @@ OMX_ERRORTYPE Exynos_OMX_FlushPort(
                         Exynos_OMX_OutputBufferReturn(pOMXComponent,
                                                       pExynosPort->extendBufferHeader[i].OMXBufferHeader);
                     } else if (nPortIndex == INPUT_PORT_INDEX) {
+#ifdef USE_METADATABUFFERTYPE
+                        if ((pExynosPort->bStoreMetaData == OMX_TRUE) &&
+                            (pExynosPort->portDefinition.format.video.eColorFormat == OMX_COLOR_FormatAndroidOpaque)) {
+                             Exynos_OSAL_UnlockANB(pExynosPort->extendBufferHeader[i].OMXBufferHeader->pBuffer);
+                        }
+#endif
                         Exynos_OMX_InputBufferReturn(pOMXComponent,
                                                      pExynosPort->extendBufferHeader[i].OMXBufferHeader);
                     }