[HACK] venc: support USERPTR about input
authorTaehwan Kim <t_h.kim@samsung.com>
Thu, 29 Nov 2012 08:55:20 +0000 (08:55 +0000)
committerTaehwan Kim <t_h.kim@samsung.com>
Thu, 29 Nov 2012 15:21:08 +0000 (15:21 +0000)
This is temporary patch
in order to support USERPTR about input
in camera recording scenario
even if use DMA_BUF.

Change-Id: Ie218644d6dca425ce29ab4b190152c1b8c59ee03
Signed-off-by: Taehwan Kim <t_h.kim@samsung.com>
component/video/enc/Android.mk
component/video/enc/Exynos_OMX_Venc.c

index dd168c9e8f481a60afda64e476431d9a1d04823a..e8f6057e526271633555b221b660335f30bfbf49 100644 (file)
@@ -42,6 +42,10 @@ ifeq ($(BOARD_USE_DMA_BUF), true)
 LOCAL_CFLAGS += -DUSE_DMA_BUF
 endif
 
+ifeq ($(BOARD_USE_USERPTR_CAMERA_INPUT), true)
+LOCAL_CFLAGS += -DUSE_USERPTR_CAMERA_INPUT
+endif
+
 LOCAL_SHARED_LIBRARIES := libcsc
 
 include $(BUILD_STATIC_LIBRARY)
index 8233ac0c45d4cf7bba7caf860f423bbd4b87faa3..49beb26d23ba9c03f00a8e79ced3cf9bb61d9545 100644 (file)
@@ -377,6 +377,7 @@ OMX_BOOL Exynos_Preprocessor_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_
                 } else {
                     /* kMetadataBufferTypeCameraSource */
                     Exynos_OSAL_GetInfoFromMetaData((OMX_BYTE)inputUseBuffer->bufferHeader->pBuffer, ppBuf);
+#ifndef USE_USERPTR_CAMERA_INPUT
 #ifdef USE_DMA_BUF
                     srcInputData->buffer.multiPlaneBuffer.fd[0] = ppBuf[0];
                     srcInputData->buffer.multiPlaneBuffer.fd[1] = ppBuf[1];
@@ -394,6 +395,12 @@ OMX_BOOL Exynos_Preprocessor_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_
                     /* input buffers are 2 plane. */
                     srcInputData->buffer.multiPlaneBuffer.dataBuffer[2] = NULL;
                     srcInputData->buffer.multiPlaneBuffer.fd[2] = -1;
+#else
+                    for (plane = 0; plane < MFC_INPUT_BUFFER_PLANE; plane++) {
+                        srcInputData->buffer.multiPlaneBuffer.dataBuffer[plane] = ppBuf[plane];
+                    }
+                    srcInputData->buffer.multiPlaneBuffer.dataBuffer[2] = NULL;
+#endif
 #else
                     for (plane = 0; plane < MFC_INPUT_BUFFER_PLANE; plane++) {
                         srcInputData->buffer.multiPlaneBuffer.dataBuffer[plane] = ppBuf[plane];