osal: Add USE_ANB_OUTBUF_SHARE flag
authorYunji Kim <yunji.kim@samsung.com>
Mon, 29 Oct 2012 04:51:10 +0000 (13:51 +0900)
committerHuisung Kang <hs1218.kang@samsung.com>
Mon, 29 Oct 2012 04:54:24 +0000 (13:54 +0900)
This patch supports both share & copy mode for output buffer

Change-Id: I594b5aeedfdd294029b81e47577b3ff07ecb9112
Signed-off-by: Yunji Kim <yunji.kim@samsung.com>
Signed-off-by: Huisung Kang <hs1218.kang@samsung.com>
osal/Exynos_OSAL_Android.cpp

index c2346f3aab7e94c2718cd0615634040c2df5a6b0..224893a29b270ae706abaf874c27a2fa008eb7fb 100644 (file)
@@ -435,16 +435,22 @@ OMX_ERRORTYPE Exynos_OSAL_SetANBParameter(
             ret = OMX_ErrorBadPortIndex;
             goto EXIT;
         }
-
-        /* ANB and DPB Buffer Sharing */
-        pExynosPort->bIsANBEnabled = pANBParams->enable;
+#ifdef USE_ANB_OUTBUF_SHARE
+         /* ANB and DPB Buffer Sharing */
         if ((portIndex == OUTPUT_PORT_INDEX) &&
-            (pExynosPort->bIsANBEnabled == OMX_TRUE) &&
             ((pExynosPort->bufferProcessType & BUFFER_ANBSHARE) == BUFFER_ANBSHARE)) {
             pExynosPort->bufferProcessType = BUFFER_SHARE;
             pExynosPort->portDefinition.format.video.eColorFormat = (OMX_COLOR_FORMATTYPE)OMX_SEC_COLOR_FormatNV12Tiled;
-            Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "OMX_IndexParamEnableAndroidBuffers & bufferProcessType change to BUFFER_SHARE");
+            Exynos_OSAL_Log(EXYNOS_LOG_INFO, "output buffer sharing mode is on");
+        }
+#else
+        if ((portIndex == OUTPUT_PORT_INDEX) &&
+            (pExynosPort->bufferProcessType & BUFFER_COPY)) {
+            pExynosPort->bufferProcessType = BUFFER_COPY;
+            pExynosPort->portDefinition.format.video.eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar;
         }
+#endif
+        pExynosPort->bIsANBEnabled = pANBParams->enable;
     }
         break;