From 026e5b24868d57c1e8302c78d0894baea12562b8 Mon Sep 17 00:00:00 2001 From: Taehwan Kim Date: Wed, 26 Dec 2012 06:56:50 +0000 Subject: [PATCH] video: changed the memory type about ION memory type about ION is changed to SYSTEM_MEMORY from NORMAL_MEMORY. Change-Id: I6b1703fd4a1fc0969bbf31e71d30df49fb927f67 Signed-off-by: Taehwan Kim --- component/video/dec/Android.mk | 4 ++++ component/video/dec/Exynos_OMX_Vdec.c | 5 ++++- component/video/dec/Exynos_OMX_VdecControl.c | 11 ++++++----- component/video/enc/Android.mk | 4 ++++ component/video/enc/Exynos_OMX_Venc.c | 5 ++++- component/video/enc/Exynos_OMX_VencControl.c | 8 ++++---- 6 files changed, 26 insertions(+), 11 deletions(-) diff --git a/component/video/dec/Android.mk b/component/video/dec/Android.mk index 5d3ff78..45ed235 100644 --- a/component/video/dec/Android.mk +++ b/component/video/dec/Android.mk @@ -37,4 +37,8 @@ ifeq ($(BOARD_USE_DMA_BUF), true) LOCAL_CFLAGS += -DUSE_DMA_BUF endif +ifeq ($(BOARD_USE_CSC_HW), true) +LOCAL_CFLAGS += -DUSE_CSC_HW +endif + include $(BUILD_STATIC_LIBRARY) diff --git a/component/video/dec/Exynos_OMX_Vdec.c b/component/video/dec/Exynos_OMX_Vdec.c index 0dc4ab8..3ff4df8 100644 --- a/component/video/dec/Exynos_OMX_Vdec.c +++ b/component/video/dec/Exynos_OMX_Vdec.c @@ -159,7 +159,7 @@ OMX_ERRORTYPE Exynos_Allocate_CodecBuffers( OMX_ERRORTYPE ret = OMX_ErrorNone; EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle; - MEMORY_TYPE eMemoryType = NORMAL_MEMORY; + MEMORY_TYPE eMemoryType = SYSTEM_MEMORY; CODEC_DEC_BUFFER **ppCodecBuffer = NULL; OMX_U32 nPlaneCnt = 0; @@ -176,6 +176,9 @@ OMX_ERRORTYPE Exynos_Allocate_CodecBuffers( } else { ppCodecBuffer = &(pVideoDec->pMFCDecOutputBuffer[0]); nPlaneCnt = MFC_OUTPUT_BUFFER_PLANE; +#ifdef USE_CSC_HW + eMemoryType = NORMAL_MEMORY; +#endif } for (i = 0; i < nBufferCnt; i++) { diff --git a/component/video/dec/Exynos_OMX_VdecControl.c b/component/video/dec/Exynos_OMX_VdecControl.c index 8569265..f1454b8 100644 --- a/component/video/dec/Exynos_OMX_VdecControl.c +++ b/component/video/dec/Exynos_OMX_VdecControl.c @@ -157,7 +157,7 @@ OMX_ERRORTYPE Exynos_OMX_AllocateBuffer( OMX_U8 *temp_buffer = NULL; int temp_buffer_fd = -1; OMX_U32 i = 0; - MEMORY_TYPE mem_type; + MEMORY_TYPE mem_type = SYSTEM_MEMORY; FunctionIn(); @@ -194,13 +194,14 @@ OMX_ERRORTYPE Exynos_OMX_AllocateBuffer( goto EXIT; } - if ((pVideoDec->bDRMPlayerMode == OMX_TRUE) && (nPortIndex == INPUT_PORT_INDEX)) { + if ((pVideoDec->bDRMPlayerMode == OMX_TRUE) && + (nPortIndex == INPUT_PORT_INDEX)) { mem_type = SECURE_MEMORY; - } else if (pExynosPort->bufferProcessType & BUFFER_SHARE) { + } else if ((nPortIndex == OUTPUT_PORT_INDEX) && + (pExynosPort->bufferProcessType & BUFFER_SHARE)) { mem_type = NORMAL_MEMORY; - } else { - mem_type = SYSTEM_MEMORY; } + temp_buffer = Exynos_OSAL_SharedMemory_Alloc(pVideoDec->hSharedMemory, nSizeBytes, mem_type); if (temp_buffer == NULL) { ret = OMX_ErrorInsufficientResources; diff --git a/component/video/enc/Android.mk b/component/video/enc/Android.mk index 943757d..3ed9b0d 100644 --- a/component/video/enc/Android.mk +++ b/component/video/enc/Android.mk @@ -46,6 +46,10 @@ ifeq ($(BOARD_USE_GSC_RGB_ENCODER), true) LOCAL_CFLAGS += -DUSE_GSC_RGB_ENCODER endif +ifeq ($(BOARD_USE_CSC_HW), true) +LOCAL_CFLAGS += -DUSE_CSC_HW +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 38d28cf..919c3a1 100644 --- a/component/video/enc/Exynos_OMX_Venc.c +++ b/component/video/enc/Exynos_OMX_Venc.c @@ -126,7 +126,7 @@ OMX_ERRORTYPE Exynos_Allocate_CodecBuffers( OMX_ERRORTYPE ret = OMX_ErrorNone; EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle; - MEMORY_TYPE eMemoryType = NORMAL_MEMORY; + MEMORY_TYPE eMemoryType = SYSTEM_MEMORY; CODEC_ENC_BUFFER **ppCodecBuffer = NULL; OMX_U32 nPlaneCnt = 0; @@ -140,6 +140,9 @@ OMX_ERRORTYPE Exynos_Allocate_CodecBuffers( } else { ppCodecBuffer = &(pVideoEnc->pMFCEncOutputBuffer[0]); nPlaneCnt = MFC_OUTPUT_BUFFER_PLANE; +#ifdef USE_CSC_HW + eMemoryType = NORMAL_MEMORY; +#endif } for (i = 0; i < nBufferCnt; i++) { diff --git a/component/video/enc/Exynos_OMX_VencControl.c b/component/video/enc/Exynos_OMX_VencControl.c index 88d0724..89dd292 100644 --- a/component/video/enc/Exynos_OMX_VencControl.c +++ b/component/video/enc/Exynos_OMX_VencControl.c @@ -156,7 +156,7 @@ OMX_ERRORTYPE Exynos_OMX_AllocateBuffer( OMX_BUFFERHEADERTYPE *pTempBufferHdr = NULL; OMX_U8 *pTempBuffer = NULL; int fdTempBuffer = -1; - MEMORY_TYPE eMemType; + MEMORY_TYPE eMemType = SYSTEM_MEMORY; OMX_U32 i = 0; FunctionIn(); @@ -200,10 +200,10 @@ OMX_ERRORTYPE Exynos_OMX_AllocateBuffer( goto EXIT; } - if (pExynosPort->bufferProcessType & BUFFER_SHARE) + if ((nPortIndex == INPUT_PORT_INDEX) && + (pExynosPort->bufferProcessType & BUFFER_SHARE)) { eMemType = NORMAL_MEMORY; - else - eMemType = SYSTEM_MEMORY; + } pTempBuffer = Exynos_OSAL_SharedMemory_Alloc(pVideoEnc->hSharedMemory, nSizeBytes, eMemType); if (pTempBuffer == NULL) { -- 2.20.1