From 0ffdc2e63c0d7e3d82f1bcba8b6253230cbf38e7 Mon Sep 17 00:00:00 2001 From: Taehwan Kim Date: Tue, 11 Dec 2012 09:20:31 +0000 Subject: [PATCH] venc: changed CSC method in case of RGB input color if USE_GSC_RGB_ENCODER is true, CSC method is chaned to CSC_METHOD_HW from CSC_METHOD_SW in case of RGB input color. Change-Id: I67212bfd04a7bf8c9b5d7d65551b26a31d63c150 Signed-off-by: Taehwan Kim --- component/video/enc/Android.mk | 4 ++++ component/video/enc/Exynos_OMX_Venc.c | 29 ++++++++++++++++++--------- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/component/video/enc/Android.mk b/component/video/enc/Android.mk index e8f6057..cfe4bd1 100644 --- a/component/video/enc/Android.mk +++ b/component/video/enc/Android.mk @@ -46,6 +46,10 @@ ifeq ($(BOARD_USE_USERPTR_CAMERA_INPUT), true) LOCAL_CFLAGS += -DUSE_USERPTR_CAMERA_INPUT endif +ifeq ($(BOARD_USE_GSC_RGB_ENCODER), true) +LOCAL_CFLAGS += -DUSE_GSC_RGB_ENCODER +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 1097f73..118c516 100644 --- a/component/video/enc/Exynos_OMX_Venc.c +++ b/component/video/enc/Exynos_OMX_Venc.c @@ -203,15 +203,6 @@ OMX_BOOL Exynos_CSC_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA pDstBuf[1] = srcInputData->buffer.multiPlaneBuffer.dataBuffer[1]; pDstBuf[2] = srcInputData->buffer.multiPlaneBuffer.dataBuffer[2]; -#ifdef USE_DMA_BUF - csc_get_method(pVideoEnc->csc_handle, &csc_method); - if (csc_method == CSC_METHOD_HW) { - pDstBuf[0] = srcInputData->buffer.multiPlaneBuffer.fd[0]; - pDstBuf[1] = srcInputData->buffer.multiPlaneBuffer.fd[1]; - pDstBuf[2] = srcInputData->buffer.multiPlaneBuffer.fd[2]; - } -#endif - #ifdef USE_METADATABUFFERTYPE OMX_PTR ppBuf[MAX_BUFFER_PLANE]; @@ -236,7 +227,18 @@ OMX_BOOL Exynos_CSC_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA imageSize = nFrameWidth * nFrameHeight * 3; /* RGB888 */ +#ifdef USE_GSC_RGB_ENCODER + if (pVideoEnc->csc_set_format == OMX_FALSE) { + cscRet = csc_set_method(pVideoEnc->csc_handle, CSC_METHOD_HW); + if (cscRet != CSC_ErrorNone) { + ret = OMX_FALSE; + goto EXIT; + } + } +#endif + #ifdef USE_DMA_BUF + csc_get_method(pVideoEnc->csc_handle, &csc_method); if (csc_method == CSC_METHOD_HW) pSrcBuf[0] = (unsigned char *)planes[0].fd; else @@ -249,6 +251,7 @@ OMX_BOOL Exynos_CSC_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA #endif { #ifdef USE_DMA_BUF + csc_get_method(pVideoEnc->csc_handle, &csc_method); if (csc_method == CSC_METHOD_HW) { pSrcBuf[0] = Exynos_OSAL_SharedMemory_VirtToION(pVideoEnc->hSharedMemory, checkInputStream); pSrcBuf[1] = NULL; @@ -274,6 +277,14 @@ OMX_BOOL Exynos_CSC_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA } } +#ifdef USE_DMA_BUF + if (csc_method == CSC_METHOD_HW) { + pDstBuf[0] = srcInputData->buffer.multiPlaneBuffer.fd[0]; + pDstBuf[1] = srcInputData->buffer.multiPlaneBuffer.fd[1]; + pDstBuf[2] = srcInputData->buffer.multiPlaneBuffer.fd[2]; + } +#endif + csc_set_src_format( pVideoEnc->csc_handle, /* handle */ nFrameWidth, /* width */ -- 2.20.1