video: changed the memory type about ION
authorTaehwan Kim <t_h.kim@samsung.com>
Wed, 26 Dec 2012 06:56:50 +0000 (06:56 +0000)
committerTaehwan Kim <t_h.kim@samsung.com>
Thu, 3 Jan 2013 23:49:20 +0000 (23:49 +0000)
memory type about ION is changed
to SYSTEM_MEMORY from NORMAL_MEMORY.

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

index 5d3ff7813f4b9255a7ecab1549fe00f711c630ae..45ed2353ca3c0e386ed2891796091dca92c1bf96 100644 (file)
@@ -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)
index 0dc4ab890592f427a147535beba583ffba759044..3ff4df88166b0c4983773470abc18c59e119d212 100644 (file)
@@ -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++) {
index 8569265012c0243dde2da5802da6a4f3247d2733..f1454b8c0e0c4551c2617b9e2c0ca5a9f6644278 100644 (file)
@@ -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;
index 943757d51e145f3bdaa49adf29c2977d5f1db905..3ed9b0d9f30809ee5dc43f5362361cf431b8dc0b 100644 (file)
@@ -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)
index 38d28cf0c6d3497e47b567d3b3342d2eb3f75c1f..919c3a16700b842f4431efdda643fd690f41c89e 100644 (file)
@@ -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++) {
index 88d0724e2238fb70582bf7a6d76e681078cfc565..89dd29210f9d5d85c326c345885e589b460602c2 100644 (file)
@@ -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) {