X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=exynos4%2Flibcodec%2Fvideo%2Fv4l2%2Fenc%2FExynosVideoEncoder.c;h=925b9b33f695823dcd473195d000b3d0ccc83c8d;hb=refs%2Ftags%2Fsubmit%2Ftizen_5.5%2F20191031.000009;hp=8a1232095605388daf95e3429c0e477a7e0d98e4;hpb=d13508130aeb99537fcd12782785db753efd1b7f;p=platform%2Fadaptation%2Fap_samsung%2Flibomxil-e3250-v4l2.git diff --git a/exynos4/libcodec/video/v4l2/enc/ExynosVideoEncoder.c b/exynos4/libcodec/video/v4l2/enc/ExynosVideoEncoder.c index 8a12320..925b9b3 100755 --- a/exynos4/libcodec/video/v4l2/enc/ExynosVideoEncoder.c +++ b/exynos4/libcodec/video/v4l2/enc/ExynosVideoEncoder.c @@ -43,13 +43,11 @@ #include "ExynosVideoApi.h" #include "ExynosVideoEnc.h" -//#include - /* #define LOG_NDEBUG 0 */ #define LOG_TAG "ExynosVideoEncoder" -#ifndef SLP_PLATFORM /* build env */ +#ifndef TIZEN_FEATURE_E3250 /* build env */ #include -#else +#else #include "Exynos_OSAL_Log.h" #endif @@ -136,7 +134,6 @@ static unsigned int __ColorFormatType_To_V4L2PixelFormat(ExynosVideoColorFormatT static void *MFC_Encoder_Init(int nMemoryType) { ExynosVideoEncContext *pCtx = NULL; - pthread_mutex_t *pMutex = NULL; int needCaps = (V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING); pCtx = (ExynosVideoEncContext *)malloc(sizeof(*pCtx)); @@ -163,27 +160,23 @@ static void *MFC_Encoder_Init(int nMemoryType) pCtx->nMemoryType = nMemoryType; - pMutex = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t)); - if (pMutex == NULL) { + pCtx->pInMutex = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t)); + if (pCtx->pInMutex == NULL) { ALOGE("%s: Failed to allocate mutex about input buffer", __func__); goto EXIT_QUERYCAP_FAIL; } - if (pthread_mutex_init(pMutex, NULL) != 0) { - free(pMutex); + if (pthread_mutex_init(pCtx->pInMutex, NULL) != 0) { goto EXIT_QUERYCAP_FAIL; } - pCtx->pInMutex = (void*)pMutex; - pMutex = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t)); - if (pMutex == NULL) { + pCtx->pOutMutex = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t)); + if (pCtx->pOutMutex == NULL) { ALOGE("%s: Failed to allocate mutex about output buffer", __func__); goto EXIT_QUERYCAP_FAIL; } - if (pthread_mutex_init(pMutex, NULL) != 0) { - free(pMutex); + if (pthread_mutex_init(pCtx->pOutMutex, NULL) != 0) { goto EXIT_QUERYCAP_FAIL; } - pCtx->pOutMutex = (void*)pMutex; return (void *)pCtx; @@ -703,7 +696,6 @@ EXIT: static int MFC_Encoder_Get_FrameTag(void *pHandle) { ExynosVideoEncContext *pCtx = (ExynosVideoEncContext *)pHandle; - ExynosVideoErrorType ret = VIDEO_ERROR_NONE; int frameTag = -1; @@ -714,7 +706,6 @@ static int MFC_Encoder_Get_FrameTag(void *pHandle) #ifdef V4L2_CID_MPEG_MFC51_VIDEO_FRAME_TAG if (exynos_v4l2_g_ctrl(pCtx->hEnc, V4L2_CID_MPEG_MFC51_VIDEO_FRAME_TAG, &frameTag) != 0) { ALOGE("%s: Failed to g_ctrl", __func__); - ret = VIDEO_ERROR_APIFAIL; goto EXIT; } #endif @@ -1558,6 +1549,7 @@ EXIT: return ret; } +#if 0 /* * [Encoder Buffer OPS] Wait (Src) */ @@ -1644,6 +1636,7 @@ static ExynosVideoErrorType MFC_Encoder_Wait_Outbuf(void *pHandle) EXIT: return ret; } +#endif static ExynosVideoErrorType MFC_Encoder_Register_Inbuf( void *pHandle, @@ -1882,7 +1875,7 @@ static ExynosVideoErrorType MFC_Encoder_Enqueue_Inbuf( buf.m.planes[i].m.userptr = (unsigned long)pBuffer[i]; buf.m.planes[i].length = pCtx->pInbuf[index].planes[i].allocSize; /* V4L2_MEMORY_DMABUF */ -#ifdef SLP_PLATFORM /* #ifdef USE_DMA_BUF */ +#ifdef TIZEN_FEATURE_E3250 /* #ifdef USE_DMA_BUF */ buf.m.planes[i].m.fd = pCtx->pInbuf[buf.index].planes[i].fd; buf.m.planes[i].length = 0; /* kernel give the length */ #endif @@ -1988,6 +1981,7 @@ EXIT: return ret; } +#if 0 /* * [Encoder Buffer OPS] Enqueue All (Output) */ @@ -2016,6 +2010,7 @@ static ExynosVideoErrorType MFC_Encoder_Enqueue_All_Outbuf(void *pHandle) EXIT: return ret; } +#endif /* * [Encoder Buffer OPS] Dequeue (Input) @@ -2068,7 +2063,6 @@ static ExynosVideoBuffer *MFC_Encoder_Dequeue_Outbuf(void *pHandle) struct v4l2_buffer buf; struct v4l2_plane planes[VIDEO_ENCODER_OUTBUF_PLANES]; - int value; if (pCtx == NULL) { ALOGE("%s: Video context info must be supplied", __func__);