From: Taehwan Kim Date: Thu, 29 Nov 2012 08:55:20 +0000 (+0000) Subject: [HACK] venc: support USERPTR about input X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f27148d67da2a9a308adcb4d5f192ef69e7bbe9c;p=GitHub%2FLineageOS%2Fandroid_hardware_samsung_slsi_openmax.git [HACK] venc: support USERPTR about input 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 --- diff --git a/component/video/enc/Android.mk b/component/video/enc/Android.mk index dd168c9..e8f6057 100644 --- a/component/video/enc/Android.mk +++ b/component/video/enc/Android.mk @@ -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) diff --git a/component/video/enc/Exynos_OMX_Venc.c b/component/video/enc/Exynos_OMX_Venc.c index 8233ac0..49beb26 100644 --- a/component/video/enc/Exynos_OMX_Venc.c +++ b/component/video/enc/Exynos_OMX_Venc.c @@ -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];