exynos_omx: multi_thread: Add argument for selection of memory type in initial time.
authorSeungBeom Kim <sbcrux.kim@samsung.com>
Thu, 5 Jul 2012 05:59:40 +0000 (14:59 +0900)
committerJames Dong <jdong@google.com>
Sat, 21 Jul 2012 01:57:17 +0000 (18:57 -0700)
void *MFC_Decoder_Init(void) to void *MFC_Decoder_Init(int nMemoryType)
void *MFC_Encoder_Init(void) to void *MFC_Encoder_Init(int nMemoryType)

Change-Id: I0e663bcf8ac111b205ac13f86fe614572ef92ee4
Signed-off-by: SeungBeom Kim <sbcrux.kim@samsung.com>
12 files changed:
exynos_omx/codecs/exynos_codecs/video/exynos5/mfc_v4l2/dec/src/ExynosVideoDecoder.c
exynos_omx/codecs/exynos_codecs/video/exynos5/mfc_v4l2/enc/src/ExynosVideoEncoder.c
exynos_omx/codecs/exynos_codecs/video/exynos5/mfc_v4l2/include/ExynosVideoApi.h
exynos_omx/openmax/exynos_omx/component/video/dec/Android.mk
exynos_omx/openmax/exynos_omx/component/video/dec/h264/Exynos_OMX_H264dec.c
exynos_omx/openmax/exynos_omx/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c
exynos_omx/openmax/exynos_omx/component/video/dec/vp8/Exynos_OMX_Vp8dec.c
exynos_omx/openmax/exynos_omx/component/video/enc/Android.mk
exynos_omx/openmax/exynos_omx/component/video/enc/h264/Android.mk
exynos_omx/openmax/exynos_omx/component/video/enc/h264/Exynos_OMX_H264enc.c
exynos_omx/openmax/exynos_omx/component/video/enc/mpeg4/Android.mk
exynos_omx/openmax/exynos_omx/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c

index c48e43dcca0955aed5d76ae0194ac358a6f4356b..2e8a758c4d6fd7008ba4e670cdd58478c6632d60 100644 (file)
@@ -40,7 +40,6 @@
 
 #include "ExynosVideoApi.h"
 #include "ExynosVideoDec.h"
-#include "exynos_v4l2.h"
 
 /* #define LOG_NDEBUG 0 */
 #define LOG_TAG "ExynosVideoDecoder"
@@ -109,7 +108,7 @@ static unsigned int __ColorFormatType_To_V4L2PixelFormat(ExynosVideoColorFormatT
 /*
  * [Decoder OPS] Init
  */
-static void *MFC_Decoder_Init(void)
+static void *MFC_Decoder_Init(int nMemoryType)
 {
     ExynosVideoDecContext *pCtx     = NULL;
     pthread_mutex_t       *pMutex   = NULL;
@@ -137,7 +136,7 @@ static void *MFC_Decoder_Init(void)
     pCtx->bStreamonInbuf = VIDEO_FALSE;
     pCtx->bStreamonOutbuf = VIDEO_FALSE;
 
-    pCtx->nMemoryType = V4L2_MEMORY_DMABUF;
+    pCtx->nMemoryType = nMemoryType;
 
     pMutex = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t));
     if (pMutex == NULL) {
index dce0963e86d52cc4e627064c81e41f6865af9431..fc127dcade2597ebf65cf3cc280ad2273a938a53 100644 (file)
@@ -41,7 +41,6 @@
 
 #include "ExynosVideoApi.h"
 #include "ExynosVideoEnc.h"
-#include "exynos_v4l2.h"
 
 /* #define LOG_NDEBUG 0 */
 #define LOG_TAG "ExynosVideoEncoder"
@@ -115,7 +114,7 @@ static unsigned int __ColorFormatType_To_V4L2PixelFormat(ExynosVideoColorFormatT
 /*
  * [Encoder OPS] Init
  */
-static void *MFC_Encoder_Init(void)
+static void *MFC_Encoder_Init(int nMemoryType)
 {
     ExynosVideoEncContext *pCtx     = NULL;
     pthread_mutex_t       *pMutex   = NULL;
@@ -143,7 +142,7 @@ static void *MFC_Encoder_Init(void)
     pCtx->bStreamonInbuf = VIDEO_FALSE;
     pCtx->bStreamonOutbuf = VIDEO_FALSE;
 
-    pCtx->nMemoryType = V4L2_MEMORY_DMABUF;
+    pCtx->nMemoryType = nMemoryType;
 
     pMutex = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t));
     if (pMutex == NULL) {
index c0c50a8e53a1016b338c3fd9e7c7af3acf840aca..b7b643a1041a6a3c1e213aa86e42f09a11dca473 100644 (file)
@@ -18,6 +18,8 @@
 #ifndef _EXYNOS_VIDEO_API_H_
 #define _EXYNOS_VIDEO_API_H_
 
+#include "exynos_v4l2.h"
+
 /* Fixed */
 #define VIDEO_BUFFER_MAX_PLANES 3
 
@@ -216,7 +218,7 @@ typedef struct _ExynosVideoEncParam {
 typedef struct _ExynosVideoDecOps {
     unsigned int            nSize;
 
-    void *                (*Init)(void);
+    void *                (*Init)(int nMemoryType);
     ExynosVideoErrorType  (*Finalize)(void *pHandle);
 
     /* Add new ops at the end of structure, no order change */
@@ -233,7 +235,7 @@ typedef struct _ExynosVideoDecOps {
 
 typedef struct _ExynosVideoEncOps {
     unsigned int           nSize;
-    void *               (*Init)(void);
+    void *               (*Init)(int nMemoryType);
     ExynosVideoErrorType (*Finalize)(void *pHandle);
 
     /* Add new ops at the end of structure, no order change */
index f5ad7df07a3cf89ce474227c97d0b880cc43a9ac..0d79ec46e47c918ff6ec7d7d86948cbdab56906f 100644 (file)
@@ -15,6 +15,7 @@ LOCAL_C_INCLUDES := $(EXYNOS_OMX_INC)/khronos \
        $(EXYNOS_OMX_TOP)/core \
        $(EXYNOS_OMX_COMPONENT)/common \
        $(EXYNOS_OMX_COMPONENT)/video/dec \
+       hardware/samsung_slsi/exynos5/include \
        hardware/samsung_slsi/exynos5/libcsc \
        hardware/samsung_slsi/exynos5/exynos_omx/codecs/exynos_codecs/video/exynos5/mfc_v4l2/include
 
index 1ff738fd19b76522ba3bce97e0e22551f0af9422..afc9e9d32231acbfe2b5dfd0338e8d5323304e21 100644 (file)
@@ -307,7 +307,7 @@ OMX_ERRORTYPE H264CodecOpen(EXYNOS_H264DEC_HANDLE *pH264Dec)
     }
 
     /* alloc context, open, querycap */
-    pH264Dec->hMFCH264Handle.hMFCHandle = pH264Dec->hMFCH264Handle.pDecOps->Init();
+    pH264Dec->hMFCH264Handle.hMFCHandle = pH264Dec->hMFCH264Handle.pDecOps->Init(V4L2_MEMORY_DMABUF);
     if (pH264Dec->hMFCH264Handle.hMFCHandle == NULL) {
         Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to allocate context buffer");
         ret = OMX_ErrorInsufficientResources;
index d626c4669796c0ed4ccded7803f0b25e9292bdd3..7d3fb32d6fa89a6f66bf5f820b97ff84389275bf 100644 (file)
@@ -411,7 +411,7 @@ OMX_ERRORTYPE Mpeg4CodecOpen(EXYNOS_MPEG4DEC_HANDLE *pMpeg4Dec)
     }
 
     /* alloc context, open, querycap */
-    pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.pDecOps->Init();
+    pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.pDecOps->Init(V4L2_MEMORY_DMABUF);
     if (pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle == NULL) {
         Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to allocate context buffer");
         ret = OMX_ErrorInsufficientResources;
index 2c915e6115faed0829376e27084cc423f17c1e09..3f89314907f4e73f1fd9f71ce1166aba29c91bcc 100644 (file)
@@ -226,7 +226,7 @@ OMX_ERRORTYPE VP8CodecOpen(EXYNOS_VP8DEC_HANDLE *pVp8Dec)
     }
 
     /* alloc context, open, querycap */
-    pVp8Dec->hMFCVp8Handle.hMFCHandle = pVp8Dec->hMFCVp8Handle.pDecOps->Init();
+    pVp8Dec->hMFCVp8Handle.hMFCHandle = pVp8Dec->hMFCVp8Handle.pDecOps->Init(V4L2_MEMORY_DMABUF);
     if (pVp8Dec->hMFCVp8Handle.hMFCHandle == NULL) {
         Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to allocate context buffer");
         ret = OMX_ErrorInsufficientResources;
index 2ec0386507ebc5bfed99adb144bb5da6e7df55c7..7c1c43661db1c57cfda60cb7718bb1ed5aa4d206 100644 (file)
@@ -15,6 +15,7 @@ LOCAL_C_INCLUDES := $(EXYNOS_OMX_INC)/khronos \
        $(EXYNOS_OMX_TOP)/core \
        $(EXYNOS_OMX_COMPONENT)/common \
        $(EXYNOS_OMX_COMPONENT)/video/enc \
+       hardware/samsung_slsi/exynos5/include \
        hardware/samsung_slsi/exynos5/libcsc \
        hardware/samsung_slsi/exynos5/exynos_omx/codecs/exynos_codecs/video/exynos5/mfc_v4l2/include
 
index e8888ae8e98737b802a75ea40630c39dc61b5111..9a9174e07d5a315c2d342da5e5f3e1ccc56a8d8e 100644 (file)
@@ -31,6 +31,7 @@ LOCAL_C_INCLUDES := $(EXYNOS_OMX_INC)/khronos \
        $(EXYNOS_OMX_TOP)/core \
        $(EXYNOS_OMX_COMPONENT)/common \
        $(EXYNOS_OMX_COMPONENT)/video/enc \
+       hardware/samsung_slsi/exynos5/include \
        hardware/samsung_slsi/exynos5/libcsc \
        hardware/samsung_slsi/exynos5/exynos_omx/codecs/exynos_codecs/video/exynos5/mfc_v4l2/include
 
index 9d0c198b5e56339ab50c40ddf7b7d10ca054c993..62f26792371da2c47d1ade377a5f44011616d5ca 100644 (file)
@@ -459,7 +459,7 @@ OMX_ERRORTYPE H264CodecOpen(EXYNOS_H264ENC_HANDLE *pH264Enc)
     }
 
     /* alloc context, open, querycap */
-    pH264Enc->hMFCH264Handle.hMFCHandle = pH264Enc->hMFCH264Handle.pEncOps->Init();
+    pH264Enc->hMFCH264Handle.hMFCHandle = pH264Enc->hMFCH264Handle.pEncOps->Init(V4L2_MEMORY_DMABUF);
     if (pH264Enc->hMFCH264Handle.hMFCHandle == NULL) {
         Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to allocate context buffer");
         ret = OMX_ErrorInsufficientResources;
index fe702889cb227d800cc8e59782e9225bfe05f33c..dbd44f56d6508a3746108393431caae3fed41fa2 100644 (file)
@@ -30,7 +30,8 @@ LOCAL_C_INCLUDES := $(EXYNOS_OMX_INC)/khronos \
        $(EXYNOS_OMX_TOP)/core \
        $(EXYNOS_OMX_COMPONENT)/common \
        $(EXYNOS_OMX_COMPONENT)/video/enc \
-       hardware/samsung_slsi/exynos5/exynos_omx/codecs/exynos_codecs/video/exynos5/mfc_v4l2/include \
-       hardware/samsung_slsi/exynos5/libcsc
+       hardware/samsung_slsi/exynos5/include \
+       hardware/samsung_slsi/exynos5/libcsc \
+       hardware/samsung_slsi/exynos5/exynos_omx/codecs/exynos_codecs/video/exynos5/mfc_v4l2/include
 
 include $(BUILD_SHARED_LIBRARY)
index f9ddc43cc2d4269771b4c7c8794c8c2fb2db1f15..53f91d611e6481c5528497aca4bf5fcf1366010e 100644 (file)
@@ -575,7 +575,7 @@ OMX_ERRORTYPE Mpeg4CodecOpen(EXYNOS_MPEG4ENC_HANDLE *pMpeg4Enc)
     }
 
     /* alloc context, open, querycap */
-    pMpeg4Enc->hMFCMpeg4Handle.hMFCHandle = pMpeg4Enc->hMFCMpeg4Handle.pEncOps->Init();
+    pMpeg4Enc->hMFCMpeg4Handle.hMFCHandle = pMpeg4Enc->hMFCMpeg4Handle.pEncOps->Init(V4L2_MEMORY_DMABUF);
     if (pMpeg4Enc->hMFCMpeg4Handle.hMFCHandle == NULL) {
         Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to allocate context buffer");
         ret = OMX_ErrorInsufficientResources;