From d50233137ba7a7d71738f51842addfb86403eab1 Mon Sep 17 00:00:00 2001 From: Sejun Park Date: Wed, 20 Apr 2016 14:52:41 +0900 Subject: [PATCH 01/16] Fixed issue when decoding mpeg4 Change-Id: I83324ce4cc2968c45d72a2b2461334349ea33111 --- openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c b/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c index 23b4c4f..a6bda69 100755 --- a/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c +++ b/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c @@ -2482,6 +2482,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OM for (plane = 0; plane < MFC_OUTPUT_BUFFER_PLANE; plane++) { pDstOutputData->buffer.multiPlaneBuffer.dataBuffer[plane] = pVideoBuffer->planes[plane].addr; pDstOutputData->buffer.multiPlaneBuffer.fd[plane] = pVideoBuffer->planes[plane].fd; + pDstOutputData->buffer.multiPlaneBuffer.tbm_bo[plane] = pVideoBuffer->planes[plane].tbm_bo; pDstOutputData->allocSize += pVideoBuffer->planes[plane].allocSize; pDstOutputData->dataLen += pVideoBuffer->planes[plane].dataSize; } -- 2.7.4 From aebc0e89e3990890d8c1d7a24d31a2184ceec75e Mon Sep 17 00:00:00 2001 From: Sejun Park Date: Tue, 28 Jun 2016 16:29:11 +0900 Subject: [PATCH 02/16] Apply DEP to libswconverter Change-Id: Id3f2b6dca1c7376f9636507f6cd0acd38c660c27 --- packaging/libomxil-e3250-v4l2.spec | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packaging/libomxil-e3250-v4l2.spec b/packaging/libomxil-e3250-v4l2.spec index b7cfa8a..f801c16 100755 --- a/packaging/libomxil-e3250-v4l2.spec +++ b/packaging/libomxil-e3250-v4l2.spec @@ -1,7 +1,7 @@ Name: libomxil-e3250-v4l2 Summary: OpenMAX IL for e3250-v4l2 -Version: 0.1.0 -License: TO BE FILLED IN +Version: 0.1.1 +License: Apache-2.0 Group: Development/Libraries Release: 0 ExclusiveArch: %arm @@ -42,6 +42,8 @@ export CFLAGS+="\ -DUSE_H264_PREPEND_SPS_PPS\ -DGST_EXT_TIME_ANALYSIS" +export LDFLAGS+="-Wl,--rpath=%{_prefix} -Wl,--as-needed,-z,noexecstack" + %ifnarch aarch64 %configure --prefix=%{_prefix} --disable-static --enable-dlog --enable-exynos3250 --enable-neon %else @@ -54,8 +56,8 @@ make %install rm -rf %{buildroot} -#mkdir -p %{buildroot}/usr/share/license -#cp COPYING %{buildroot}/usr/share/license/%{name} +mkdir -p %{buildroot}/usr/share/license +cp COPYING %{buildroot}/usr/share/license/%{name} %make_install @@ -68,6 +70,7 @@ rm -rf %{buildroot} %manifest libomxil-e3250-v4l2.manifest %{_libdir}/*.so* %{_libdir}/omx/*.so +%{_datadir}/license/%{name} %files devel -- 2.7.4 From fc05637baf4b8e0b572bc7a2cf06cf5d06ac1202 Mon Sep 17 00:00:00 2001 From: Sejun Park Date: Tue, 5 Jul 2016 10:38:21 +0900 Subject: [PATCH 03/16] Changed output format from NV12T to NV12 Change-Id: I21efa289485e2d55f57fed248d6fd5d665162e7d --- openmax/component/video/dec/Exynos_OMX_VdecControl.c | 2 +- openmax/component/video/dec/h264/Exynos_OMX_H264dec.c | 11 ++++++----- openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c | 11 ++++++----- packaging/libomxil-e3250-v4l2.spec | 2 +- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/openmax/component/video/dec/Exynos_OMX_VdecControl.c b/openmax/component/video/dec/Exynos_OMX_VdecControl.c index e236148..2cbb0bc 100755 --- a/openmax/component/video/dec/Exynos_OMX_VdecControl.c +++ b/openmax/component/video/dec/Exynos_OMX_VdecControl.c @@ -1197,7 +1197,7 @@ OMX_ERRORTYPE Exynos_OMX_VideoDecodeGetParameter( break; case supportFormat_2: portFormat->eCompressionFormat = OMX_VIDEO_CodingUnused; - portFormat->eColorFormat = OMX_SEC_COLOR_FormatNV12Tiled; + portFormat->eColorFormat = OMX_SEC_COLOR_FormatNV12L_DmaBuf_Fd; portFormat->xFramerate = portDefinition->format.video.xFramerate; break; #ifdef SLP_PLATFORM diff --git a/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c b/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c index 45f49cf..e3992bb 100755 --- a/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c +++ b/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c @@ -1028,7 +1028,7 @@ OMX_ERRORTYPE H264CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DAT /* set output geometry */ Exynos_OSAL_Memset(&bufferConf, 0, sizeof(bufferConf)); - pH264Dec->hMFCH264Handle.MFCOutputColorType = bufferConf.eColorFormat = VIDEO_COLORFORMAT_NV12_TILED; + pH264Dec->hMFCH264Handle.MFCOutputColorType = bufferConf.eColorFormat = VIDEO_COLORFORMAT_NV12; if (pOutbufOps->Set_Geometry(hMFCHandle, &bufferConf) != VIDEO_ERROR_NONE) { Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to set geometry for output buffer"); ret = OMX_ErrorInsufficientResources; @@ -1617,7 +1617,8 @@ OMX_ERRORTYPE Exynos_H264Dec_SetParameter( case OMX_COLOR_FormatYUV420SemiPlanar: pExynosOutputPort->portDefinition.nBufferSize = (width * height * 3) / 2; break; -#ifdef SLP_PLATFORM /* NV12T fd */ +#ifdef SLP_PLATFORM /* NV12 fd */ + case OMX_SEC_COLOR_FormatNV12L_DmaBuf_Fd: case OMX_SEC_COLOR_FormatNV12T_DmaBuf_Fd: pExynosOutputPort->portDefinition.nBufferSize = sizeof(MMVideoBuffer); break; @@ -2400,8 +2401,8 @@ OMX_ERRORTYPE Exynos_H264Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX pBufferInfo->imageHeight = bufferGeometry->nFrameHeight; switch (bufferGeometry->eColorFormat) { case VIDEO_COLORFORMAT_NV12: -#ifdef SLP_PLATFORM /* NV12T fd */ - pBufferInfo->ColorFormat = OMX_SEC_COLOR_FormatNV12T_DmaBuf_Fd; +#ifdef SLP_PLATFORM /* NV12 fd */ + pBufferInfo->ColorFormat = OMX_SEC_COLOR_FormatNV12L_DmaBuf_Fd; #else pBufferInfo->ColorFormat = OMX_COLOR_FormatYUV420SemiPlanar; #endif @@ -2740,7 +2741,7 @@ OSCL_EXPORT_REF OMX_ERRORTYPE Exynos_OMX_ComponentInit(OMX_HANDLETYPE hComponent pExynosPort->portDefinition.format.video.pNativeRender = 0; pExynosPort->portDefinition.format.video.bFlagErrorConcealment = OMX_FALSE; #ifdef SLP_PLATFORM - pExynosPort->portDefinition.format.video.eColorFormat = OMX_SEC_COLOR_FormatNV12T_DmaBuf_Fd; + pExynosPort->portDefinition.format.video.eColorFormat = OMX_SEC_COLOR_FormatNV12L_DmaBuf_Fd; #else pExynosPort->portDefinition.format.video.eColorFormat = OMX_COLOR_FormatYUV420Planar; #endif diff --git a/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c b/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c index a6bda69..2afae9c 100755 --- a/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c +++ b/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c @@ -1127,7 +1127,7 @@ OMX_ERRORTYPE Mpeg4CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DA /* set output geometry */ Exynos_OSAL_Memset(&bufferConf, 0, sizeof(bufferConf)); - pMpeg4Dec->hMFCMpeg4Handle.MFCOutputColorType = bufferConf.eColorFormat = VIDEO_COLORFORMAT_NV12_TILED; + pMpeg4Dec->hMFCMpeg4Handle.MFCOutputColorType = bufferConf.eColorFormat = VIDEO_COLORFORMAT_NV12; if (pOutbufOps->Set_Geometry(hMFCHandle, &bufferConf) != VIDEO_ERROR_NONE) { Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to set geometry for output buffer"); ret = OMX_ErrorInsufficientResources; @@ -1752,8 +1752,9 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_SetParameter( case OMX_COLOR_FormatYUV420SemiPlanar: pExynosOutputPort->portDefinition.nBufferSize = (width * height * 3) / 2; break; -#ifdef SLP_PLATFORM /* NV12T fd */ +#ifdef SLP_PLATFORM /* NV12 fd */ case OMX_SEC_COLOR_FormatNV12T_DmaBuf_Fd: + case OMX_SEC_COLOR_FormatNV12L_DmaBuf_Fd: pExynosOutputPort->portDefinition.nBufferSize = sizeof(MMVideoBuffer); break; #endif @@ -2497,8 +2498,8 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OM pBufferInfo->imageHeight = bufferGeometry->nFrameHeight; switch (bufferGeometry->eColorFormat) { case VIDEO_COLORFORMAT_NV12: -#ifdef SLP_PLATFORM /* NV12T fd */ - pBufferInfo->ColorFormat = OMX_SEC_COLOR_FormatNV12T_DmaBuf_Fd; +#ifdef SLP_PLATFORM /* NV12 fd */ + pBufferInfo->ColorFormat = OMX_SEC_COLOR_FormatNV12L_DmaBuf_Fd; #else pBufferInfo->ColorFormat = OMX_COLOR_FormatYUV420SemiPlanar; #endif @@ -2831,7 +2832,7 @@ OSCL_EXPORT_REF OMX_ERRORTYPE Exynos_OMX_ComponentInit(OMX_HANDLETYPE hComponent pExynosPort->portDefinition.format.video.pNativeRender = 0; pExynosPort->portDefinition.format.video.bFlagErrorConcealment = OMX_FALSE; #ifdef SLP_PLATFORM - pExynosPort->portDefinition.format.video.eColorFormat = OMX_SEC_COLOR_FormatNV12T_DmaBuf_Fd; + pExynosPort->portDefinition.format.video.eColorFormat = OMX_SEC_COLOR_FormatNV12L_DmaBuf_Fd; pExynosPort->bufferProcessType = BUFFER_SHARE; #else pExynosPort->portDefinition.format.video.eColorFormat = OMX_COLOR_FormatYUV420Planar; diff --git a/packaging/libomxil-e3250-v4l2.spec b/packaging/libomxil-e3250-v4l2.spec index f801c16..1928b77 100755 --- a/packaging/libomxil-e3250-v4l2.spec +++ b/packaging/libomxil-e3250-v4l2.spec @@ -1,6 +1,6 @@ Name: libomxil-e3250-v4l2 Summary: OpenMAX IL for e3250-v4l2 -Version: 0.1.1 +Version: 0.1.2 License: Apache-2.0 Group: Development/Libraries Release: 0 -- 2.7.4 From bec6a659a2330e5424f773a968d841d17d3623c4 Mon Sep 17 00:00:00 2001 From: MyungJoo Ham Date: Thu, 2 Mar 2017 14:36:48 +0900 Subject: [PATCH 04/16] Force to use Exynos3250 kernel header, not sc7730 In Tizen:Unified, you must choose explictly if it is adaptation package (device drivers). Change-Id: I691e78269208a6df505f288680131566e8a251d9 Signed-off-by: MyungJoo Ham --- packaging/libomxil-e3250-v4l2.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/libomxil-e3250-v4l2.spec b/packaging/libomxil-e3250-v4l2.spec index 1928b77..5f62e2c 100755 --- a/packaging/libomxil-e3250-v4l2.spec +++ b/packaging/libomxil-e3250-v4l2.spec @@ -10,7 +10,7 @@ Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig #!BuildIgnore: kernel-headers BuildConflicts: linux-glibc-devel -BuildRequires: kernel-headers-tizen-dev +BuildRequires: kernel-headers-3.4-exynos3250 BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(mm-common) -- 2.7.4 From 96df7d66f7383529553660733633b9d3e46cd1ff Mon Sep 17 00:00:00 2001 From: Sejun Park Date: Wed, 8 Mar 2017 13:16:44 +0900 Subject: [PATCH 05/16] for callback invoke when resolution is changed Change-Id: I2733a299a0fed27c2339c974a2c123ed1a2dce5f --- config.guess | 0 config.sub | 0 configure.ac | 2 +- exynos/include/exynos_v4l2.h | 8 +-- exynos/libcsc/csc.c | 6 +- exynos/libcsc/csc_helper.c | 6 +- exynos/libv4l2/exynos_mc.c | 4 +- exynos/libv4l2/exynos_subdev.c | 4 +- exynos/libv4l2/exynos_v4l2.c | 6 +- exynos4/libcodec/audio/alp/dec/srp_api.c | 6 +- exynos4/libcodec/audio/alp/include/srp_api.h | 2 +- exynos4/libcodec/audio/alp/include/srp_error.h | 2 +- .../libcodec/video/v4l2/dec/ExynosVideoDecoder.c | 4 +- .../libcodec/video/v4l2/enc/ExynosVideoEncoder.c | 8 +-- exynos4/libion_exynos/libion.c | 2 +- libomxil-e3250-v4l2.manifest | 0 openmax/component/audio/dec/Exynos_OMX_Adec.c | 6 +- .../component/audio/dec/mp3/Exynos_OMX_Mp3dec.c | 10 +-- .../component/audio/dec/mp3/Exynos_OMX_Mp3dec.h | 2 +- .../component/common/Exynos_OMX_Basecomponent.c | 2 +- openmax/component/common/Exynos_OMX_Baseport.c | 10 +-- .../component/common/Exynos_OMX_Resourcemanager.c | 6 +- openmax/component/video/dec/Exynos_OMX_Vdec.c | 18 +++--- openmax/component/video/dec/Exynos_OMX_Vdec.h | 4 +- .../component/video/dec/Exynos_OMX_VdecControl.c | 26 ++++---- .../component/video/dec/Exynos_OMX_VdecControl.h | 2 +- openmax/component/video/dec/Makefile.am | 0 .../component/video/dec/h264/Exynos_OMX_H264dec.c | 44 +++++++------ openmax/component/video/dec/h264/Makefile.am | 1 - .../video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c | 12 ++-- .../video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c | 30 ++++----- .../component/video/dec/vc1/Exynos_OMX_Wmvdec.c | 39 ++++++------ .../component/video/dec/vc1/Exynos_OMX_Wmvdec.h | 4 +- openmax/component/video/dec/vc1/Makefile.am | 3 + openmax/component/video/enc/Exynos_OMX_Venc.c | 2 +- openmax/component/video/enc/Exynos_OMX_Venc.h | 2 +- .../component/video/enc/Exynos_OMX_VencControl.c | 10 +-- .../component/video/enc/h264/Exynos_OMX_H264enc.c | 24 +++---- .../video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c | 20 +++--- openmax/core/Exynos_OMX_Core.h | 2 +- openmax/include/exynos/Exynos_OMX_Def.h | 74 ++-------------------- openmax/osal/Exynos_OSAL_Log.c | 6 +- openmax/osal/Exynos_OSAL_Log.h | 12 ++-- openmax/osal/Exynos_OSAL_Memory.c | 4 +- openmax/osal/Exynos_OSAL_Platform_Specific.c | 16 ++--- openmax/osal/Exynos_OSAL_Platform_Specific.h | 4 +- openmax/osal/Exynos_OSAL_SharedMemory.c | 10 +-- packaging/libomxil-e3250-v4l2.spec | 2 +- srp.pc.in | 2 +- 49 files changed, 206 insertions(+), 263 deletions(-) mode change 100755 => 100644 config.guess mode change 100755 => 100644 config.sub mode change 100755 => 100644 configure.ac mode change 100755 => 100644 exynos/include/exynos_v4l2.h mode change 100755 => 100644 exynos/libcsc/csc.c mode change 100644 => 100755 exynos/libv4l2/exynos_subdev.c mode change 100644 => 100755 exynos4/libion_exynos/libion.c mode change 100755 => 100644 libomxil-e3250-v4l2.manifest mode change 100644 => 100755 openmax/component/audio/dec/mp3/Exynos_OMX_Mp3dec.c mode change 100644 => 100755 openmax/component/audio/dec/mp3/Exynos_OMX_Mp3dec.h mode change 100644 => 100755 openmax/component/common/Exynos_OMX_Resourcemanager.c mode change 100755 => 100644 openmax/component/video/dec/Exynos_OMX_Vdec.c mode change 100755 => 100644 openmax/component/video/dec/Exynos_OMX_Vdec.h mode change 100755 => 100644 openmax/component/video/dec/Exynos_OMX_VdecControl.c mode change 100755 => 100644 openmax/component/video/dec/Makefile.am mode change 100644 => 100755 openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c mode change 100644 => 100755 openmax/component/video/enc/Exynos_OMX_Venc.h mode change 100644 => 100755 openmax/component/video/enc/h264/Exynos_OMX_H264enc.c mode change 100644 => 100755 openmax/core/Exynos_OMX_Core.h mode change 100644 => 100755 openmax/osal/Exynos_OSAL_Log.c mode change 100644 => 100755 openmax/osal/Exynos_OSAL_Log.h mode change 100644 => 100755 openmax/osal/Exynos_OSAL_Memory.c mode change 100644 => 100755 openmax/osal/Exynos_OSAL_SharedMemory.c mode change 100755 => 100644 srp.pc.in diff --git a/config.guess b/config.guess old mode 100755 new mode 100644 diff --git a/config.sub b/config.sub old mode 100755 new mode 100644 diff --git a/configure.ac b/configure.ac old mode 100755 new mode 100644 index cc2ad52..94fe613 --- a/configure.ac +++ b/configure.ac @@ -76,7 +76,7 @@ AC_FUNC_MMAP AC_FUNC_REALLOC AC_CHECK_FUNCS([gettimeofday memmove memset munmap]) -AC_DEFINE([SLP_PLATFORM]) +AC_DEFINE([TIZEN_FEATURE_E3250]) AC_DEFINE([USE_IMMEDIATE_DISPLAY]) dnl use dlog ------------------------------------------------------------------ diff --git a/exynos/include/exynos_v4l2.h b/exynos/include/exynos_v4l2.h old mode 100755 new mode 100644 index 7df8cc9..036e832 --- a/exynos/include/exynos_v4l2.h +++ b/exynos/include/exynos_v4l2.h @@ -41,7 +41,7 @@ extern "C" { /* V4L2 */ #include -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 #include #include #else @@ -73,7 +73,7 @@ int exynos_v4l2_try_fmt(int fd, struct v4l2_format *fmt); int exynos_v4l2_reqbufs(int fd, struct v4l2_requestbuffers *req); /*! \ingroup exynos_v4l2 */ int exynos_v4l2_querybuf(int fd, struct v4l2_buffer *buf); -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 int exynos_v4l2_expbuf(int fd, int *buf_fd, __u32 mem_offset); #endif /*! \ingroup exynos_v4l2 */ @@ -104,7 +104,7 @@ int exynos_v4l2_g_ext_ctrl(int fd, struct v4l2_ext_controls *ctrl); int exynos_v4l2_s_ext_ctrl(int fd, struct v4l2_ext_controls *ctrl); /* V4L2_SUBDEV */ -#ifndef SLP_PLATFORM /* build env */ +#ifndef TIZEN_FEATURE_E3250 /* build env */ #include #else #include @@ -134,7 +134,7 @@ int exynos_subdev_s_frame_interval(int fd, struct v4l2_subdev_frame_interval *fr int exynos_subdev_enum_mbus_code(int fd, struct v4l2_subdev_mbus_code_enum *mbus_code_enum); /* MEDIA CONTORLLER */ -#ifndef SLP_PLATFORM /* build env */ +#ifndef TIZEN_FEATURE_E3250 /* build env */ #include #else #include diff --git a/exynos/libcsc/csc.c b/exynos/libcsc/csc.c old mode 100755 new mode 100644 index 7fe7afe..df7a09d --- a/exynos/libcsc/csc.c +++ b/exynos/libcsc/csc.c @@ -28,13 +28,13 @@ * 2012.1.11 : Create */ #define LOG_TAG "libcsc" -#ifndef SLP_PLATFORM /* build env */ +#ifndef TIZEN_FEATURE_E3250 /* build env */ #include #endif #include #include -#ifndef SLP_PLATFORM /* build env */ +#ifndef TIZEN_FEATURE_E3250 /* build env */ #include #include #else @@ -46,7 +46,7 @@ #include "exynos_format.h" #include "swconverter.h" -#ifdef SLP_PLATFORM /* build env */ +#ifdef TIZEN_FEATURE_E3250 /* build env */ #define EXYNOS_OMX #endif diff --git a/exynos/libcsc/csc_helper.c b/exynos/libcsc/csc_helper.c index 2a59c47..c333fa4 100644 --- a/exynos/libcsc/csc_helper.c +++ b/exynos/libcsc/csc_helper.c @@ -16,7 +16,7 @@ */ #define LOG_TAG "libcsc_helper" -#ifndef SLP_PLATFORM /* build env */ +#ifndef TIZEN_FEATURE_E3250 /* build env */ #include #include #endif @@ -31,7 +31,7 @@ OMX_COLOR_FORMATTYPE hal_2_omx_pixel_format( { OMX_COLOR_FORMATTYPE omx_format; switch (hal_format) { -#ifndef SLP_PLATFORM /* build env */ /* useless */ +#ifndef TIZEN_FEATURE_E3250 /* build env */ /* useless */ case HAL_PIXEL_FORMAT_YCbCr_422_I: omx_format = OMX_COLOR_FormatYCbYCr; break; @@ -65,7 +65,7 @@ unsigned int omx_2_hal_pixel_format( { unsigned int hal_format; switch (omx_format) { -#ifndef SLP_PLATFORM /* build env */ /* useless */ +#ifndef TIZEN_FEATURE_E3250 /* build env */ /* useless */ case OMX_COLOR_FormatYCbYCr: hal_format = HAL_PIXEL_FORMAT_YCbCr_422_I; break; diff --git a/exynos/libv4l2/exynos_mc.c b/exynos/libv4l2/exynos_mc.c index 4025b24..66ec719 100755 --- a/exynos/libv4l2/exynos_mc.c +++ b/exynos/libv4l2/exynos_mc.c @@ -37,7 +37,7 @@ #include #include #include -#ifndef SLP_PLATFORM /* build env */ +#ifndef TIZEN_FEATURE_E3250 /* build env */ #include #else #include @@ -49,7 +49,7 @@ //#define LOG_NDEBUG 0 #define LOG_TAG "libexynosv4l2-mc" -#ifndef SLP_PLATFORM /* build env */ +#ifndef TIZEN_FEATURE_E3250 /* build env */ #include #else #include "Exynos_OSAL_Log.h" diff --git a/exynos/libv4l2/exynos_subdev.c b/exynos/libv4l2/exynos_subdev.c old mode 100644 new mode 100755 index 5ac578d..6c1b099 --- a/exynos/libv4l2/exynos_subdev.c +++ b/exynos/libv4l2/exynos_subdev.c @@ -38,9 +38,9 @@ //#define LOG_NDEBUG 0 #define LOG_TAG "libexynosv4l2-subdev" -#ifndef SLP_PLATFORM /* build env */ +#ifndef TIZEN_FEATURE_E3250 /* build env */ #include -#else +#else #include "Exynos_OSAL_Log.h" #endif diff --git a/exynos/libv4l2/exynos_v4l2.c b/exynos/libv4l2/exynos_v4l2.c index 08b4f82..e050fba 100755 --- a/exynos/libv4l2/exynos_v4l2.c +++ b/exynos/libv4l2/exynos_v4l2.c @@ -40,9 +40,9 @@ //#define LOG_NDEBUG 0 #define LOG_TAG "libexynosv4l2" -#ifndef SLP_PLATFORM /* build env */ +#ifndef TIZEN_FEATURE_E3250 /* build env */ #include -#else +#else #include "Exynos_OSAL_Log.h" #endif @@ -428,7 +428,7 @@ int exynos_v4l2_querybuf(int fd, struct v4l2_buffer *buf) return ret; } -#ifdef SLP_PLATFORM /*dmabuf */ +#ifdef TIZEN_FEATURE_E3250 /*dmabuf */ #ifndef VIDIOC_EXPBUF struct v4l2_exportbuffer { diff --git a/exynos4/libcodec/audio/alp/dec/srp_api.c b/exynos4/libcodec/audio/alp/dec/srp_api.c index ab53022..0797b8a 100644 --- a/exynos4/libcodec/audio/alp/dec/srp_api.c +++ b/exynos4/libcodec/audio/alp/dec/srp_api.c @@ -41,7 +41,7 @@ #define LOG_NDEBUG 1 #define LOG_TAG "libsrpapi" -#ifndef SLP_PLATFORM /* build env */ +#ifndef TIZEN_FEATURE_E3250 /* build env */ #include #else #include "Exynos_OSAL_Log.h" @@ -113,8 +113,8 @@ int SRP_Decode(void *buff, int size_byte) ret = write(srp_dev, buff, size_byte); /* Write Buffer to RP Driver */ if (ret < 0) { -#ifdef SLP_PLATFORM -/* in slp, ret value is different from android. this is caused from glib. android uses bionic libc. */ +#ifdef TIZEN_FEATURE_E3250 +/* ret value is different from android. this is caused from glib. android uses bionic libc. */ ret = -(errno); #endif if (ret != SRP_ERROR_IBUF_OVERFLOW) diff --git a/exynos4/libcodec/audio/alp/include/srp_api.h b/exynos4/libcodec/audio/alp/include/srp_api.h index 0dcddae..3922135 100644 --- a/exynos4/libcodec/audio/alp/include/srp_api.h +++ b/exynos4/libcodec/audio/alp/include/srp_api.h @@ -30,7 +30,7 @@ #include "srp_ioctl.h" #include "srp_error.h" -#ifndef SLP_PLATFORM +#ifndef TIZEN_FEATURE_E3250 #define SRP_DEV_NAME "dev/srp" #else #define SRP_DEV_NAME "/dev/srp" diff --git a/exynos4/libcodec/audio/alp/include/srp_error.h b/exynos4/libcodec/audio/alp/include/srp_error.h index 0251ce8..dce8e14 100644 --- a/exynos4/libcodec/audio/alp/include/srp_error.h +++ b/exynos4/libcodec/audio/alp/include/srp_error.h @@ -36,7 +36,7 @@ typedef enum { SRP_ERROR_IBUF_OVERFLOW = -2000, SRP_ERROR_IBUF_INFO = -2001, -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 SRP_ERROR_IBUF_BUFFERING = -2002, #endif diff --git a/exynos4/libcodec/video/v4l2/dec/ExynosVideoDecoder.c b/exynos4/libcodec/video/v4l2/dec/ExynosVideoDecoder.c index 9d1e48c..31217df 100755 --- a/exynos4/libcodec/video/v4l2/dec/ExynosVideoDecoder.c +++ b/exynos4/libcodec/video/v4l2/dec/ExynosVideoDecoder.c @@ -44,7 +44,7 @@ /* #define LOG_NDEBUG 0 */ #define LOG_TAG "ExynosVideoDecoder" -#ifndef SLP_PLATFORM /* build env */ +#ifndef TIZEN_FEATURE_E3250 /* build env */ #include #else #include "Exynos_OSAL_Log.h" @@ -1067,7 +1067,7 @@ static ExynosVideoErrorType MFC_Decoder_Setup_Outbuf( pVideoPlane->allocSize = buf.m.planes[j].length; pVideoPlane->dataSize = 0; -#ifdef SLP_PLATFORM /* dmabuf */ +#ifdef TIZEN_FEATURE_E3250 /* dmabuf */ #if 0 if (pCtx->bufShareMethod == BUF_SHARE_FD) { exynos_v4l2_expbuf(pCtx->hDec, &pVideoPlane->fd, buf.m.planes[j].m.mem_offset); diff --git a/exynos4/libcodec/video/v4l2/enc/ExynosVideoEncoder.c b/exynos4/libcodec/video/v4l2/enc/ExynosVideoEncoder.c index 8a12320..a3b1a74 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 @@ -1882,7 +1880,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 diff --git a/exynos4/libion_exynos/libion.c b/exynos4/libion_exynos/libion.c old mode 100644 new mode 100755 index 799593d..1702078 --- a/exynos4/libion_exynos/libion.c +++ b/exynos4/libion_exynos/libion.c @@ -18,7 +18,7 @@ #include #include #include -#ifndef SLP_PLATFORM /* build env */ +#ifndef TIZEN_FEATURE_E3250 /* build env */ #include #endif diff --git a/libomxil-e3250-v4l2.manifest b/libomxil-e3250-v4l2.manifest old mode 100755 new mode 100644 diff --git a/openmax/component/audio/dec/Exynos_OMX_Adec.c b/openmax/component/audio/dec/Exynos_OMX_Adec.c index 4708b49..734d16a 100755 --- a/openmax/component/audio/dec/Exynos_OMX_Adec.c +++ b/openmax/component/audio/dec/Exynos_OMX_Adec.c @@ -462,7 +462,7 @@ OMX_ERRORTYPE Exynos_InputBufferGetQueue(EXYNOS_OMX_BASECOMPONENT *pExynosCompon Exynos_OSAL_Free(message); -#ifndef SLP_PLATFORM +#ifndef TIZEN_FEATURE_E3250 if (dataBuffer->allocSize <= dataBuffer->dataLen) Exynos_OSAL_Log(EXYNOS_LOG_WARNING, "Input Buffer Full, Check input buffer size! allocSize:%d, dataLen:%d", dataBuffer->allocSize, dataBuffer->dataLen); #endif @@ -874,7 +874,7 @@ OMX_ERRORTYPE Exynos_OMX_FlushPort(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 por OMX_S32 semValue = 0; FunctionIn(); -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 Exynos_OSAL_Log(EXYNOS_LOG_WARNING, "flushPort idx:%d", portIndex); #endif @@ -942,7 +942,7 @@ OMX_ERRORTYPE Exynos_OMX_BufferFlush(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 n OMX_U32 i = 0, cnt = 0; FunctionIn(); -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 Exynos_OSAL_Log(EXYNOS_LOG_WARNING, "bufferFlush idx:%d", nPortIndex); #endif diff --git a/openmax/component/audio/dec/mp3/Exynos_OMX_Mp3dec.c b/openmax/component/audio/dec/mp3/Exynos_OMX_Mp3dec.c old mode 100644 new mode 100755 index b31b748..56cc7d5 --- a/openmax/component/audio/dec/mp3/Exynos_OMX_Mp3dec.c +++ b/openmax/component/audio/dec/mp3/Exynos_OMX_Mp3dec.c @@ -448,7 +448,7 @@ OMX_ERRORTYPE Exynos_SRP_Mp3Dec_Init(OMX_COMPONENTTYPE *pOMXComponent) pExynosComponent->bSaveFlagEOS = OMX_FALSE; pMp3Dec->hSRPMp3Handle.bConfiguredSRP = OMX_FALSE; pMp3Dec->hSRPMp3Handle.bSRPSendEOS = OMX_FALSE; -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 pMp3Dec->nPendingflags = 0; #endif pExynosComponent->getAllDelayBuffer = OMX_FALSE; @@ -505,7 +505,7 @@ OMX_ERRORTYPE Exynos_SRP_Mp3_Decode_Block(OMX_COMPONENTTYPE *pOMXComponent, EXYN #endif /* Save timestamp and flags of input data */ -#ifndef SLP_PLATFORM +#ifndef TIZEN_FEATURE_E3250 pOutputData->timeStamp = pInputData->timeStamp; #else if (pExynosComponent->checkTimeStamp.startTimeStamp == pInputData->timeStamp) { @@ -602,7 +602,7 @@ OMX_ERRORTYPE Exynos_SRP_Mp3_Decode_Block(OMX_COMPONENTTYPE *pOMXComponent, EXYN if (dataLen > 0) { pOutputData->dataLen = dataLen; Exynos_OSAL_Memcpy(pOutputData->buffer.singlePlaneBuffer.dataBuffer, dataBuffer, dataLen); -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 pOutputData->timeStamp = pMp3Dec->timeStamp; pMp3Dec->timeStamp += 1000000 * (OMX_TICKS)dataLen / (pMp3Dec->pcmParam.nSamplingRate * pMp3Dec->pcmParam.nChannels * pMp3Dec->pcmParam.nBitPerSample / 8); pOutputData->nFlags |= pMp3Dec->nPendingflags; @@ -610,7 +610,7 @@ OMX_ERRORTYPE Exynos_SRP_Mp3_Decode_Block(OMX_COMPONENTTYPE *pOMXComponent, EXYN #endif } else { pOutputData->dataLen = 0; -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 pMp3Dec->nPendingflags = pOutputData->nFlags; #endif } @@ -629,7 +629,7 @@ OMX_ERRORTYPE Exynos_SRP_Mp3_Decode_Block(OMX_COMPONENTTYPE *pOMXComponent, EXYN if (isSRPStopped == 1) { pOutputData->nFlags |= OMX_BUFFERFLAG_EOS; pExynosComponent->getAllDelayBuffer = OMX_FALSE; -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 pOutputData->timeStamp = pInputData->timeStamp; /*For ALP EOS Timestamp*/ #endif pMp3Dec->hSRPMp3Handle.bSRPSendEOS = OMX_FALSE; /* for repeating one song */ diff --git a/openmax/component/audio/dec/mp3/Exynos_OMX_Mp3dec.h b/openmax/component/audio/dec/mp3/Exynos_OMX_Mp3dec.h old mode 100644 new mode 100755 index 95e5d3a..8f91066 --- a/openmax/component/audio/dec/mp3/Exynos_OMX_Mp3dec.h +++ b/openmax/component/audio/dec/mp3/Exynos_OMX_Mp3dec.h @@ -48,7 +48,7 @@ typedef struct _EXYNOS_MP3_HANDLE /* SEC SRP Codec specific */ EXYNOS_SRP_MP3_HANDLE hSRPMp3Handle; -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 OMX_TICKS timeStamp; OMX_U32 nPendingflags; #endif diff --git a/openmax/component/common/Exynos_OMX_Basecomponent.c b/openmax/component/common/Exynos_OMX_Basecomponent.c index 64390c4..b440efe 100755 --- a/openmax/component/common/Exynos_OMX_Basecomponent.c +++ b/openmax/component/common/Exynos_OMX_Basecomponent.c @@ -201,7 +201,7 @@ OMX_ERRORTYPE Exynos_OMX_ComponentStateSet(OMX_COMPONENTTYPE *pOMXComponent, OMX Exynos_OMX_Release_Resource(pOMXComponent); } -#ifndef SLP_PLATFORM +#ifndef TIZEN_FEATURE_E3250 Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "destState: %d", destState); #else Exynos_OSAL_Log(EXYNOS_LOG_WARNING, "destState: %d", destState); diff --git a/openmax/component/common/Exynos_OMX_Baseport.c b/openmax/component/common/Exynos_OMX_Baseport.c index c0f0af8..552fa4d 100755 --- a/openmax/component/common/Exynos_OMX_Baseport.c +++ b/openmax/component/common/Exynos_OMX_Baseport.c @@ -123,7 +123,7 @@ OMX_ERRORTYPE Exynos_OMX_BufferFlushProcess(OMX_COMPONENTTYPE *pOMXComponent, OM cnt = (nPortIndex == ALL_PORT_INDEX ) ? ALL_PORT_NUM : 1; -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 Exynos_OSAL_Log(EXYNOS_LOG_WARNING, "bufferFlushProcess cnt:%d port:%d", cnt, nPortIndex); #endif @@ -158,7 +158,7 @@ OMX_ERRORTYPE Exynos_OMX_EnablePort(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 po OMX_U32 i = 0, cnt = 0; FunctionIn(); -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 Exynos_OSAL_Log(EXYNOS_LOG_WARNING, "enablePort idx:%d", portIndex); #endif @@ -205,7 +205,7 @@ OMX_ERRORTYPE Exynos_OMX_PortEnableProcess(OMX_COMPONENTTYPE *pOMXComponent, OMX cnt = (nPortIndex == ALL_PORT_INDEX) ? ALL_PORT_NUM : 1; -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 Exynos_OSAL_Log(EXYNOS_LOG_WARNING, "portEnableProcess cnt:%d port:%d", cnt, nPortIndex); #endif @@ -246,7 +246,7 @@ OMX_ERRORTYPE Exynos_OMX_DisablePort(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 p EXYNOS_OMX_MESSAGE *message; FunctionIn(); -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 Exynos_OSAL_Log(EXYNOS_LOG_WARNING, "disablePort idx:%d", portIndex); #endif @@ -304,7 +304,7 @@ OMX_ERRORTYPE Exynos_OMX_PortDisableProcess(OMX_COMPONENTTYPE *pOMXComponent, OM cnt = (nPortIndex == ALL_PORT_INDEX ) ? ALL_PORT_NUM : 1; -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 Exynos_OSAL_Log(EXYNOS_LOG_WARNING, "portDisableProcess cnt:%d port:%d", cnt, nPortIndex); #endif diff --git a/openmax/component/common/Exynos_OMX_Resourcemanager.c b/openmax/component/common/Exynos_OMX_Resourcemanager.c old mode 100644 new mode 100755 index 6383566..7c3aa37 --- a/openmax/component/common/Exynos_OMX_Resourcemanager.c +++ b/openmax/component/common/Exynos_OMX_Resourcemanager.c @@ -38,9 +38,9 @@ #define EXYNOS_LOG_OFF #include "Exynos_OSAL_Log.h" -#ifdef SLP_PLATFORM -#define MAX_RESOURCE_VIDEO_DEC 8 /* for SLP */ -#define MAX_RESOURCE_VIDEO_ENC 2 /* for SLP */ +#ifdef TIZEN_FEATURE_E3250 +#define MAX_RESOURCE_VIDEO_DEC 8 /* for TIZEN */ +#define MAX_RESOURCE_VIDEO_ENC 2 /* for TIZEN */ #else #define MAX_RESOURCE_VIDEO_DEC 3 /* for Android */ #define MAX_RESOURCE_VIDEO_ENC 1 /* for Android */ diff --git a/openmax/component/video/dec/Exynos_OMX_Vdec.c b/openmax/component/video/dec/Exynos_OMX_Vdec.c old mode 100755 new mode 100644 index fc99f84..877c0e6 --- a/openmax/component/video/dec/Exynos_OMX_Vdec.c +++ b/openmax/component/video/dec/Exynos_OMX_Vdec.c @@ -110,7 +110,7 @@ inline void Exynos_UpdateFrameSize(OMX_COMPONENTTYPE *pOMXComponent) if (width && height) exynosOutputPort->portDefinition.nBufferSize = (width * height * 3) / 2; break; -#ifdef SLP_PLATFORM /* nv12t fd */ +#ifdef TIZEN_FEATURE_E3250 /* nv12t fd */ case OMX_SEC_COLOR_FormatNV12T_DmaBuf_Fd: if (width && height) exynosOutputPort->portDefinition.nBufferSize = sizeof(MMVideoBuffer); @@ -138,7 +138,7 @@ inline void Exynos_UpdateFrameSize(OMX_COMPONENTTYPE *pOMXComponent) OMX_BOOL Exynos_Check_BufferProcess_State(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, OMX_U32 nPortIndex) { OMX_BOOL ret = OMX_FALSE; -#ifdef SLP_PLATFORM /* check state */ +#ifdef TIZEN_FEATURE_E3250 /* check state */ if (pExynosComponent->currentState != OMX_StateExecuting) Exynos_OSAL_Log(EXYNOS_LOG_VERVOSE, "not OMX_StateExecuting"); @@ -251,7 +251,7 @@ OMX_BOOL Exynos_CSC_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA EXYNOS_OMX_DATABUFFER *outputUseBuffer = &exynosOutputPort->way.port2WayDataBuffer.outputDataBuffer; OMX_U32 copySize = 0; DECODE_CODEC_EXTRA_BUFFERINFO *pBufferInfo = NULL; -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 MMVideoBuffer *pSlpOutBuf = NULL; #endif @@ -276,7 +276,7 @@ OMX_BOOL Exynos_CSC_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA imageSize = width * height; colorFormat = pBufferInfo->ColorFormat; -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 pSlpOutBuf = (MMVideoBuffer *)pOutputBuf; pSlpOutBuf->width[0] = width; pSlpOutBuf->width[1] = width; @@ -405,7 +405,7 @@ OMX_BOOL Exynos_CSC_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA #ifdef USE_PB if (exynosOutputPort->bIsPBEnabled == OMX_TRUE) { -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 Exynos_OSAL_UnlockPB(pOutputBuf, dstOutputData, exynosOutputPort, exynosInputPort); #else Exynos_OSAL_UnlockPB(pOutputBuf, dstOutputData); @@ -444,7 +444,7 @@ OMX_BOOL Exynos_Preprocessor_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_ if (exynosInputPort->bufferProcessType & BUFFER_SHARE) { Exynos_Shared_BufferToData(inputUseBuffer, srcInputData, ONE_PLANE); -#ifndef SLP_PLATFORM +#ifndef TIZEN_FEATURE_E3250 if (pVideoDec->bDRMPlayerMode == OMX_TRUE) { OMX_PTR dataBuffer = NULL; @@ -541,7 +541,7 @@ OMX_BOOL Exynos_Postprocess_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_ outputUseBuffer->dataValid = OMX_TRUE; } else { #ifdef USE_PB -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 if (Exynos_Shared_DataToPlatformBuffer(dstOutputData, outputUseBuffer, exynosOutputPort,exynosInputPort) == OMX_ErrorNone) { #else if (Exynos_Shared_DataToPlatformBuffer(dstOutputData, outputUseBuffer, exynosOutputPort) == OMX_ErrorNone) { @@ -631,7 +631,7 @@ OMX_BOOL Exynos_Postprocess_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_ outputUseBuffer->timeStamp = dstOutputData->timeStamp; Exynos_OutputBufferReturn(pOMXComponent); } else { -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "output buffer is SCMN_IMGB type."); copySize = outputUseBuffer->allocSize - outputUseBuffer->dataLen; @@ -714,7 +714,7 @@ OMX_ERRORTYPE Exynos_OMX_SrcInputBufferProcess(OMX_HANDLETYPE hComponent) ret = Exynos_InputBufferGetQueue(pExynosComponent); inputUseBuffer = &(exynosInputPort->way.port2WayDataBuffer.inputDataBuffer); - pVideoDec->exynos_process_codecConfigData(pOMXComponent, inputUseBuffer); /* SLP_PLATFORM */ + pVideoDec->exynos_process_codecConfigData(pOMXComponent, inputUseBuffer); /* TIZEN_FEATURE_E3250 */ // pVideoDec->exynos_process_codecConfigData(pOMXComponent, pSrcInputData); bCodecConfigured = OMX_TRUE; diff --git a/openmax/component/video/dec/Exynos_OMX_Vdec.h b/openmax/component/video/dec/Exynos_OMX_Vdec.h old mode 100755 new mode 100644 index 851c5b9..78843ea --- a/openmax/component/video/dec/Exynos_OMX_Vdec.h +++ b/openmax/component/video/dec/Exynos_OMX_Vdec.h @@ -56,7 +56,7 @@ #define INPUT_PORT_SUPPORTFORMAT_NUM_MAX 1 #define OUTPUT_PORT_SUPPORTFORMAT_NUM_MAX 4 -#ifdef SLP_PLATFORM /* exrta dpb number */ +#ifdef TIZEN_FEATURE_E3250 /* exrta dpb number */ #define EXTRA_DPB_NUM 5 #else #define EXTRA_DPB_NUM 5 @@ -127,7 +127,7 @@ typedef struct _EXYNOS_OMX_VIDEODEC_COMPONENT OMX_PTR csc_handle; OMX_U32 csc_set_format; -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 OMX_BOOL bNeedTimestampReorder; #endif diff --git a/openmax/component/video/dec/Exynos_OMX_VdecControl.c b/openmax/component/video/dec/Exynos_OMX_VdecControl.c old mode 100755 new mode 100644 index 2cbb0bc..b6db0e5 --- a/openmax/component/video/dec/Exynos_OMX_VdecControl.c +++ b/openmax/component/video/dec/Exynos_OMX_VdecControl.c @@ -121,7 +121,7 @@ OMX_ERRORTYPE Exynos_OMX_UseBuffer( temp_bufferHeader->nInputPortIndex = INPUT_PORT_INDEX; else temp_bufferHeader->nOutputPortIndex = OUTPUT_PORT_INDEX; -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 if (nPortIndex == OUTPUT_PORT_INDEX) { MMVideoBuffer * pSlpOutBuf = (MMVideoBuffer *)pBuffer; @@ -469,7 +469,7 @@ OMX_ERRORTYPE Exynos_OMX_FlushPort(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 por OMX_S32 semValue = 0; int i = 0, maxBufferNum = 0; FunctionIn(); -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 Exynos_OSAL_Log(EXYNOS_LOG_WARNING, "flushPort idx:%d", portIndex); #endif @@ -564,7 +564,7 @@ OMX_ERRORTYPE Exynos_OMX_BufferFlush(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 n OMX_U32 i = 0, cnt = 0; FunctionIn(); -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 Exynos_OSAL_Log(EXYNOS_LOG_WARNING, "bufferFlush idx:%d", nPortIndex); #endif @@ -791,7 +791,7 @@ OMX_ERRORTYPE Exynos_InputBufferGetQueue(EXYNOS_OMX_BASECOMPONENT *pExynosCompon Exynos_OSAL_Free(message); -#ifndef SLP_PLATFORM +#ifndef TIZEN_FEATURE_E3250 if (inputUseBuffer->allocSize <= inputUseBuffer->dataLen) Exynos_OSAL_Log(EXYNOS_LOG_WARNING, "Input Buffer Full, Check input buffer size! allocSize:%d, dataLen:%d", inputUseBuffer->allocSize, inputUseBuffer->dataLen); #endif @@ -818,7 +818,7 @@ OMX_ERRORTYPE Exynos_OutputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent) bufferHeader = dataBuffer->bufferHeader; if (bufferHeader != NULL) { -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 bufferHeader->nFilledLen = sizeof(MMVideoBuffer); #else bufferHeader->nFilledLen = dataBuffer->remainDataLen; @@ -1018,7 +1018,7 @@ OMX_ERRORTYPE Exynos_CodecBufferEnQueue(EXYNOS_OMX_BASECOMPONENT *pExynosCompone goto EXIT; } -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 if (pExynosPort == NULL) { Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "%s : %d: pExynosPort is NULL", __FUNCTION__, __LINE__); } @@ -1200,7 +1200,7 @@ OMX_ERRORTYPE Exynos_OMX_VideoDecodeGetParameter( portFormat->eColorFormat = OMX_SEC_COLOR_FormatNV12L_DmaBuf_Fd; portFormat->xFramerate = portDefinition->format.video.xFramerate; break; -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 case supportFormat_3: portFormat->eCompressionFormat = OMX_VIDEO_CodingUnused; portFormat->eColorFormat = OMX_SEC_COLOR_FormatNV12T_DmaBuf_Fd; @@ -1304,7 +1304,7 @@ OMX_ERRORTYPE Exynos_OMX_VideoDecodeSetParameter( } break; #ifdef USE_PB -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 case OMX_IndexParamEnablePlatformSpecificBuffers: #else case OMX_IndexParamEnableAndroidBuffers: @@ -1316,7 +1316,7 @@ OMX_ERRORTYPE Exynos_OMX_VideoDecodeSetParameter( break; #endif -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 case OMX_IndexParamEnableTimestampReorder: { EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle; @@ -1474,7 +1474,7 @@ OMX_ERRORTYPE Exynos_OMX_VideoDecodeGetExtensionIndex( } #ifdef USE_PB -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 if (Exynos_OSAL_Strcmp(cParameterName, EXYNOS_INDEX_PARAM_ENABLE_PB) == 0) *pIndexType = (OMX_INDEXTYPE) OMX_IndexParamEnablePlatformSpecificBuffers; else if (Exynos_OSAL_Strcmp(cParameterName, EXYNOS_INDEX_PARAM_ENABLE_TS_REORDER) == 0) @@ -1559,7 +1559,7 @@ EXIT: } /* this is for Fill This Buffer Done */ -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 OMX_ERRORTYPE Exynos_Shared_DataToPlatformBuffer(EXYNOS_OMX_DATA *pData, EXYNOS_OMX_DATABUFFER *pUseBuffer, EXYNOS_OMX_BASEPORT *pExynosPort, EXYNOS_OMX_BASEPORT *pExynosInPort) #else OMX_ERRORTYPE Exynos_Shared_DataToPlatformBuffer(EXYNOS_OMX_DATA *pData, EXYNOS_OMX_DATABUFFER *pUseBuffer, EXYNOS_OMX_BASEPORT *pExynosPort) @@ -1571,7 +1571,7 @@ OMX_ERRORTYPE Exynos_Shared_DataToPlatformBuffer(EXYNOS_OMX_DATA *pData, EXYNOS_ pUseBuffer->bufferHeader = pData->bufferHeader; pUseBuffer->allocSize = pData->allocSize; -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 pUseBuffer->dataLen = sizeof(MMVideoBuffer); #else pUseBuffer->dataLen = pData->dataLen; @@ -1590,7 +1590,7 @@ OMX_ERRORTYPE Exynos_Shared_DataToPlatformBuffer(EXYNOS_OMX_DATA *pData, EXYNOS_ } if (pExynosPort->bIsPBEnabled == OMX_TRUE) { -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 Exynos_OSAL_UnlockPB(pUseBuffer->bufferHeader->pBuffer, pData, pExynosPort,pExynosInPort); #else Exynos_OSAL_UnlockPB(pUseBuffer->bufferHeader->pBuffer, pData); diff --git a/openmax/component/video/dec/Exynos_OMX_VdecControl.h b/openmax/component/video/dec/Exynos_OMX_VdecControl.h index d7428a5..ca12a6b 100644 --- a/openmax/component/video/dec/Exynos_OMX_VdecControl.h +++ b/openmax/component/video/dec/Exynos_OMX_VdecControl.h @@ -95,7 +95,7 @@ OMX_ERRORTYPE Exynos_FlushOutputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent, E #ifdef USE_PB OMX_ERRORTYPE Exynos_Shared_PlatformBufferToData(EXYNOS_OMX_DATABUFFER *pUseBuffer, EXYNOS_OMX_DATA *pData, EXYNOS_OMX_BASEPORT *pExynosPort, EXYNOS_OMX_PLANE nPlane); -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 OMX_ERRORTYPE Exynos_Shared_DataToPlatformBuffer(EXYNOS_OMX_DATA *pData, EXYNOS_OMX_DATABUFFER *pUseBuffer, EXYNOS_OMX_BASEPORT *pExynosPort,EXYNOS_OMX_BASEPORT *pExynosInPort); #else OMX_ERRORTYPE Exynos_Shared_DataToPlatformBuffer(EXYNOS_OMX_DATA *pData, EXYNOS_OMX_DATABUFFER *pUseBuffer, EXYNOS_OMX_BASEPORT *pExynosPort); diff --git a/openmax/component/video/dec/Makefile.am b/openmax/component/video/dec/Makefile.am old mode 100755 new mode 100644 diff --git a/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c b/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c index e3992bb..6a30ffa 100755 --- a/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c +++ b/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c @@ -518,7 +518,7 @@ OMX_ERRORTYPE H264CodecSrcInit(OMX_COMPONENTTYPE *pOMXComponent) if (pVideoDec->bThumbnailMode == OMX_TRUE) - pDecOps->Set_DisplayDelay(hMFCHandle, 0); + pDecOps->Set_DisplayDelay(hMFCHandle, 0); /* input buffer info */ Exynos_OSAL_Memset(&bufferConf, 0, sizeof(bufferConf)); @@ -535,7 +535,7 @@ OMX_ERRORTYPE H264CodecSrcInit(OMX_COMPONENTTYPE *pOMXComponent) } else if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { bufferConf.nSizeImage = DEFAULT_MFC_INPUT_BUFFER_SIZE; inputBufferNumber = MFC_INPUT_BUFFER_NUM_MAX; - } + } /* should be done before prepare input buffer */ if (pInbufOps->Enable_Cacheable(hMFCHandle) != VIDEO_ERROR_NONE) { @@ -548,7 +548,7 @@ OMX_ERRORTYPE H264CodecSrcInit(OMX_COMPONENTTYPE *pOMXComponent) Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to set geometry for input buffer"); ret = OMX_ErrorInsufficientResources; goto EXIT; - } + } /* setup input buffer */ if (pInbufOps->Setup(hMFCHandle, inputBufferNumber) != VIDEO_ERROR_NONE) { @@ -597,7 +597,7 @@ OMX_ERRORTYPE H264CodecSrcInit(OMX_COMPONENTTYPE *pOMXComponent) Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "@pVideoDec->pMFCDecInputBuffer[%d]->pVirAddr[%d]: 0x%x", i, plane, pVideoDec->pMFCDecInputBuffer[i]->pVirAddr[plane]); } -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 if (pExynosInputPort == NULL || pExynosOutputPort == NULL || pOMXComponent == NULL) { Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "invalid param: pExynosInputPort= %p pExynosOutputPort= %p pOMXComponent= %p", pExynosInputPort, pExynosOutputPort, pOMXComponent); } @@ -609,7 +609,7 @@ OMX_ERRORTYPE H264CodecSrcInit(OMX_COMPONENTTYPE *pOMXComponent) for (i = 0; i < pExynosInputPort->portDefinition.nBufferCountActual; i++) { ExynosVideoPlane plane; if (pVideoDec->bDRMPlayerMode == OMX_TRUE) { -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 /* IL Client assigns FD value in pBuffer */ plane.addr = pExynosInputPort->extendBufferHeader[i].OMXBufferHeader->pBuffer; #else @@ -1062,8 +1062,8 @@ OMX_ERRORTYPE H264CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DAT ret = OMX_ErrorInputDataDecodeYet; #ifdef USE_IMMEDIATE_DISPLAY - /* Set Immediately display for I Frame*/ - pDecOps->Set_ImmediateDisplay(hMFCHandle); + /* Set Immediately display for I Frame*/ + pDecOps->Set_ImmediateDisplay(hMFCHandle); #endif EXIT: @@ -1270,8 +1270,10 @@ OMX_ERRORTYPE H264CodecCheckResolutionChange(OMX_COMPONENTTYPE *pOMXComponent) OMX_DirOutput, /* This is the port index */ 0, NULL); - } + } } else if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { +#ifndef TIZEN_FEATURE_E3250 + /* The input port information has already been updated */ if ((pExynosInputPort->portDefinition.format.video.nFrameWidth != pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth) || (pExynosInputPort->portDefinition.format.video.nFrameHeight != pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight) || (pExynosOutputPort->portDefinition.nBufferCountActual != pH264Dec->hMFCH264Handle.maxDPBNum)) { @@ -1279,11 +1281,11 @@ OMX_ERRORTYPE H264CodecCheckResolutionChange(OMX_COMPONENTTYPE *pOMXComponent) pExynosInputPort->portDefinition.format.video.nFrameHeight = pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight; pExynosInputPort->portDefinition.format.video.nStride = ((pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth + 15) & (~15)); pExynosInputPort->portDefinition.format.video.nSliceHeight = ((pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight + 15) & (~15)); - +#endif if (pVideoDec->bDRCProcessing == OMX_TRUE) { pVideoDec->nDRCSavedBufferCount = pExynosOutputPort->portDefinition.nBufferCountActual; } -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 pExynosOutputPort->portDefinition.nBufferCountActual = pH264Dec->hMFCH264Handle.maxDPBNum; pExynosOutputPort->portDefinition.nBufferCountMin = pH264Dec->hMFCH264Handle.maxDPBNum; #else @@ -1301,7 +1303,9 @@ OMX_ERRORTYPE H264CodecCheckResolutionChange(OMX_COMPONENTTYPE *pOMXComponent) OMX_DirOutput, /* This is the port index */ 0, NULL); +#ifndef TIZEN_FEATURE_E3250 } +#endif } if (((pVideoDec->bDRCProcessing) && (pExynosOutputPort->bufferProcessType & BUFFER_COPY)) || @@ -1617,7 +1621,7 @@ OMX_ERRORTYPE Exynos_H264Dec_SetParameter( case OMX_COLOR_FormatYUV420SemiPlanar: pExynosOutputPort->portDefinition.nBufferSize = (width * height * 3) / 2; break; -#ifdef SLP_PLATFORM /* NV12 fd */ +#ifdef TIZEN_FEATURE_E3250 /* NV12 fd */ case OMX_SEC_COLOR_FormatNV12L_DmaBuf_Fd: case OMX_SEC_COLOR_FormatNV12T_DmaBuf_Fd: pExynosOutputPort->portDefinition.nBufferSize = sizeof(MMVideoBuffer); @@ -1979,7 +1983,7 @@ OMX_ERRORTYPE Exynos_H264Dec_Init(OMX_COMPONENTTYPE *pOMXComponent) Exynos_CodecBufferEnQueue(pExynosComponent, INPUT_PORT_INDEX, pVideoDec->pMFCDecInputBuffer[i]); } } else { -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 if (pOMXComponent == NULL) { Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "%s : %d: invalid parm: pOMXComponent = %p", __FUNCTION__, __LINE__, pOMXComponent); } @@ -2086,7 +2090,7 @@ OMX_ERRORTYPE Exynos_H264Dec_Terminate(OMX_COMPONENTTYPE *pOMXComponent) if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { for (i = 0; i < MFC_INPUT_BUFFER_NUM_MAX; i++) { if (pVideoDec->pMFCDecInputBuffer[i] != NULL) { -#ifndef SLP_PLATFORM /* do not use ion */ +#ifndef TIZEN_FEATURE_E3250 /* do not use ion */ for (plane = 0; plane < MFC_INPUT_BUFFER_PLANE; plane++) { if (pVideoDec->pMFCDecInputBuffer[i]->pVirAddr[plane] != NULL) Exynos_OSAL_SharedMemory_Free(pVideoDec->hSharedMemory, pVideoDec->pMFCDecInputBuffer[i]->pVirAddr[plane]); @@ -2151,7 +2155,7 @@ OMX_ERRORTYPE Exynos_H264Dec_SrcIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_ pH264Dec->hMFCH264Handle.indexTimestamp %= MAX_TIMESTAMP; #ifdef USE_IMMEDIATE_DISPLAY - /* Set Immediately display for I Frame*/ + /* Set Immediately display for I Frame*/ if (pExynosComponent->checkTimeStamp.needCheckStartTimeStamp == OMX_TRUE) { if ( pExynosComponent->checkTimeStamp.bImmediateDisplay == OMX_FALSE) { @@ -2401,7 +2405,7 @@ OMX_ERRORTYPE Exynos_H264Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX pBufferInfo->imageHeight = bufferGeometry->nFrameHeight; switch (bufferGeometry->eColorFormat) { case VIDEO_COLORFORMAT_NV12: -#ifdef SLP_PLATFORM /* NV12 fd */ +#ifdef TIZEN_FEATURE_E3250 /* NV12 fd */ pBufferInfo->ColorFormat = OMX_SEC_COLOR_FormatNV12L_DmaBuf_Fd; #else pBufferInfo->ColorFormat = OMX_COLOR_FormatYUV420SemiPlanar; @@ -2438,7 +2442,7 @@ OMX_ERRORTYPE Exynos_H264Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX /* For timestamp correction. if mfc support frametype detect */ Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "disp_pic_frame_type: %d", pVideoBuffer->frameType); //#ifdef NEED_TIMESTAMP_REORDER - /* SLP_PLATFORM */ + /* TIZEN_FEATURE_E3250 */ if (pVideoDec->bNeedTimestampReorder == OMX_TRUE) { Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "NEED_TIMESTAMP_REORDER ON"); if ((pVideoBuffer->frameType == VIDEO_FRAME_I)) { @@ -2740,13 +2744,13 @@ OSCL_EXPORT_REF OMX_ERRORTYPE Exynos_OMX_ComponentInit(OMX_HANDLETYPE hComponent Exynos_OSAL_Strcpy(pExynosPort->portDefinition.format.video.cMIMEType, "raw/video"); pExynosPort->portDefinition.format.video.pNativeRender = 0; pExynosPort->portDefinition.format.video.bFlagErrorConcealment = OMX_FALSE; -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 pExynosPort->portDefinition.format.video.eColorFormat = OMX_SEC_COLOR_FormatNV12L_DmaBuf_Fd; #else pExynosPort->portDefinition.format.video.eColorFormat = OMX_COLOR_FormatYUV420Planar; #endif pExynosPort->portDefinition.bEnabled = OMX_TRUE; -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 pExynosPort->bufferProcessType = BUFFER_SHARE; #else pExynosPort->bufferProcessType = BUFFER_COPY; @@ -2786,7 +2790,7 @@ OSCL_EXPORT_REF OMX_ERRORTYPE Exynos_OMX_ComponentInit(OMX_HANDLETYPE hComponent pVideoDec->exynos_codec_getCodecInputPrivateData = &GetCodecInputPrivateData; pVideoDec->exynos_codec_getCodecOutputPrivateData = &GetCodecOutputPrivateData; -#ifndef SLP_PLATFORM /* do not use ion */ +#ifndef TIZEN_FEATURE_E3250 /* do not use ion */ pVideoDec->hSharedMemory = Exynos_OSAL_SharedMemory_Open(); if (pVideoDec->hSharedMemory == NULL) { Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "OMX_ErrorInsufficientResources, Line:%d", __LINE__); @@ -2825,7 +2829,7 @@ OMX_ERRORTYPE Exynos_OMX_ComponentDeinit(OMX_HANDLETYPE hComponent) pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle; -#ifndef SLP_PLATFORM /* do not use ion */ +#ifndef TIZEN_FEATURE_E3250 /* do not use ion */ Exynos_OSAL_SharedMemory_Close(pVideoDec->hSharedMemory); #endif Exynos_OSAL_Free(pExynosComponent->componentName); diff --git a/openmax/component/video/dec/h264/Makefile.am b/openmax/component/video/dec/h264/Makefile.am index f9b4318..8a3f9d5 100755 --- a/openmax/component/video/dec/h264/Makefile.am +++ b/openmax/component/video/dec/h264/Makefile.am @@ -11,7 +11,6 @@ libOMX_Exynos_AVC_Decoder_la_LIBADD = $(top_builddir)/openmax/osal/libExynosOMX_ $(top_builddir)/openmax/component/common/libExynosOMX_Basecomponent.la \ $(top_builddir)/exynos4/libcodec/video/v4l2/libExynosVideoApi.la \ $(top_builddir)/exynos/libv4l2/libexynosv4l2.la - libOMX_Exynos_AVC_Decoder_la_CFLAGS = -I$(top_srcdir)/openmax/include/khronos \ diff --git a/openmax/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c b/openmax/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c index 3ae55f5..74e15ac 100755 --- a/openmax/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c +++ b/openmax/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c @@ -1433,7 +1433,7 @@ OMX_ERRORTYPE Exynos_Mpeg2Dec_Terminate(OMX_COMPONENTTYPE *pOMXComponent) if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { for (i = 0; i < MFC_OUTPUT_BUFFER_NUM_MAX; i++) { if (pVideoDec->pMFCDecOutputBuffer[i] != NULL) { -#ifndef SLP_PLATFORM /* do not use ion */ +#ifndef TIZEN_FEATURE_E3250 /* do not use ion */ for (plane = 0; plane < MFC_OUTPUT_BUFFER_PLANE; plane++) { if (pVideoDec->pMFCDecOutputBuffer[i]->pVirAddr[plane] != NULL) Exynos_OSAL_SharedMemory_Free(pVideoDec->hSharedMemory, pVideoDec->pMFCDecOutputBuffer[i]->pVirAddr[plane]); @@ -1456,7 +1456,7 @@ OMX_ERRORTYPE Exynos_Mpeg2Dec_Terminate(OMX_COMPONENTTYPE *pOMXComponent) if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { for (i = 0; i < MFC_INPUT_BUFFER_NUM_MAX; i++) { if (pVideoDec->pMFCDecInputBuffer[i] != NULL) { -#ifndef SLP_PLATFORM /* do not use ion */ +#ifndef TIZEN_FEATURE_E3250 /* do not use ion */ for (plane = 0; plane < MFC_INPUT_BUFFER_PLANE; plane++) { if (pVideoDec->pMFCDecInputBuffer[i]->pVirAddr[plane] != NULL) Exynos_OSAL_SharedMemory_Free(pVideoDec->hSharedMemory, pVideoDec->pMFCDecInputBuffer[i]->pVirAddr[plane]); @@ -1745,7 +1745,7 @@ OMX_ERRORTYPE Exynos_Mpeg2Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OM /* For timestamp correction. if mfc support frametype detect */ Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "disp_pic_frame_type: %d", pVideoBuffer->frameType); //#ifdef NEED_TIMESTAMP_REORDER - /* SLP_PLATFORM */ + /* TIZEN_FEATURE_E3250 */ if (pVideoDec->bNeedTimestampReorder == OMX_TRUE) { if ((pVideoBuffer->frameType == VIDEO_FRAME_I)) { pDstOutputData->timeStamp = pExynosComponent->timeStamp[indexTimestamp]; @@ -2028,7 +2028,7 @@ OSCL_EXPORT_REF OMX_ERRORTYPE Exynos_OMX_ComponentInit( pExynosPort->portDefinition.format.video.bFlagErrorConcealment = OMX_FALSE; pExynosPort->portDefinition.format.video.eColorFormat = OMX_COLOR_FormatYUV420Planar; pExynosPort->portDefinition.bEnabled = OMX_TRUE; -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 pExynosPort->bufferProcessType = BUFFER_SHARE; #else pExynosPort->bufferProcessType = BUFFER_COPY | BUFFER_PBSHARE; @@ -2067,7 +2067,7 @@ OSCL_EXPORT_REF OMX_ERRORTYPE Exynos_OMX_ComponentInit( pVideoDec->exynos_codec_getCodecInputPrivateData = &GetCodecInputPrivateData; pVideoDec->exynos_codec_getCodecOutputPrivateData = &GetCodecOutputPrivateData; -#ifndef SLP_PLATFORM /* do not use ion */ +#ifndef TIZEN_FEATURE_E3250 /* do not use ion */ pVideoDec->hSharedMemory = Exynos_OSAL_SharedMemory_Open(); if (pVideoDec->hSharedMemory == NULL) { Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "OMX_ErrorInsufficientResources, Line:%d", __LINE__); @@ -2106,7 +2106,7 @@ OMX_ERRORTYPE Exynos_OMX_ComponentDeinit( pOMXComponent = (OMX_COMPONENTTYPE *)hComponent; pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle; -#ifndef SLP_PLATFORM /* do not use ion */ +#ifndef TIZEN_FEATURE_E3250 /* do not use ion */ Exynos_OSAL_SharedMemory_Close(pVideoDec->hSharedMemory); #endif Exynos_OSAL_Free(pExynosComponent->componentName); diff --git a/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c b/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c index 2afae9c..d7daa97 100755 --- a/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c +++ b/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c @@ -655,7 +655,7 @@ OMX_ERRORTYPE Mpeg4CodecSrcInit(OMX_COMPONENTTYPE *pOMXComponent) int i, plane; if (pVideoDec->bThumbnailMode == OMX_TRUE) - pDecOps->Set_DisplayDelay(hMFCHandle, 0); + pDecOps->Set_DisplayDelay(hMFCHandle, 0); /* input buffer info */ Exynos_OSAL_Memset(&bufferConf, 0, sizeof(bufferConf)); @@ -675,7 +675,7 @@ OMX_ERRORTYPE Mpeg4CodecSrcInit(OMX_COMPONENTTYPE *pOMXComponent) } else if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { bufferConf.nSizeImage = DEFAULT_MFC_INPUT_BUFFER_SIZE; inputBufferNumber = MFC_INPUT_BUFFER_NUM_MAX; - } + } /* should be done before prepare input buffer */ if (pInbufOps->Enable_Cacheable(hMFCHandle) != VIDEO_ERROR_NONE) { @@ -688,7 +688,7 @@ OMX_ERRORTYPE Mpeg4CodecSrcInit(OMX_COMPONENTTYPE *pOMXComponent) Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to set geometry for input buffer"); ret = OMX_ErrorInsufficientResources; goto EXIT; - } + } /* setup input buffer */ if (pInbufOps->Setup(hMFCHandle, inputBufferNumber) != VIDEO_ERROR_NONE) { @@ -737,7 +737,7 @@ OMX_ERRORTYPE Mpeg4CodecSrcInit(OMX_COMPONENTTYPE *pOMXComponent) Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "@pVideoDec->pMFCDecInputBuffer[%d]->pVirAddr[%d]: 0x%x", i, plane, pVideoDec->pMFCDecInputBuffer[i]->pVirAddr[plane]); } -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 if (pExynosInputPort == NULL || pExynosOutputPort == NULL || pOMXComponent == NULL) { Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "invalid param: pExynosInputPort= %p pExynosOutputPort= %p pOMXComponent= %p", pExynosInputPort, pExynosOutputPort, pOMXComponent); } @@ -1161,7 +1161,7 @@ OMX_ERRORTYPE Mpeg4CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DA ret = OMX_ErrorInputDataDecodeYet; #ifdef USE_IMMEDIATE_DISPLAY - /* Set Immediately display for I Frame*/ + /* Set Immediately display for I Frame*/ pDecOps->Set_ImmediateDisplay(hMFCHandle); #endif EXIT: @@ -1370,7 +1370,7 @@ OMX_ERRORTYPE Mpeg4CodecCheckResolutionChange(OMX_COMPONENTTYPE *pOMXComponent) if (pVideoDec->bDRCProcessing == OMX_TRUE) { pVideoDec->nDRCSavedBufferCount = pExynosOutputPort->portDefinition.nBufferCountActual; } -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 pExynosOutputPort->portDefinition.nBufferCountActual = pMpeg4Dec->hMFCMpeg4Handle.maxDPBNum; pExynosOutputPort->portDefinition.nBufferCountMin = pMpeg4Dec->hMFCMpeg4Handle.maxDPBNum; #else @@ -1752,7 +1752,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_SetParameter( case OMX_COLOR_FormatYUV420SemiPlanar: pExynosOutputPort->portDefinition.nBufferSize = (width * height * 3) / 2; break; -#ifdef SLP_PLATFORM /* NV12 fd */ +#ifdef TIZEN_FEATURE_E3250 /* NV12 fd */ case OMX_SEC_COLOR_FormatNV12T_DmaBuf_Fd: case OMX_SEC_COLOR_FormatNV12L_DmaBuf_Fd: pExynosOutputPort->portDefinition.nBufferSize = sizeof(MMVideoBuffer); @@ -2092,7 +2092,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_Init(OMX_COMPONENTTYPE *pOMXComponent) Exynos_CodecBufferEnQueue(pExynosComponent, INPUT_PORT_INDEX, pVideoDec->pMFCDecInputBuffer[i]); } } else { -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 if (pOMXComponent == NULL) { Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "%s : %d: invalid parm: pOMXComponent = %p", __FUNCTION__, __LINE__, pOMXComponent); } @@ -2192,7 +2192,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_Terminate(OMX_COMPONENTTYPE *pOMXComponent) if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { for (i = 0; i < MFC_INPUT_BUFFER_NUM_MAX; i++) { if (pVideoDec->pMFCDecInputBuffer[i] != NULL) { -#ifndef SLP_PLATFORM /* do not use ion */ +#ifndef TIZEN_FEATURE_E3250 /* do not use ion */ for (plane = 0; plane < MFC_INPUT_BUFFER_PLANE; plane++) { if (pVideoDec->pMFCDecInputBuffer[i]->pVirAddr[plane] != NULL) Exynos_OSAL_SharedMemory_Free(pVideoDec->hSharedMemory, pVideoDec->pMFCDecInputBuffer[i]->pVirAddr[plane]); @@ -2256,7 +2256,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_SrcIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX pMpeg4Dec->hMFCMpeg4Handle.indexTimestamp %= MAX_TIMESTAMP; #ifdef USE_IMMEDIATE_DISPLAY - /* Set Immediately display for I Frame*/ + /* Set Immediately display for I Frame*/ if (pExynosComponent->checkTimeStamp.needCheckStartTimeStamp == OMX_TRUE) { if ( pExynosComponent->checkTimeStamp.bImmediateDisplay == OMX_FALSE) { /* Enable Immediately display After seek*/ @@ -2498,7 +2498,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OM pBufferInfo->imageHeight = bufferGeometry->nFrameHeight; switch (bufferGeometry->eColorFormat) { case VIDEO_COLORFORMAT_NV12: -#ifdef SLP_PLATFORM /* NV12 fd */ +#ifdef TIZEN_FEATURE_E3250 /* NV12 fd */ pBufferInfo->ColorFormat = OMX_SEC_COLOR_FormatNV12L_DmaBuf_Fd; #else pBufferInfo->ColorFormat = OMX_COLOR_FormatYUV420SemiPlanar; @@ -2527,7 +2527,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OM Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "disp_pic_frame_type: %d", pVideoBuffer->frameType); //#ifdef NEED_TIMESTAMP_REORDER if (pMpeg4Dec->hMFCMpeg4Handle.bPackedPB == OMX_TRUE || - pVideoDec->bNeedTimestampReorder == OMX_TRUE) { /* SLP_PLATFORM */ + pVideoDec->bNeedTimestampReorder == OMX_TRUE) { /* TIZEN_FEATURE_E3250 */ if ((pVideoBuffer->frameType == VIDEO_FRAME_I)) { pDstOutputData->timeStamp = pExynosComponent->timeStamp[indexTimestamp]; pDstOutputData->nFlags = pExynosComponent->nFlags[indexTimestamp]; @@ -2831,7 +2831,7 @@ OSCL_EXPORT_REF OMX_ERRORTYPE Exynos_OMX_ComponentInit(OMX_HANDLETYPE hComponent Exynos_OSAL_Strcpy(pExynosPort->portDefinition.format.video.cMIMEType, "raw/video"); pExynosPort->portDefinition.format.video.pNativeRender = 0; pExynosPort->portDefinition.format.video.bFlagErrorConcealment = OMX_FALSE; -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 pExynosPort->portDefinition.format.video.eColorFormat = OMX_SEC_COLOR_FormatNV12L_DmaBuf_Fd; pExynosPort->bufferProcessType = BUFFER_SHARE; #else @@ -2887,7 +2887,7 @@ OSCL_EXPORT_REF OMX_ERRORTYPE Exynos_OMX_ComponentInit(OMX_HANDLETYPE hComponent pVideoDec->exynos_codec_getCodecInputPrivateData = &GetCodecInputPrivateData; pVideoDec->exynos_codec_getCodecOutputPrivateData = &GetCodecOutputPrivateData; -#ifndef SLP_PLATFORM /* do not use ion */ +#ifndef TIZEN_FEATURE_E3250 /* do not use ion */ pVideoDec->hSharedMemory = Exynos_OSAL_SharedMemory_Open(); if (pVideoDec->hSharedMemory == NULL) { Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "OMX_ErrorInsufficientResources, Line:%d", __LINE__); @@ -2925,7 +2925,7 @@ OMX_ERRORTYPE Exynos_OMX_ComponentDeinit(OMX_HANDLETYPE hComponent) pOMXComponent = (OMX_COMPONENTTYPE *)hComponent; pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle; -#ifndef SLP_PLATFORM /* do not use ion */ +#ifndef TIZEN_FEATURE_E3250 /* do not use ion */ Exynos_OSAL_SharedMemory_Close(pVideoDec->hSharedMemory); #endif Exynos_OSAL_Free(pExynosComponent->componentName); diff --git a/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c b/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c old mode 100644 new mode 100755 index b14d8e0..7897a37 --- a/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c +++ b/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c @@ -30,6 +30,7 @@ #include #include #include +#include #include "Exynos_OMX_Macros.h" #include "Exynos_OMX_Basecomponent.h" @@ -245,14 +246,14 @@ static OMX_BOOL Make_Stream_MetaData( OMX_U8 *pInputStream, OMX_U32 *pStreamSize, WMV_FORMAT wmvFormat -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 , OMX_U32 width, OMX_U32 height #endif ) { OMX_U8 *pCurrBuf = pInputStream; OMX_U32 currPos = 0; -#ifndef SLP_PLATFORM +#ifndef TIZEN_FEATURE_E3250 OMX_U32 width, height; #endif FunctionIn(); @@ -269,7 +270,7 @@ static OMX_BOOL Make_Stream_MetaData( switch (wmvFormat) { case WMV_FORMAT_WMV3: if (*pStreamSize >= BITMAPINFOHEADER_SIZE) { -#ifndef SLP_PLATFORM +#ifndef TIZEN_FEATURE_E3250 BitmapInfoHhr *pBitmapInfoHeader; pBitmapInfoHeader = (BitmapInfoHhr *)pInputStream; @@ -384,14 +385,14 @@ OMX_ERRORTYPE Process_Wmv_CodecConfigData(OMX_COMPONENTTYPE *pOMXComponent, void EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; EXYNOS_WMVDEC_HANDLE *pWmvDec = (EXYNOS_WMVDEC_HANDLE *)pVideoDec->hCodecHandle; OMX_PTR hMFCHandle = pWmvDec->hMFCWmvHandle.hMFCHandle; -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 EXYNOS_OMX_DATABUFFER *pSrcInputData = (EXYNOS_OMX_DATA *)pConfig; OMX_U8 *pInputStream = pSrcInputData->bufferHeader->pBuffer; #endif FunctionIn(); -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 if (pWmvDec->wmvFormat == WMV_FORMAT_UNKNOWN) { Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "Process_Wmv_CodecConfigData. dataLen = %d", pSrcInputData->dataLen); if (pSrcInputData->dataLen < 4) { @@ -1177,7 +1178,7 @@ OMX_ERRORTYPE WmvCodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA } bMetaData = Make_Stream_MetaData(pSrcInputData->buffer.singlePlaneBuffer.dataBuffer, &oneFrameSize, pWmvDec->hMFCWmvHandle.wmvFormat -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 , pExynosComponent->pExynosPort[INPUT_PORT_INDEX].portDefinition.format.video.nFrameWidth , pExynosComponent->pExynosPort[INPUT_PORT_INDEX].portDefinition.format.video.nFrameHeight #endif @@ -1215,7 +1216,7 @@ OMX_ERRORTYPE WmvCodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA ret = OMX_ErrorInputDataDecodeYet; #ifdef USE_IMMEDIATE_DISPLAY - /* Set Immediately display for I Frame*/ + /* Set Immediately display for I Frame*/ pDecOps->Set_ImmediateDisplay(hMFCHandle); #endif EXIT: @@ -1423,7 +1424,7 @@ OMX_ERRORTYPE WmvCodecCheckResolutionChange(OMX_COMPONENTTYPE *pOMXComponent) if (pVideoDec->bDRCProcessing == OMX_TRUE) { pVideoDec->nDRCSavedBufferCount = pExynosOutputPort->portDefinition.nBufferCountActual; } -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 pExynosOutputPort->portDefinition.nBufferCountActual = pWmvDec->hMFCWmvHandle.maxDPBNum; pExynosOutputPort->portDefinition.nBufferCountMin = pWmvDec->hMFCWmvHandle.maxDPBNum; #else @@ -1683,9 +1684,9 @@ OMX_ERRORTYPE Exynos_WmvDec_SetParameter( case OMX_COLOR_FormatYUV420SemiPlanar: pExynosOutputPort->portDefinition.nBufferSize = (width * height * 3) / 2; break; -#ifdef SLP_PLATFORM /* NV12T fd */ +#ifdef TIZEN_FEATURE_E3250 /* NV12T fd */ case OMX_SEC_COLOR_FormatNV12T_DmaBuf_Fd: - pExynosOutputPort->portDefinition.nBufferSize = sizeof(SCMN_IMGB); + pExynosOutputPort->portDefinition.nBufferSize = sizeof(MMVideoBuffer); break; #endif case OMX_SEC_COLOR_FormatNV12Tiled: @@ -2140,7 +2141,7 @@ OMX_ERRORTYPE Exynos_WmvDec_SrcIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_D pWmvDec->hMFCWmvHandle.indexTimestamp %= MAX_TIMESTAMP; #ifdef USE_IMMEDIATE_DISPLAY - /* Set Immediately display for I Frame*/ + /* Set Immediately display for I Frame*/ if (pExynosComponent->checkTimeStamp.needCheckStartTimeStamp == OMX_TRUE) { if ( pExynosComponent->checkTimeStamp.bImmediateDisplay == OMX_FALSE) { /* Enable Immediately display After seek*/ @@ -2149,7 +2150,7 @@ OMX_ERRORTYPE Exynos_WmvDec_SrcIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_D } } #endif - + /* queue work for input buffer */ Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "oneFrameSize: %d, bufferHeader: 0x%x, dataBuffer: 0x%x", oneFrameSize, pSrcInputData->bufferHeader, pSrcInputData->buffer.singlePlaneBuffer.dataBuffer); codecReturn = pInbufOps->Enqueue(hMFCHandle, (unsigned char **)&pSrcInputData->buffer.singlePlaneBuffer.dataBuffer, @@ -2380,7 +2381,7 @@ OMX_ERRORTYPE Exynos_WmvDec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_ pBufferInfo->imageHeight = bufferGeometry->nFrameHeight; switch (bufferGeometry->eColorFormat) { case VIDEO_COLORFORMAT_NV12: -#ifdef SLP_PLATFORM /* NV12T fd */ +#ifdef TIZEN_FEATURE_E3250 /* NV12T fd */ pBufferInfo->ColorFormat = OMX_SEC_COLOR_FormatNV12T_DmaBuf_Fd; #else pBufferInfo->ColorFormat = OMX_COLOR_FormatYUV420SemiPlanar; @@ -2409,7 +2410,7 @@ OMX_ERRORTYPE Exynos_WmvDec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_ Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "disp_pic_frame_type: %d", pVideoBuffer->frameType); //#ifdef NEED_TIMESTAMP_REORDER - if (pVideoDec->bNeedTimestampReorder == OMX_TRUE) { /* SLP_PLATFORM */ + if (pVideoDec->bNeedTimestampReorder == OMX_TRUE) { /* TIZEN_FEATURE_E3250 */ if ((pVideoBuffer->frameType == VIDEO_FRAME_I)) { pDstOutputData->timeStamp = pExynosComponent->timeStamp[indexTimestamp]; pDstOutputData->nFlags = pExynosComponent->nFlags[indexTimestamp]; @@ -2699,13 +2700,13 @@ OSCL_EXPORT_REF OMX_ERRORTYPE Exynos_OMX_ComponentInit( Exynos_OSAL_Strcpy(pExynosPort->portDefinition.format.video.cMIMEType, "raw/video"); pExynosPort->portDefinition.format.video.pNativeRender = 0; pExynosPort->portDefinition.format.video.bFlagErrorConcealment = OMX_FALSE; -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 pExynosPort->portDefinition.format.video.eColorFormat = OMX_SEC_COLOR_FormatNV12T_DmaBuf_Fd; #else pExynosPort->portDefinition.format.video.eColorFormat = OMX_COLOR_FormatYUV420Planar; #endif pExynosPort->portDefinition.bEnabled = OMX_TRUE; -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 pExynosPort->bufferProcessType = BUFFER_SHARE; #else pExynosPort->bufferProcessType = BUFFER_COPY; @@ -2718,7 +2719,7 @@ OSCL_EXPORT_REF OMX_ERRORTYPE Exynos_OMX_ComponentInit( pWmvDec->WmvComponent[i].eFormat = OMX_VIDEO_WMVFormat9; } -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 pWmvDec->wmvFormat = WMV_FORMAT_UNKNOWN; #endif @@ -2750,7 +2751,7 @@ OSCL_EXPORT_REF OMX_ERRORTYPE Exynos_OMX_ComponentInit( pVideoDec->exynos_process_codecConfigData = &Process_Wmv_CodecConfigData; -#ifndef SLP_PLATFORM /* do not use ion */ +#ifndef TIZEN_FEATURE_E3250 /* do not use ion */ pVideoDec->hSharedMemory = Exynos_OSAL_SharedMemory_Open(); if (pVideoDec->hSharedMemory == NULL) { Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "OMX_ErrorInsufficientResources, Line:%d", __LINE__); @@ -2789,7 +2790,7 @@ OMX_ERRORTYPE Exynos_OMX_ComponentDeinit( pOMXComponent = (OMX_COMPONENTTYPE *)hComponent; pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle; -#ifndef SLP_PLATFORM /* do not use ion */ +#ifndef TIZEN_FEATURE_E3250 /* do not use ion */ Exynos_OSAL_SharedMemory_Close(pVideoDec->hSharedMemory); #endif Exynos_OSAL_Free(pExynosComponent->componentName); diff --git a/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.h b/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.h index f614c83..06ff2ed 100755 --- a/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.h +++ b/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.h @@ -33,7 +33,7 @@ #include "OMX_Video.h" #include "ExynosVideoApi.h" -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 #define BITMAPINFOHEADER_SIZE 0 #define BITMAPINFOHEADER_ASFBINDING_SIZE 1 #else @@ -97,7 +97,7 @@ typedef struct _EXYNOS_WMVDEC_HANDLE OMX_BOOL bDestinationStart; OMX_HANDLETYPE hSourceStartEvent; OMX_HANDLETYPE hDestinationStartEvent; -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 WMV_FORMAT wmvFormat; #endif } EXYNOS_WMVDEC_HANDLE; diff --git a/openmax/component/video/dec/vc1/Makefile.am b/openmax/component/video/dec/vc1/Makefile.am index abb2fb5..d63def8 100755 --- a/openmax/component/video/dec/vc1/Makefile.am +++ b/openmax/component/video/dec/vc1/Makefile.am @@ -24,6 +24,9 @@ libOMX_Exynos_WMV_Decoder_la_CFLAGS = -I$(top_srcdir)/openmax/include/khronos \ -I$(top_srcdir)/exynos4/libcodec/video/v4l2/include \ -I$(top_srcdir)/exynos/include +libOMX_Exynos_WMV_Decoder_la_LIBADD += $(MM_COMMON_LIB) +libOMX_Exynos_WMV_Decoder_la_CFLAGS += $(MM_COMMON_CFLAGS) + if BOARD_USE_ANB libOMX_Exynos_WMV_Decoder_la_CFLAGS += -DUSE_ANB endif diff --git a/openmax/component/video/enc/Exynos_OMX_Venc.c b/openmax/component/video/enc/Exynos_OMX_Venc.c index 4d45cd2..5ce89c6 100755 --- a/openmax/component/video/enc/Exynos_OMX_Venc.c +++ b/openmax/component/video/enc/Exynos_OMX_Venc.c @@ -427,7 +427,7 @@ OMX_BOOL Exynos_Preprocessor_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_ ret = OMX_FALSE; } -#ifndef SLP_PLATFORM +#ifndef TIZEN_FEATURE_E3250 if (((exynosInputPort->bStoreMetaData == OMX_TRUE) && (eColorFormat == OMX_COLOR_FormatAndroidOpaque)) || (exynosInputPort->bStoreMetaData == OMX_FALSE)) #else diff --git a/openmax/component/video/enc/Exynos_OMX_Venc.h b/openmax/component/video/enc/Exynos_OMX_Venc.h old mode 100644 new mode 100755 index 4cdba14..426123c --- a/openmax/component/video/enc/Exynos_OMX_Venc.h +++ b/openmax/component/video/enc/Exynos_OMX_Venc.h @@ -57,7 +57,7 @@ #define MFC_INPUT_BUFFER_PLANE 2 #define MFC_OUTPUT_BUFFER_PLANE 1 -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 /* FIXME: for camera slow motion 12 buffer and eos issue, we increase this value */ /* FIXME: for trim small resolution video. dec + enc case */ #define MAX_CAMERA_INPUTBUFFER_NUM 25 /* number of metadata buffer */ diff --git a/openmax/component/video/enc/Exynos_OMX_VencControl.c b/openmax/component/video/enc/Exynos_OMX_VencControl.c index c46dde3..7053059 100755 --- a/openmax/component/video/enc/Exynos_OMX_VencControl.c +++ b/openmax/component/video/enc/Exynos_OMX_VencControl.c @@ -127,7 +127,7 @@ OMX_ERRORTYPE Exynos_OMX_UseBuffer( pTempBufferHdr->nInputPortIndex = INPUT_PORT_INDEX; else pTempBufferHdr->nOutputPortIndex = OUTPUT_PORT_INDEX; -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 if (nPortIndex == OUTPUT_PORT_INDEX && pVideoEnc->bSharedOutputFD == OMX_TRUE) pExynosPort->extendBufferHeader[i].buf_fd[0] = (int)(pBuffer); /*IL Client provides only FD value*/ @@ -479,7 +479,7 @@ OMX_ERRORTYPE Exynos_OMX_FlushPort( int i = 0; FunctionIn(); -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 Exynos_OSAL_Log(EXYNOS_LOG_WARNING, "flushPort idx:%d", nPortIndex); #endif @@ -594,7 +594,7 @@ OMX_ERRORTYPE Exynos_OMX_BufferFlush( OMX_U32 i = 0; FunctionIn(); -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 Exynos_OSAL_Log(EXYNOS_LOG_WARNING, "bufferFlush idx:%d", nPortIndex); #endif @@ -872,7 +872,7 @@ OMX_ERRORTYPE Exynos_InputBufferGetQueue( Exynos_OSAL_Free(pMessage); -#ifndef SLP_PLATFORM +#ifndef TIZEN_FEATURE_E3250 if (pDataBuffer->allocSize <= pDataBuffer->dataLen) Exynos_OSAL_Log(EXYNOS_LOG_WARNING, "Input Buffer Full, Check input buffer size! allocSize:%d, dataLen:%d", pDataBuffer->allocSize, pDataBuffer->dataLen); #endif @@ -1334,7 +1334,7 @@ OMX_ERRORTYPE Exynos_OMX_VideoEncodeGetParameter( pPortFormat->xFramerate = pPortDef->format.video.xFramerate; break; case supportFormat_4: -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "can not support this format"); #else pPortFormat->eCompressionFormat = OMX_VIDEO_CodingUnused; diff --git a/openmax/component/video/enc/h264/Exynos_OMX_H264enc.c b/openmax/component/video/enc/h264/Exynos_OMX_H264enc.c old mode 100644 new mode 100755 index b9f10da..9a223b5 --- a/openmax/component/video/enc/h264/Exynos_OMX_H264enc.c +++ b/openmax/component/video/enc/h264/Exynos_OMX_H264enc.c @@ -285,7 +285,7 @@ static void Set_H264Enc_Param(EXYNOS_OMX_BASECOMPONENT *pExynosComponent) pH264Param->NumberBFrames = 0; /* 0 ~ 2 */ pH264Param->NumberReferenceFrames = 1; pH264Param->NumberRefForPframes = 1; -#ifdef SLP_PLATFORM /* for B2 camera */ +#ifdef TIZEN_FEATURE_E3250 /* for B2 camera */ pH264Param->LoopFilterDisable = 0; /* 1: Loop Filter Disable, 0: Filter Enable */ #else pH264Param->LoopFilterDisable = 1; /* 1: Loop Filter Disable, 0: Filter Enable */ @@ -778,7 +778,7 @@ OMX_ERRORTYPE H264CodecSrcInit(OMX_COMPONENTTYPE *pOMXComponent) /*************/ /* Does not require any actions. */ } else { -#ifndef SLP_PLATFORM /* slp platform can go into here */ +#ifndef TIZEN_FEATURE_E3250 /* slp platform can go into here */ Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to get input buffer info"); ret = OMX_ErrorNotImplemented; goto EXIT; @@ -1168,7 +1168,7 @@ OMX_ERRORTYPE Exynos_H264Enc_GetParameter( Exynos_OSAL_Memcpy(pDstAVCComponent, pSrcAVCComponent, sizeof(OMX_VIDEO_PARAM_AVCTYPE)); } break; - + case OMX_IndexParamVideoSliceFMO: { OMX_VIDEO_PARAM_AVCSLICEFMO *pDstSliceFmo = (OMX_VIDEO_PARAM_AVCSLICEFMO *)pComponentParameterStructure; @@ -1428,7 +1428,7 @@ OMX_ERRORTYPE Exynos_H264Enc_SetParameter( } break; #endif -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 case OMX_IndexParamSharedOutputFD: { EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = NULL; @@ -1621,7 +1621,7 @@ OMX_ERRORTYPE Exynos_H264Enc_GetExtensionIndex( if (Exynos_OSAL_Strcmp(cParameterName, EXYNOS_INDEX_CONFIG_VIDEO_INTRAPERIOD) == 0) { *pIndexType = OMX_IndexConfigVideoIntraPeriod; ret = OMX_ErrorNone; -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 } else if (Exynos_OSAL_Strcmp(cParameterName, EXYNOS_INDEX_PARAM_ENC_SHARED_OUTPUT_FD) == 0) { *pIndexType = (OMX_INDEXTYPE) OMX_IndexParamSharedOutputFD; goto EXIT; @@ -1696,7 +1696,7 @@ OMX_ERRORTYPE Exynos_H264Enc_Init(OMX_COMPONENTTYPE *pOMXComponent) eColorFormat = pExynosInputPort->portDefinition.format.video.eColorFormat; if (pExynosInputPort->bStoreMetaData == OMX_TRUE) { -#ifndef SLP_PLATFORM /* we do not use OMX_COLOR_FormatAndroidOpaque */ +#ifndef TIZEN_FEATURE_E3250 /* we do not use OMX_COLOR_FormatAndroidOpaque */ if (eColorFormat == OMX_COLOR_FormatAndroidOpaque) { pExynosInputPort->bufferProcessType = BUFFER_COPY; } else { @@ -1712,7 +1712,7 @@ OMX_ERRORTYPE Exynos_H264Enc_Init(OMX_COMPONENTTYPE *pOMXComponent) } } -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 if (pVideoEnc->bSharedOutputFD == OMX_TRUE) { pExynosOutputPort->bufferProcessType = BUFFER_SHARE; } else { @@ -1851,7 +1851,7 @@ OMX_ERRORTYPE Exynos_H264Enc_Terminate(OMX_COMPONENTTYPE *pOMXComponent) if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) { for (i = 0; i < MFC_OUTPUT_BUFFER_NUM_MAX; i++) { if (pVideoEnc->pMFCEncOutputBuffer[i] != NULL) { -#ifndef SLP_PLATFORM /* do not use ion */ +#ifndef TIZEN_FEATURE_E3250 /* do not use ion */ if (pVideoEnc->pMFCEncOutputBuffer[i]->pVirAddr[0] != NULL) Exynos_OSAL_SharedMemory_Free(pVideoEnc->hSharedMemory, pVideoEnc->pMFCEncOutputBuffer[i]->pVirAddr[0]); #endif @@ -1873,7 +1873,7 @@ OMX_ERRORTYPE Exynos_H264Enc_Terminate(OMX_COMPONENTTYPE *pOMXComponent) if (pH264Enc->hMFCH264Handle.bShareableBuf == OMX_TRUE) { for (i = 0; i < MFC_INPUT_BUFFER_NUM_MAX; i++) { if (pVideoEnc->pMFCEncInputBuffer[i] != NULL) { -#ifndef SLP_PLATFORM /* do not use ion */ +#ifndef TIZEN_FEATURE_E3250 /* do not use ion */ for (plane = 0; plane < MFC_INPUT_BUFFER_PLANE; plane++) { if (pVideoEnc->pMFCEncInputBuffer[i]->pVirAddr[plane] != NULL) Exynos_OSAL_SharedMemory_Free(pVideoEnc->hSharedMemory, pVideoEnc->pMFCEncInputBuffer[i]->pVirAddr[plane]); @@ -2460,7 +2460,7 @@ OSCL_EXPORT_REF OMX_ERRORTYPE Exynos_OMX_ComponentInit( pExynosPort->portDefinition.format.video.eCompressionFormat = OMX_VIDEO_CodingUnused; Exynos_OSAL_Memset(pExynosPort->portDefinition.format.video.cMIMEType, 0, MAX_OMX_MIMETYPE_SIZE); Exynos_OSAL_Strcpy(pExynosPort->portDefinition.format.video.cMIMEType, "raw/video"); -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 pExynosPort->portDefinition.format.video.eColorFormat = OMX_SEC_COLOR_FormatNV12L_DmaBuf_Fd; #else pExynosPort->portDefinition.format.video.eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar; @@ -2517,7 +2517,7 @@ OSCL_EXPORT_REF OMX_ERRORTYPE Exynos_OMX_ComponentInit( pVideoEnc->exynos_codec_getCodecInputPrivateData = &GetCodecInputPrivateData; pVideoEnc->exynos_codec_getCodecOutputPrivateData = &GetCodecOutputPrivateData; -#ifndef SLP_PLATFORM /* do not use ion */ +#ifndef TIZEN_FEATURE_E3250 /* do not use ion */ pVideoEnc->hSharedMemory = Exynos_OSAL_SharedMemory_Open(); if (pVideoEnc->hSharedMemory == NULL) { Exynos_OSAL_Free(pH264Enc); @@ -2554,7 +2554,7 @@ OMX_ERRORTYPE Exynos_OMX_ComponentDeinit(OMX_HANDLETYPE hComponent) pOMXComponent = (OMX_COMPONENTTYPE *)hComponent; pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle; -#ifndef SLP_PLATFORM /* do not use ion */ +#ifndef TIZEN_FEATURE_E3250 /* do not use ion */ Exynos_OSAL_SharedMemory_Close(pVideoEnc->hSharedMemory); #endif Exynos_OSAL_Free(pExynosComponent->componentName); diff --git a/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c b/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c index c8b189f..c3519a0 100755 --- a/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c +++ b/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c @@ -245,7 +245,7 @@ static void Set_Mpeg4Enc_Param(EXYNOS_OMX_BASECOMPONENT *pExynosComponent) switch ((EXYNOS_OMX_COLOR_FORMATTYPE)pExynosInputPort->portDefinition.format.video.eColorFormat) { case OMX_COLOR_FormatYUV420SemiPlanar: case OMX_COLOR_FormatYUV420Planar: /* Converted to NV12 in Exynos_Preprocessor_InputData */ -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 case OMX_SEC_COLOR_FormatNV12L_DmaBuf_Fd: #endif #ifdef USE_METADATABUFFERTYPE @@ -345,7 +345,7 @@ static void Set_H263Enc_Param(EXYNOS_OMX_BASECOMPONENT *pExynosComponent) switch ((EXYNOS_OMX_COLOR_FORMATTYPE)pExynosInputPort->portDefinition.format.video.eColorFormat) { case OMX_COLOR_FormatYUV420SemiPlanar: case OMX_COLOR_FormatYUV420Planar: /* Converted to NV12 in Exynos_Preprocessor_InputData */ -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 case OMX_SEC_COLOR_FormatNV12L_DmaBuf_Fd: #endif #ifdef USE_METADATABUFFERTYPE @@ -892,7 +892,7 @@ OMX_ERRORTYPE Mpeg4CodecSrcInit(OMX_COMPONENTTYPE *pOMXComponent) /*************/ /* Does not require any actions. */ } else { -#ifndef SLP_PLATFORM /* slp platform can go into here */ +#ifndef TIZEN_FEATURE_E3250 /* slp platform can go into here */ Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to get input buffer info"); ret = OMX_ErrorNotImplemented; goto EXIT; @@ -1837,7 +1837,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_Init(OMX_COMPONENTTYPE *pOMXComponent) eColorFormat = pExynosInputPort->portDefinition.format.video.eColorFormat; if (pExynosInputPort->bStoreMetaData == OMX_TRUE) { -#ifndef SLP_PLATFORM /* we do not use OMX_COLOR_FormatAndroidOpaque */ +#ifndef TIZEN_FEATURE_E3250 /* we do not use OMX_COLOR_FormatAndroidOpaque */ if (eColorFormat == OMX_COLOR_FormatAndroidOpaque) { pExynosInputPort->bufferProcessType = BUFFER_COPY; } else { @@ -1985,7 +1985,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_Terminate(OMX_COMPONENTTYPE *pOMXComponent) if (pMpeg4Enc->hMFCMpeg4Handle.bShareableBuf == OMX_TRUE) { for (i = 0; i < MFC_INPUT_BUFFER_NUM_MAX; i++) { if (pVideoEnc->pMFCEncInputBuffer[i] != NULL) { -#ifndef SLP_PLATFORM /* do not use ion */ +#ifndef TIZEN_FEATURE_E3250 /* do not use ion */ for (plane = 0; plane < MFC_INPUT_BUFFER_PLANE; plane++) { if (pVideoEnc->pMFCEncInputBuffer[i]->pVirAddr[plane] != NULL) Exynos_OSAL_SharedMemory_Free(pVideoEnc->hSharedMemory, pVideoEnc->pMFCEncInputBuffer[i]->pVirAddr[plane]); @@ -2009,7 +2009,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_Terminate(OMX_COMPONENTTYPE *pOMXComponent) if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { for (i = 0; i < MFC_INPUT_BUFFER_NUM_MAX; i++) { if (pVideoEnc->pMFCEncInputBuffer[i] != NULL) { -#ifndef SLP_PLATFORM /* do not use ion */ +#ifndef TIZEN_FEATURE_E3250 /* do not use ion */ for (plane = 0; plane < MFC_INPUT_BUFFER_PLANE; plane++) { if (pVideoEnc->pMFCEncInputBuffer[i]->pVirAddr[plane] != NULL) Exynos_OSAL_SharedMemory_Free(pVideoEnc->hSharedMemory, pVideoEnc->pMFCEncInputBuffer[i]->pVirAddr[plane]); @@ -2073,7 +2073,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_SrcIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX pVideoEnc->configChange = OMX_FALSE; } - + if ((pSrcInputData->dataLen >= 0) || ((pSrcInputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS)) { OMX_U32 pMFCYUVDataSize[MFC_INPUT_BUFFER_PLANE] = {NULL, NULL}; @@ -2570,7 +2570,7 @@ OSCL_EXPORT_REF OMX_ERRORTYPE Exynos_OMX_ComponentInit( pExynosPort->portDefinition.format.video.bFlagErrorConcealment = OMX_FALSE; Exynos_OSAL_Memset(pExynosPort->portDefinition.format.video.cMIMEType, 0, MAX_OMX_MIMETYPE_SIZE); Exynos_OSAL_Strcpy(pExynosPort->portDefinition.format.video.cMIMEType, "raw/video"); -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 pExynosPort->portDefinition.format.video.eColorFormat = OMX_SEC_COLOR_FormatNV12L_DmaBuf_Fd; #else pExynosPort->portDefinition.format.video.eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar; @@ -2658,7 +2658,7 @@ OSCL_EXPORT_REF OMX_ERRORTYPE Exynos_OMX_ComponentInit( pVideoEnc->exynos_codec_getCodecInputPrivateData = &GetCodecInputPrivateData; pVideoEnc->exynos_codec_getCodecOutputPrivateData = &GetCodecOutputPrivateData; -#ifndef SLP_PLATFORM /* do not use ion */ +#ifndef TIZEN_FEATURE_E3250 /* do not use ion */ pVideoEnc->hSharedMemory = Exynos_OSAL_SharedMemory_Open(); if (pVideoEnc->hSharedMemory == NULL) { Exynos_OSAL_Free(pMpeg4Enc); @@ -2695,7 +2695,7 @@ OMX_ERRORTYPE Exynos_OMX_ComponentDeinit(OMX_HANDLETYPE hComponent) pOMXComponent = (OMX_COMPONENTTYPE *)hComponent; pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle; -#ifndef SLP_PLATFORM /* do not use ion */ +#ifndef TIZEN_FEATURE_E3250 /* do not use ion */ Exynos_OSAL_SharedMemory_Close(pVideoEnc->hSharedMemory); #endif Exynos_OSAL_Free(pExynosComponent->componentName); diff --git a/openmax/core/Exynos_OMX_Core.h b/openmax/core/Exynos_OMX_Core.h old mode 100644 new mode 100755 index 655becd..baa3a86 --- a/openmax/core/Exynos_OMX_Core.h +++ b/openmax/core/Exynos_OMX_Core.h @@ -38,7 +38,7 @@ extern "C" { #endif -#ifdef SLP_PLATFORM /* build env */ +#ifdef TIZEN_FEATURE_E3250 /* build env */ #define Exynos_OMX_Init OMX_Init #define Exynos_OMX_Deinit OMX_Deinit #define Exynos_OMX_ComponentNameEnum OMX_ComponentNameEnum diff --git a/openmax/include/exynos/Exynos_OMX_Def.h b/openmax/include/exynos/Exynos_OMX_Def.h index c533aa9..8c66038 100755 --- a/openmax/include/exynos/Exynos_OMX_Def.h +++ b/openmax/include/exynos/Exynos_OMX_Def.h @@ -31,10 +31,10 @@ #include "OMX_IVCommon.h" #define VERSIONMAJOR_NUMBER 1 -#ifndef SLP_PLATFORM /* omx version */ +#ifndef TIZEN_FEATURE_E3250 /* omx version */ #define VERSIONMINOR_NUMBER 0 #else -#define VERSIONMINOR_NUMBER 1 +#define VERSIONMINOR_NUMBER 1 #endif #define REVISION_NUMBER 0 #define STEP_NUMBER 0 @@ -85,7 +85,7 @@ typedef enum _EXYNOS_OMX_INDEXTYPE OMX_IndexVendorS3DMode = 0x7F000003, #endif -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 #define EXYNOS_INDEX_PARAM_ENABLE_PB "OMX.SEC.index.enablePlatformSpecificBuffers" OMX_IndexParamEnablePlatformSpecificBuffers = 0x7F000011, #else @@ -103,7 +103,7 @@ typedef enum _EXYNOS_OMX_INDEXTYPE /* prepend SPS/PPS to I/IDR for H.264 Encoder */ #define EXYNOS_INDEX_PARAM_PREPEND_SPSPPS_TO_IDR "OMX.SEC.index.prependSPSPPSToIDRFrames" OMX_IndexParamPrependSPSPPSToIDR = 0x7F000015, -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 /* avi demux timestamp reorder */ #define EXYNOS_INDEX_PARAM_ENABLE_TS_REORDER "OMX.SEC.index.enableTimestampReorder" OMX_IndexParamEnableTimestampReorder = 0x7F000016, @@ -149,7 +149,7 @@ typedef enum _EXYNOS_OMX_TRANS_STATETYPE { } EXYNOS_OMX_TRANS_STATETYPE; typedef enum _EXYNOS_OMX_COLOR_FORMATTYPE { -#ifdef SLP_PLATFORM /* dmabuf fd color format */ +#ifdef TIZEN_FEATURE_E3250 /* dmabuf fd color format */ OMX_SEC_COLOR_FormatNV12T_DmaBuf_Fd = 0x7F000001, /* use same value with phyaddr */ OMX_SEC_COLOR_FormatNV12L_DmaBuf_Fd = 0x7F000002, #else @@ -219,69 +219,7 @@ typedef enum _EXYNOS_OMX_FPARGMT_TYPE #define EXYNOS_IMPORT_REF __attribute__((visibility("default"))) #endif -#ifdef SLP_PLATFORM -/* for using ST12, set the hw addr at SCMN_IMGB type buffer */ -#define SCMN_IMGB_MAX_PLANE (4) /* max channel count */ - -/* image buffer definition - +------------------------------------------+ --- - | | ^ - | a[], p[] | | - | +---------------------------+ --- | | - | | | ^ | | - | |<---------- w[] ---------->| | | | - | | | | | | - | | | | - | | | h[] | e[] - | | | | - | | | | | | - | | | | | | - | | | v | | - | +---------------------------+ --- | | - | | v - +------------------------------------------+ --- - - |<----------------- s[] ------------------>| -*/ - -typedef struct -{ - int w[SCMN_IMGB_MAX_PLANE]; /* width of each image plane */ - int h[SCMN_IMGB_MAX_PLANE]; /* height of each image plane */ - int s[SCMN_IMGB_MAX_PLANE]; /* stride of each image plane */ - int e[SCMN_IMGB_MAX_PLANE]; /* elevation of each image plane */ - void * a[SCMN_IMGB_MAX_PLANE]; /* user space address of each image plane */ - void * p[SCMN_IMGB_MAX_PLANE]; /* physical address of each image plane, if needs */ - int cs; /* color space type of image */ - int x; /* left postion, if needs */ - int y; /* top position, if needs */ - int __dummy2; /* to align memory */ - int data[16]; /* arbitrary data */ - - /* dmabuf fd */ - int fd[SCMN_IMGB_MAX_PLANE]; - - /* flag for buffer share */ - int buf_share_method; - - /* Y plane size in case of ST12 */ - int y_size; - /* UV plane size in case of ST12 */ - int uv_size; - - /* Tizen buffer object of each image plane */ - void *bo[SCMN_IMGB_MAX_PLANE]; - - /* JPEG data */ - void *jpeg_data; - /* JPEG size */ - int jpeg_size; - - /* tzmem buffer */ - int tz_enable; -} SCMN_IMGB; - - +#ifdef TIZEN_FEATURE_E3250 typedef enum { MEMORY_PADDR = 0, MEMORY_DMABUF, diff --git a/openmax/osal/Exynos_OSAL_Log.c b/openmax/osal/Exynos_OSAL_Log.c old mode 100644 new mode 100755 index 0d31d8b..752a5f8 --- a/openmax/osal/Exynos_OSAL_Log.c +++ b/openmax/osal/Exynos_OSAL_Log.c @@ -23,7 +23,7 @@ * @history * 2012.02.20 : Create */ -#ifndef SLP_PLATFORM /* build env */ +#ifndef TIZEN_FEATURE_E3250 /* build env */ #include #else #ifdef USE_DLOG @@ -36,13 +36,13 @@ #include "Exynos_OSAL_Log.h" -#ifdef SLP_PLATFORM /* build env */ +#ifdef TIZEN_FEATURE_E3250 /* build env */ static int component_debug_level = -1; #endif void _Exynos_OSAL_Log(EXYNOS_LOG_LEVEL logLevel, const char *tag, const char *msg, ...) { -#ifndef SLP_PLATFORM +#ifndef TIZEN_FEATURE_E3250 va_list argptr; va_start(argptr, msg); diff --git a/openmax/osal/Exynos_OSAL_Log.h b/openmax/osal/Exynos_OSAL_Log.h old mode 100644 new mode 100755 index 3e14116..66657cb --- a/openmax/osal/Exynos_OSAL_Log.h +++ b/openmax/osal/Exynos_OSAL_Log.h @@ -32,7 +32,7 @@ extern "C" { #endif -#ifndef SLP_PLATFORM +#ifndef TIZEN_FEATURE_E3250 #ifndef EXYNOS_LOG_OFF #define EXYNOS_LOG #endif @@ -44,11 +44,11 @@ extern "C" { #ifdef EXYNOS_TRACE_ON #define EXYNOS_TRACE #endif -#endif /* SLP_PLATFORM */ +#endif /* TIZEN_FEATURE_E3250 */ typedef enum _LOG_LEVEL { -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 EXYNOS_LOG_VERVOSE, #endif EXYNOS_LOG_TRACE, @@ -57,7 +57,7 @@ typedef enum _LOG_LEVEL EXYNOS_LOG_ERROR } EXYNOS_LOG_LEVEL; -#ifndef SLP_PLATFORM +#ifndef TIZEN_FEATURE_E3250 #ifdef EXYNOS_LOG #define Exynos_OSAL_Log(a, ...) ((void)_Exynos_OSAL_Log(a, EXYNOS_LOG_TAG, __VA_ARGS__)) @@ -77,7 +77,7 @@ typedef enum _LOG_LEVEL #define FunctionOut() ((void *)0) #endif -#else /* SLP_PLATFORM */ +#else /* TIZEN_FEATURE_E3250 */ #define OMX_DEBUG_LEVEL 2 /* EXYNOS_LOG_INFO */ @@ -97,7 +97,7 @@ typedef enum _LOG_LEVEL #define FunctionOut() _Exynos_OSAL_Log(EXYNOS_LOG_VERVOSE, EXYNOS_LOG_TAG, EXYNOS_LOG_TAG"] %s Out , Line: %d", __FUNCTION__, __LINE__) #endif -#endif /* SLP_PLATFORM */ +#endif /* TIZEN_FEATURE_E3250 */ extern void _Exynos_OSAL_Log(EXYNOS_LOG_LEVEL logLevel, const char *tag, const char *msg, ...); diff --git a/openmax/osal/Exynos_OSAL_Memory.c b/openmax/osal/Exynos_OSAL_Memory.c old mode 100644 new mode 100755 index 70552c4..04c9d84 --- a/openmax/osal/Exynos_OSAL_Memory.c +++ b/openmax/osal/Exynos_OSAL_Memory.c @@ -39,7 +39,7 @@ static int mem_cnt = 0; OMX_PTR Exynos_OSAL_Malloc(OMX_U32 size) { mem_cnt++; -#ifndef SLP_PLATFORM +#ifndef TIZEN_FEATURE_E3250 Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "alloc count: %d", mem_cnt); #else Exynos_OSAL_Log(EXYNOS_LOG_VERVOSE, "alloc count: %d", mem_cnt); @@ -51,7 +51,7 @@ OMX_PTR Exynos_OSAL_Malloc(OMX_U32 size) void Exynos_OSAL_Free(OMX_PTR addr) { mem_cnt--; -#ifndef SLP_PLATFORM +#ifndef TIZEN_FEATURE_E3250 Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "free count: %d", mem_cnt); #else Exynos_OSAL_Log(EXYNOS_LOG_VERVOSE, "free count: %d", mem_cnt); diff --git a/openmax/osal/Exynos_OSAL_Platform_Specific.c b/openmax/osal/Exynos_OSAL_Platform_Specific.c index 69c9dad..a0be86a 100755 --- a/openmax/osal/Exynos_OSAL_Platform_Specific.c +++ b/openmax/osal/Exynos_OSAL_Platform_Specific.c @@ -118,7 +118,7 @@ OMX_ERRORTYPE Exynos_OSAL_UnlockPBHandle(OMX_IN OMX_U32 handle) FunctionIn(); OMX_ERRORTYPE ret = OMX_ErrorNone; -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 #else GraphicBufferMapper &mapper = GraphicBufferMapper::get(); buffer_handle_t bufferHandle = (buffer_handle_t) handle; @@ -151,7 +151,7 @@ OMX_ERRORTYPE Exynos_OSAL_LockPB( FunctionIn(); OMX_ERRORTYPE ret = OMX_ErrorNone; -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 ExynosVideoPlane *vplanes = (ExynosVideoPlane *) planes; MMVideoBuffer *buffer = (MMVideoBuffer *) pBuffer; @@ -183,7 +183,7 @@ EXIT: return ret; } -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 OMX_ERRORTYPE Exynos_OSAL_UnlockPB(OMX_IN OMX_PTR pBuffer, EXYNOS_OMX_DATA *pData, EXYNOS_OMX_BASEPORT *pExynosPort,EXYNOS_OMX_BASEPORT *pExynosInPort) #else OMX_ERRORTYPE Exynos_OSAL_UnlockPB(OMX_IN OMX_PTR pBuffer, EXYNOS_OMX_DATA *pData) @@ -192,7 +192,7 @@ OMX_ERRORTYPE Exynos_OSAL_UnlockPB(OMX_IN OMX_PTR pBuffer, EXYNOS_OMX_DATA *pDat FunctionIn(); OMX_ERRORTYPE ret = OMX_ErrorNone; -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 MMVideoBuffer *pSlpOutBuf = NULL; DECODE_CODEC_EXTRA_BUFFERINFO *pBufferInfo = NULL; @@ -411,7 +411,7 @@ OMX_ERRORTYPE Exynos_OSAL_GetPBParameter( } switch (nIndex) { -#if 0 /* SLP_PLATFORM */ +#if 0 /* TIZEN_FEATURE_E3250 */ case OMX_IndexParamGetAndroidNativeBuffer: { GetAndroidNativeBufferUsageParams *pANBParams = (GetAndroidNativeBufferUsageParams *) ComponentParameterStructure; @@ -495,7 +495,7 @@ OMX_ERRORTYPE Exynos_OSAL_SetPBParameter( pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle; switch (nIndex) { -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 case OMX_IndexParamEnablePlatformSpecificBuffers: #else case OMX_IndexParamEnableAndroidBuffers: @@ -524,7 +524,7 @@ OMX_ERRORTYPE Exynos_OSAL_SetPBParameter( goto EXIT; } -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 /* PB and DPB Buffer Sharing */ if ((portIndex == OUTPUT_PORT_INDEX) && ((pExynosPort->bufferProcessType & BUFFER_PBSHARE) == BUFFER_PBSHARE)) { @@ -545,7 +545,7 @@ OMX_ERRORTYPE Exynos_OSAL_SetPBParameter( } break; -#if 0 /* SLP_PLATFORM */ +#if 0 /* TIZEN_FEATURE_E3250 */ case OMX_IndexParamUseAndroidNativeBuffer: { UseAndroidNativeBufferParams *pANBParams = (UseAndroidNativeBufferParams *) ComponentParameterStructure; diff --git a/openmax/osal/Exynos_OSAL_Platform_Specific.h b/openmax/osal/Exynos_OSAL_Platform_Specific.h index 488b93e..672d407 100755 --- a/openmax/osal/Exynos_OSAL_Platform_Specific.h +++ b/openmax/osal/Exynos_OSAL_Platform_Specific.h @@ -70,7 +70,7 @@ OMX_ERRORTYPE Exynos_OSAL_LockPB(OMX_IN OMX_PTR pBuffer, OMX_OUT OMX_U32 *pStride, OMX_OUT OMX_PTR planes); -#ifdef SLP_PLATFORM +#ifdef TIZEN_FEATURE_E3250 OMX_ERRORTYPE Exynos_OSAL_UnlockPB(OMX_IN OMX_PTR pBuffer, OMX_IN EXYNOS_OMX_DATA *pData, EXYNOS_OMX_BASEPORT *pExynosPort, EXYNOS_OMX_BASEPORT *pExynosInPort); #else OMX_ERRORTYPE Exynos_OSAL_UnlockPB(OMX_IN OMX_PTR pBuffer, OMX_IN EXYNOS_OMX_DATA *pData); @@ -88,7 +88,7 @@ OMX_ERRORTYPE Exynos_OSAL_UnlockPBHandle(OMX_IN OMX_U32 pBuffer); OMX_ERRORTYPE Exynos_OSAL_GetInfoFromMetaData(OMX_IN OMX_BYTE pBuffer, OMX_OUT OMX_PTR *pOutBuffer); -#if 0 /* SLP_PLATFORM */ +#if 0 /* TIZEN_FEATURE_E3250 */ OMX_ERRORTYPE Exynos_OSAL_CheckPB(OMX_IN EXYNOS_OMX_DATA *pBuffer, OMX_OUT OMX_BOOL *bIsPBEnabled); #endif diff --git a/openmax/osal/Exynos_OSAL_SharedMemory.c b/openmax/osal/Exynos_OSAL_SharedMemory.c old mode 100644 new mode 100755 index 6fa1a25..93c2416 --- a/openmax/osal/Exynos_OSAL_SharedMemory.c +++ b/openmax/osal/Exynos_OSAL_SharedMemory.c @@ -31,7 +31,7 @@ #include #include #include -#ifndef SLP_PLATFORM /* build env */ +#ifndef TIZEN_FEATURE_E3250 /* build env */ #include #include #endif @@ -211,7 +211,7 @@ OMX_PTR Exynos_OSAL_SharedMemory_Alloc(OMX_HANDLETYPE handle, OMX_U32 size, MEMO Exynos_OSAL_MutexUnlock(pHandle->hSMMutex); mem_cnt++; -#ifndef SLP_PLATFORM +#ifndef TIZEN_FEATURE_E3250 Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "SharedMemory alloc count: %d", mem_cnt); #else Exynos_OSAL_Log(EXYNOS_LOG_VERVOSE, "SharedMemory alloc count: %d", mem_cnt); @@ -273,7 +273,7 @@ void Exynos_OSAL_SharedMemory_Free(OMX_HANDLETYPE handle, OMX_PTR pBuffer) Exynos_OSAL_Free(pDeleteElement); mem_cnt--; -#ifndef SLP_PLATFORM +#ifndef TIZEN_FEATURE_E3250 Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "SharedMemory free count: %d", mem_cnt); #else Exynos_OSAL_Log(EXYNOS_LOG_VERVOSE, "SharedMemory free count: %d", mem_cnt); @@ -334,7 +334,7 @@ OMX_PTR Exynos_OSAL_SharedMemory_Map(OMX_HANDLETYPE handle, OMX_U32 size, unsign Exynos_OSAL_MutexUnlock(pHandle->hSMMutex); mem_cnt++; -#ifndef SLP_PLATFORM +#ifndef TIZEN_FEATURE_E3250 Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "SharedMemory alloc count: %d", mem_cnt); #else Exynos_OSAL_Log(EXYNOS_LOG_VERVOSE, "SharedMemory alloc count: %d", mem_cnt); @@ -393,7 +393,7 @@ void Exynos_OSAL_SharedMemory_Unmap(OMX_HANDLETYPE handle, unsigned int ionfd) Exynos_OSAL_Free(pDeleteElement); mem_cnt--; -#ifndef SLP_PLATFORM +#ifndef TIZEN_FEATURE_E3250 Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "SharedMemory free count: %d", mem_cnt); #else Exynos_OSAL_Log(EXYNOS_LOG_VERVOSE, "SharedMemory free count: %d", mem_cnt); diff --git a/packaging/libomxil-e3250-v4l2.spec b/packaging/libomxil-e3250-v4l2.spec index 5f62e2c..a95793f 100755 --- a/packaging/libomxil-e3250-v4l2.spec +++ b/packaging/libomxil-e3250-v4l2.spec @@ -1,6 +1,6 @@ Name: libomxil-e3250-v4l2 Summary: OpenMAX IL for e3250-v4l2 -Version: 0.1.2 +Version: 0.1.3 License: Apache-2.0 Group: Development/Libraries Release: 0 diff --git a/srp.pc.in b/srp.pc.in old mode 100755 new mode 100644 index d7cc67a..00ff12c --- a/srp.pc.in +++ b/srp.pc.in @@ -8,5 +8,5 @@ Version: @VERSION@ Requires: Libs: -L${libdir} -lsrp -Cflags: -I${includedir}/srp -DSLP_PLATFORM +Cflags: -I${includedir}/srp -DTIZEN_FEATURE_E3250 -- 2.7.4 From dcd5810e5c7202c8df2e1ea76105c3ade62a3a04 Mon Sep 17 00:00:00 2001 From: Sejun Park Date: Fri, 24 Mar 2017 17:04:33 +0900 Subject: [PATCH 06/16] Sync with tizen3.0 Change-Id: I0f82e8662a0a161e6cf4253459054dc1e6b05a37 --- openmax/component/video/dec/h264/Exynos_OMX_H264dec.c | 2 +- openmax/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c | 2 +- openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c | 2 +- openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c | 2 +- openmax/component/video/enc/h264/Exynos_OMX_H264enc.c | 2 +- openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c b/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c index 6a30ffa..156c812 100755 --- a/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c +++ b/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c @@ -2240,12 +2240,12 @@ OMX_ERRORTYPE Exynos_H264Dec_SrcOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { int i = 0; while (pSrcOutputData->buffer.singlePlaneBuffer.dataBuffer != pVideoDec->pMFCDecInputBuffer[i]->pVirAddr[0]) { + i++; if (i >= MFC_INPUT_BUFFER_NUM_MAX) { Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Can not find buffer"); ret = (OMX_ERRORTYPE)OMX_ErrorCodecDecode; goto EXIT; } - i++; } pVideoDec->pMFCDecInputBuffer[i]->dataSize = 0; pSrcOutputData->pPrivate = pVideoDec->pMFCDecInputBuffer[i]; diff --git a/openmax/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c b/openmax/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c index 74e15ac..6c6b0eb 100755 --- a/openmax/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c +++ b/openmax/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c @@ -1583,12 +1583,12 @@ OMX_ERRORTYPE Exynos_Mpeg2Dec_SrcOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OM if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { int i = 0; while (pSrcOutputData->buffer.singlePlaneBuffer.dataBuffer != pVideoDec->pMFCDecInputBuffer[i]->pVirAddr[0]) { + i++; if (i >= MFC_INPUT_BUFFER_NUM_MAX) { Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Can not find buffer"); ret = (OMX_ERRORTYPE)OMX_ErrorCodecDecode; goto EXIT; } - i++; } pVideoDec->pMFCDecInputBuffer[i]->dataSize = 0; pSrcOutputData->pPrivate = pVideoDec->pMFCDecInputBuffer[i]; diff --git a/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c b/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c index d7daa97..b9ebf0d 100755 --- a/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c +++ b/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c @@ -2333,12 +2333,12 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_SrcOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OM if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { int i = 0; while (pSrcOutputData->buffer.singlePlaneBuffer.dataBuffer != pVideoDec->pMFCDecInputBuffer[i]->pVirAddr[0]) { + i++; if (i >= MFC_INPUT_BUFFER_NUM_MAX) { Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Can not find buffer"); ret = (OMX_ERRORTYPE)OMX_ErrorCodecDecode; goto EXIT; } - i++; } pVideoDec->pMFCDecInputBuffer[i]->dataSize = 0; pSrcOutputData->pPrivate = pVideoDec->pMFCDecInputBuffer[i]; diff --git a/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c b/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c index 7897a37..9b6663f 100755 --- a/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c +++ b/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c @@ -2216,12 +2216,12 @@ OMX_ERRORTYPE Exynos_WmvDec_SrcOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_ if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { int i = 0; while (pSrcOutputData->buffer.singlePlaneBuffer.dataBuffer != pVideoDec->pMFCDecInputBuffer[i]->pVirAddr[0]) { + i++; if (i >= MFC_INPUT_BUFFER_NUM_MAX) { Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Can not find buffer"); ret = (OMX_ERRORTYPE)OMX_ErrorCodecDecode; goto EXIT; } - i++; } pVideoDec->pMFCDecInputBuffer[i]->dataSize = 0; pSrcOutputData->pPrivate = pVideoDec->pMFCDecInputBuffer[i]; diff --git a/openmax/component/video/enc/h264/Exynos_OMX_H264enc.c b/openmax/component/video/enc/h264/Exynos_OMX_H264enc.c index 9a223b5..2173513 100755 --- a/openmax/component/video/enc/h264/Exynos_OMX_H264enc.c +++ b/openmax/component/video/enc/h264/Exynos_OMX_H264enc.c @@ -2069,12 +2069,12 @@ OMX_ERRORTYPE Exynos_H264Enc_SrcOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { int i = 0; while (pSrcOutputData->buffer.multiPlaneBuffer.dataBuffer[0] != pVideoEnc->pMFCEncInputBuffer[i]->pVirAddr[0]) { + i++; if (i >= MFC_INPUT_BUFFER_NUM_MAX) { Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "%s: %d: Failed - Lost buffer", __FUNCTION__, __LINE__); ret = (OMX_ERRORTYPE)OMX_ErrorCodecEncode; goto EXIT; } - i++; } pVideoEnc->pMFCEncInputBuffer[i]->dataSize = 0; pSrcOutputData->pPrivate = pVideoEnc->pMFCEncInputBuffer[i]; diff --git a/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c b/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c index c3519a0..c582237 100755 --- a/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c +++ b/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c @@ -2186,12 +2186,12 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_SrcOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OM if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { int i = 0; while (pSrcOutputData->buffer.multiPlaneBuffer.dataBuffer[0] != pVideoEnc->pMFCEncInputBuffer[i]->pVirAddr[0]) { + i++; if (i >= MFC_INPUT_BUFFER_NUM_MAX) { Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "%s: %d: Failed - Lost buffer", __FUNCTION__, __LINE__); ret = (OMX_ERRORTYPE)OMX_ErrorCodecEncode; goto EXIT; } - i++; } pVideoEnc->pMFCEncInputBuffer[i]->dataSize = 0; pSrcOutputData->pPrivate = pVideoEnc->pMFCEncInputBuffer[i]; -- 2.7.4 From 82249be3b68d82a5da30229c129f1f2733295c67 Mon Sep 17 00:00:00 2001 From: Sejun Park Date: Fri, 7 Apr 2017 13:45:36 +0900 Subject: [PATCH 07/16] fixed svace issues Change-Id: Iede5e427ef9a70ad4418902cf266379987399c20 --- openmax/component/video/dec/h264/Exynos_OMX_H264dec.c | 4 +++- openmax/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c | 4 +++- openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c | 8 +++----- openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c | 4 +++- openmax/core/Exynos_OMX_Core.c | 2 +- openmax/osal/Exynos_OSAL_ETC.c | 2 +- 6 files changed, 14 insertions(+), 10 deletions(-) diff --git a/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c b/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c index 156c812..62f2380 100755 --- a/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c +++ b/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c @@ -146,6 +146,7 @@ EXIT: return ret; } +#ifndef TIZEN_FEATURE_E3250 int Check_H264_Frame( OMX_U8 *pInputStream, OMX_U32 buffSize, @@ -224,6 +225,7 @@ EXIT: return accessUnitSize; } +#endif static OMX_BOOL Check_H264_StartCode( OMX_U8 *pInputStream, @@ -2786,7 +2788,7 @@ OSCL_EXPORT_REF OMX_ERRORTYPE Exynos_OMX_ComponentInit(OMX_HANDLETYPE hComponent pVideoDec->exynos_codec_enqueueAllBuffer = &H264CodecEnQueueAllBuffer; pVideoDec->exynos_codec_resetupAllElement = &H264CodecResetupAllElement; - pVideoDec->exynos_checkInputFrame = &Check_H264_Frame; + pVideoDec->exynos_checkInputFrame = NULL; pVideoDec->exynos_codec_getCodecInputPrivateData = &GetCodecInputPrivateData; pVideoDec->exynos_codec_getCodecOutputPrivateData = &GetCodecOutputPrivateData; diff --git a/openmax/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c b/openmax/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c index 6c6b0eb..cb77ee1 100755 --- a/openmax/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c +++ b/openmax/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c @@ -96,6 +96,7 @@ EXIT: return ret; } +#ifndef TIZEN_FEATURE_E3250 int Check_Mpeg2_Frame( OMX_U8 *pInputStream, int buffSize, @@ -116,6 +117,7 @@ int Check_Mpeg2_Frame( FunctionOut(); return buffSize; } +#endif static OMX_BOOL Check_Mpeg2_StartCode( OMX_U8 *pInputStream, @@ -2063,7 +2065,7 @@ OSCL_EXPORT_REF OMX_ERRORTYPE Exynos_OMX_ComponentInit( pVideoDec->exynos_codec_bufferProcessRun = &Mpeg2CodecOutputBufferProcessRun; pVideoDec->exynos_codec_enqueueAllBuffer = &Mpeg2CodecEnQueueAllBuffer; - pVideoDec->exynos_checkInputFrame = &Check_Mpeg2_Frame; + pVideoDec->exynos_checkInputFrame = NULL; pVideoDec->exynos_codec_getCodecInputPrivateData = &GetCodecInputPrivateData; pVideoDec->exynos_codec_getCodecOutputPrivateData = &GetCodecOutputPrivateData; diff --git a/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c b/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c index b9ebf0d..7d99bcf 100755 --- a/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c +++ b/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c @@ -158,6 +158,7 @@ EXIT: static OMX_BOOL gbFIMV1 = OMX_FALSE; +#ifndef TIZEN_FEATURE_E3250 static int Check_Mpeg4_Frame( OMX_U8 *pInputStream, OMX_U32 buffSize, @@ -296,6 +297,7 @@ EXIT : return --len; } +#endif static OMX_BOOL Check_Stream_StartCode( OMX_U8 *pInputStream, @@ -2879,11 +2881,7 @@ OSCL_EXPORT_REF OMX_ERRORTYPE Exynos_OMX_ComponentInit(OMX_HANDLETYPE hComponent pVideoDec->exynos_codec_enqueueAllBuffer = &Mpeg4CodecEnQueueAllBuffer; pVideoDec->exynos_codec_resetupAllElement = &Mpeg4CodecResetupAllElement; - if (codecType == CODEC_TYPE_MPEG4) - pVideoDec->exynos_checkInputFrame = &Check_Mpeg4_Frame; - else - pVideoDec->exynos_checkInputFrame = &Check_H263_Frame; - + pVideoDec->exynos_checkInputFrame = NULL; pVideoDec->exynos_codec_getCodecInputPrivateData = &GetCodecInputPrivateData; pVideoDec->exynos_codec_getCodecOutputPrivateData = &GetCodecOutputPrivateData; diff --git a/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c b/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c index 9b6663f..cbd65e9 100755 --- a/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c +++ b/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c @@ -109,6 +109,7 @@ EXIT: return ret; } +#ifndef TIZEN_FEATURE_E3250 int Check_Wmv_Frame( OMX_U8 *pInputStream, OMX_U32 buffSize, @@ -204,6 +205,7 @@ EXIT : return --len; } +#endif static OMX_BOOL Check_Stream_PrefixCode( OMX_U8 *pInputStream, @@ -2745,7 +2747,7 @@ OSCL_EXPORT_REF OMX_ERRORTYPE Exynos_OMX_ComponentInit( pVideoDec->exynos_codec_enqueueAllBuffer = &WmvCodecEnQueueAllBuffer; pVideoDec->exynos_codec_resetupAllElement = &WmvCodecResetupAllElement; - pVideoDec->exynos_checkInputFrame = &Check_Wmv_Frame; + pVideoDec->exynos_checkInputFrame = NULL; pVideoDec->exynos_codec_getCodecInputPrivateData = &GetCodecInputPrivateData; pVideoDec->exynos_codec_getCodecOutputPrivateData = &GetCodecOutputPrivateData; diff --git a/openmax/core/Exynos_OMX_Core.c b/openmax/core/Exynos_OMX_Core.c index 4e12c13..0cabd0a 100644 --- a/openmax/core/Exynos_OMX_Core.c +++ b/openmax/core/Exynos_OMX_Core.c @@ -211,7 +211,7 @@ OMX_API OMX_ERRORTYPE OMX_APIENTRY Exynos_OMX_FreeHandle(OMX_IN OMX_HANDLETYPE h { OMX_ERRORTYPE ret = OMX_ErrorNone; EXYNOS_OMX_COMPONENT *currentComponent; - EXYNOS_OMX_COMPONENT *deleteComponent; + EXYNOS_OMX_COMPONENT *deleteComponent = NULL; FunctionIn(); diff --git a/openmax/osal/Exynos_OSAL_ETC.c b/openmax/osal/Exynos_OSAL_ETC.c index e6d73ed..b4a9920 100644 --- a/openmax/osal/Exynos_OSAL_ETC.c +++ b/openmax/osal/Exynos_OSAL_ETC.c @@ -37,7 +37,7 @@ static struct timeval perfStart[PERF_ID_MAX+1], perfStop[PERF_ID_MAX+1]; static unsigned long perfTime[PERF_ID_MAX+1], totalPerfTime[PERF_ID_MAX+1]; static unsigned int perfFrameCount[PERF_ID_MAX+1], perfOver30ms[PERF_ID_MAX+1]; -#ifndef HAVE_GETLINE +#ifdef HAVE_GETLINE ssize_t getline(char **ppLine, size_t *pLen, FILE *pStream) { char *pCurrentPointer = NULL; -- 2.7.4 From eaf509d901b3695895d7f462e543f4b846395a78 Mon Sep 17 00:00:00 2001 From: Sejun Park Date: Wed, 10 May 2017 14:51:39 +0900 Subject: [PATCH 08/16] fixed symbol lookup error when building in unified profile Change-Id: Ic63dcec03a834113b6152ec7cc9b340ae03f265a --- openmax/component/video/dec/Exynos_OMX_Vdec.c | 4 ++-- openmax/component/video/dec/Exynos_OMX_Vdec.h | 2 +- openmax/component/video/enc/Exynos_OMX_Venc.c | 2 +- openmax/component/video/enc/Exynos_OMX_Venc.h | 2 +- openmax/osal/Exynos_OSAL_Platform_Specific.c | 2 +- packaging/libomxil-e3250-v4l2.spec | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/openmax/component/video/dec/Exynos_OMX_Vdec.c b/openmax/component/video/dec/Exynos_OMX_Vdec.c index 877c0e6..d426153 100644 --- a/openmax/component/video/dec/Exynos_OMX_Vdec.c +++ b/openmax/component/video/dec/Exynos_OMX_Vdec.c @@ -83,7 +83,7 @@ int calc_uvplane(int width, int height) return ALIGN(mbX * mbY, S5P_FIMV_DEC_BUF_ALIGN); } -inline void Exynos_UpdateFrameSize(OMX_COMPONENTTYPE *pOMXComponent) +void Exynos_UpdateFrameSize(OMX_COMPONENTTYPE *pOMXComponent) { EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; EXYNOS_OMX_BASEPORT *exynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; @@ -336,7 +336,7 @@ OMX_BOOL Exynos_CSC_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA #ifdef USE_PB if (exynosOutputPort->bIsPBEnabled == OMX_TRUE) { ExynosVideoPlane planes[MAX_BUFFER_PLANE]; - OMX_U32 stride; + OMX_U32 stride = 0; Exynos_OSAL_LockPB(pOutputBuf, width, height, exynosOutputPort->portDefinition.format.video.eColorFormat, &stride, planes); width = stride; outputUseBuffer->dataLen = sizeof(void *); diff --git a/openmax/component/video/dec/Exynos_OMX_Vdec.h b/openmax/component/video/dec/Exynos_OMX_Vdec.h index 78843ea..89fe484 100644 --- a/openmax/component/video/dec/Exynos_OMX_Vdec.h +++ b/openmax/component/video/dec/Exynos_OMX_Vdec.h @@ -156,7 +156,7 @@ extern "C" { int calc_plane(int width, int height); int calc_yplane(int width, int height); int calc_uvplane(int width, int height); -inline void Exynos_UpdateFrameSize(OMX_COMPONENTTYPE *pOMXComponent); +void Exynos_UpdateFrameSize(OMX_COMPONENTTYPE *pOMXComponent); OMX_BOOL Exynos_Check_BufferProcess_State(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, OMX_U32 nPortIndex); OMX_ERRORTYPE Exynos_Input_CodecBufferToData(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, OMX_PTR codecBuffer, EXYNOS_OMX_DATA *pData); OMX_ERRORTYPE Exynos_Output_CodecBufferToData(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, OMX_PTR codecBuffer, EXYNOS_OMX_DATA *pData); diff --git a/openmax/component/video/enc/Exynos_OMX_Venc.c b/openmax/component/video/enc/Exynos_OMX_Venc.c index 5ce89c6..c66643c 100755 --- a/openmax/component/video/enc/Exynos_OMX_Venc.c +++ b/openmax/component/video/enc/Exynos_OMX_Venc.c @@ -48,7 +48,7 @@ #include "Exynos_OSAL_Log.h" -inline void Exynos_UpdateFrameSize(OMX_COMPONENTTYPE *pOMXComponent) +void Exynos_UpdateFrameSize(OMX_COMPONENTTYPE *pOMXComponent) { EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; EXYNOS_OMX_BASEPORT *exynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; diff --git a/openmax/component/video/enc/Exynos_OMX_Venc.h b/openmax/component/video/enc/Exynos_OMX_Venc.h index 426123c..bdd3b08 100755 --- a/openmax/component/video/enc/Exynos_OMX_Venc.h +++ b/openmax/component/video/enc/Exynos_OMX_Venc.h @@ -133,7 +133,7 @@ typedef struct _EXYNOS_OMX_VIDEOENC_COMPONENT extern "C" { #endif -inline void Exynos_UpdateFrameSize(OMX_COMPONENTTYPE *pOMXComponent); +void Exynos_UpdateFrameSize(OMX_COMPONENTTYPE *pOMXComponent); OMX_BOOL Exynos_Check_BufferProcess_State(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, OMX_U32 nPortIndex); OMX_ERRORTYPE Exynos_Input_CodecBufferToData(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, OMX_PTR codecBuffer, EXYNOS_OMX_DATA *pData); OMX_ERRORTYPE Exynos_Output_CodecBufferToData(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, OMX_PTR codecBuffer, EXYNOS_OMX_DATA *pData); diff --git a/openmax/osal/Exynos_OSAL_Platform_Specific.c b/openmax/osal/Exynos_OSAL_Platform_Specific.c index a0be86a..e82d3d9 100755 --- a/openmax/osal/Exynos_OSAL_Platform_Specific.c +++ b/openmax/osal/Exynos_OSAL_Platform_Specific.c @@ -265,7 +265,7 @@ OMX_ERRORTYPE Exynos_OSAL_UnlockPB(OMX_IN OMX_PTR pBuffer, EXYNOS_OMX_DATA *pDat } - //pSlpOutBuf->type = 1; /* use fd mode */ + pSlpOutBuf->type = MM_VIDEO_BUFFER_TYPE_TBM_BO; /* use bo mode */ Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "fd (%d, %d, %d) received from MFC", pSlpOutBuf->handle.dmabuf_fd[0], pSlpOutBuf->handle.dmabuf_fd[1], pSlpOutBuf->handle.dmabuf_fd[2]); #else diff --git a/packaging/libomxil-e3250-v4l2.spec b/packaging/libomxil-e3250-v4l2.spec index a95793f..94612a9 100755 --- a/packaging/libomxil-e3250-v4l2.spec +++ b/packaging/libomxil-e3250-v4l2.spec @@ -1,6 +1,6 @@ Name: libomxil-e3250-v4l2 Summary: OpenMAX IL for e3250-v4l2 -Version: 0.1.3 +Version: 0.1.4 License: Apache-2.0 Group: Development/Libraries Release: 0 -- 2.7.4 From 209a5e483e5bf95c12e79cac71a0018225b62c06 Mon Sep 17 00:00:00 2001 From: Youngjae Shin Date: Tue, 22 Aug 2017 15:39:22 +0900 Subject: [PATCH 09/16] revise installing a license file Change-Id: I075d42dd647976aa227b1f95e3edf7647e7ce950 --- packaging/libomxil-e3250-v4l2.spec | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packaging/libomxil-e3250-v4l2.spec b/packaging/libomxil-e3250-v4l2.spec index 94612a9..8b5ccac 100755 --- a/packaging/libomxil-e3250-v4l2.spec +++ b/packaging/libomxil-e3250-v4l2.spec @@ -56,8 +56,6 @@ make %install rm -rf %{buildroot} -mkdir -p %{buildroot}/usr/share/license -cp COPYING %{buildroot}/usr/share/license/%{name} %make_install @@ -70,7 +68,7 @@ cp COPYING %{buildroot}/usr/share/license/%{name} %manifest libomxil-e3250-v4l2.manifest %{_libdir}/*.so* %{_libdir}/omx/*.so -%{_datadir}/license/%{name} +%license COPYING %files devel -- 2.7.4 From f34455209d002bbe1374cfbb01067d085efbb367 Mon Sep 17 00:00:00 2001 From: Sejun Park Date: Wed, 13 Sep 2017 14:46:33 +0900 Subject: [PATCH 10/16] Remove build warnings and fixed svace issues Change-Id: Ifa13b0b45b54aa57ca72477b0e238ac8edf82f71 --- openmax/component/audio/dec/Exynos_OMX_Adec.c | 50 +--------- .../component/audio/dec/mp3/Exynos_OMX_Mp3dec.c | 8 +- .../component/common/Exynos_OMX_Basecomponent.c | 11 +- .../component/common/Exynos_OMX_Basecomponent.h | 4 +- openmax/component/common/Exynos_OMX_Baseport.c | 8 -- openmax/component/common/Exynos_OMX_Baseport.h | 5 + .../component/common/Exynos_OMX_Resourcemanager.c | 3 +- openmax/component/video/dec/Exynos_OMX_Vdec.c | 71 ++++--------- openmax/component/video/dec/Exynos_OMX_Vdec.h | 2 + .../component/video/dec/Exynos_OMX_VdecControl.c | 55 ++-------- .../component/video/dec/Exynos_OMX_VdecControl.h | 6 ++ .../component/video/dec/h264/Exynos_OMX_H264dec.c | 80 +++------------ .../video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c | 67 ++----------- .../video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c | 86 +++------------- .../component/video/dec/vc1/Exynos_OMX_Wmvdec.c | 83 ++------------- openmax/component/video/enc/Exynos_OMX_Venc.c | 48 ++------- openmax/component/video/enc/Exynos_OMX_Venc.h | 2 +- .../component/video/enc/Exynos_OMX_VencControl.c | 77 +++----------- .../component/video/enc/Exynos_OMX_VencControl.h | 17 ++++ .../component/video/enc/h264/Exynos_OMX_H264enc.c | 94 +++-------------- .../component/video/enc/h264/Exynos_OMX_H264enc.h | 7 +- .../video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c | 111 ++++++--------------- .../video/enc/mpeg4/Exynos_OMX_Mpeg4enc.h | 6 +- openmax/core/Exynos_OMX_Component_Register.c | 9 +- openmax/core/Exynos_OMX_Core.c | 11 +- openmax/osal/Exynos_OSAL_Event.c | 1 + openmax/osal/Exynos_OSAL_Mutex.c | 2 - openmax/osal/Exynos_OSAL_Platform_Specific.c | 10 +- openmax/osal/Exynos_OSAL_SharedMemory.c | 2 + 29 files changed, 201 insertions(+), 735 deletions(-) mode change 100644 => 100755 openmax/component/common/Exynos_OMX_Basecomponent.h mode change 100644 => 100755 openmax/component/video/dec/Exynos_OMX_Vdec.c mode change 100644 => 100755 openmax/component/video/dec/Exynos_OMX_Vdec.h mode change 100644 => 100755 openmax/component/video/dec/Exynos_OMX_VdecControl.c mode change 100644 => 100755 openmax/component/video/dec/Exynos_OMX_VdecControl.h mode change 100755 => 100644 openmax/component/video/enc/Exynos_OMX_Venc.c mode change 100644 => 100755 openmax/component/video/enc/Exynos_OMX_VencControl.h mode change 100644 => 100755 openmax/component/video/enc/h264/Exynos_OMX_H264enc.h mode change 100644 => 100755 openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.h mode change 100644 => 100755 openmax/core/Exynos_OMX_Component_Register.c mode change 100644 => 100755 openmax/osal/Exynos_OSAL_Event.c mode change 100644 => 100755 openmax/osal/Exynos_OSAL_Mutex.c diff --git a/openmax/component/audio/dec/Exynos_OMX_Adec.c b/openmax/component/audio/dec/Exynos_OMX_Adec.c index 734d16a..0de66dc 100755 --- a/openmax/component/audio/dec/Exynos_OMX_Adec.c +++ b/openmax/component/audio/dec/Exynos_OMX_Adec.c @@ -241,8 +241,6 @@ OMX_ERRORTYPE Exynos_OMX_FreeBuffer( OMX_COMPONENTTYPE *pOMXComponent = NULL; EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL; EXYNOS_OMX_BASEPORT *pExynosPort = NULL; - OMX_BUFFERHEADERTYPE *temp_bufferHeader = NULL; - OMX_U8 *temp_buffer = NULL; OMX_U32 i = 0; FunctionIn(); @@ -318,29 +316,12 @@ EXIT: OMX_ERRORTYPE Exynos_OMX_AllocateTunnelBuffer(EXYNOS_OMX_BASEPORT *pOMXBasePort, OMX_U32 nPortIndex) { - OMX_ERRORTYPE ret = OMX_ErrorNone; - EXYNOS_OMX_BASEPORT *pExynosPort = NULL; - OMX_BUFFERHEADERTYPE *temp_bufferHeader = NULL; - OMX_U8 *temp_buffer = NULL; - OMX_U32 bufferSize = 0; - OMX_PARAM_PORTDEFINITIONTYPE portDefinition; - - ret = OMX_ErrorTunnelingUnsupported; -EXIT: - return ret; + return OMX_ErrorTunnelingUnsupported; } OMX_ERRORTYPE Exynos_OMX_FreeTunnelBuffer(EXYNOS_OMX_BASEPORT *pOMXBasePort, OMX_U32 nPortIndex) { - OMX_ERRORTYPE ret = OMX_ErrorNone; - EXYNOS_OMX_BASEPORT* pExynosPort = NULL; - OMX_BUFFERHEADERTYPE* temp_bufferHeader = NULL; - OMX_U8 *temp_buffer = NULL; - OMX_U32 bufferSize = 0; - - ret = OMX_ErrorTunnelingUnsupported; -EXIT: - return ret; + return OMX_ErrorTunnelingUnsupported; } OMX_ERRORTYPE Exynos_OMX_ComponentTunnelRequest( @@ -350,11 +331,7 @@ OMX_ERRORTYPE Exynos_OMX_ComponentTunnelRequest( OMX_IN OMX_U32 nTunneledPort, OMX_INOUT OMX_TUNNELSETUPTYPE *pTunnelSetup) { - OMX_ERRORTYPE ret = OMX_ErrorNone; - - ret = OMX_ErrorTunnelingUnsupported; -EXIT: - return ret; + return OMX_ErrorTunnelingUnsupported; } OMX_BOOL Exynos_Check_BufferProcess_State(EXYNOS_OMX_BASECOMPONENT *pExynosComponent) @@ -419,7 +396,6 @@ OMX_ERRORTYPE Exynos_InputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent) dataBuffer->nFlags = 0; dataBuffer->timeStamp = 0; -EXIT: FunctionOut(); return ret; @@ -526,7 +502,6 @@ OMX_ERRORTYPE Exynos_OutputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent) dataBuffer->nFlags = 0; dataBuffer->timeStamp = 0; -EXIT: FunctionOut(); return ret; @@ -770,7 +745,6 @@ OMX_ERRORTYPE Exynos_OMX_BufferProcess(OMX_HANDLETYPE hComponent) EXYNOS_OMX_DATABUFFER *outputUseBuffer = &exynosOutputPort->way.port1WayDataBuffer.dataBuffer; EXYNOS_OMX_DATA *inputData = &exynosInputPort->processData; EXYNOS_OMX_DATA *outputData = &exynosOutputPort->processData; - OMX_U32 copySize = 0; pExynosComponent->reInputData = OMX_FALSE; @@ -824,7 +798,7 @@ OMX_ERRORTYPE Exynos_OMX_BufferProcess(OMX_HANDLETYPE hComponent) Exynos_OSAL_MutexUnlock(outputUseBuffer->bufferMutex); Exynos_OSAL_MutexUnlock(inputUseBuffer->bufferMutex); - if (ret == OMX_ErrorInputDataDecodeYet) + if (ret == (OMX_ERRORTYPE)OMX_ErrorInputDataDecodeYet) pExynosComponent->reInputData = OMX_TRUE; else pExynosComponent->reInputData = OMX_FALSE; @@ -835,8 +809,6 @@ OMX_ERRORTYPE Exynos_OMX_BufferProcess(OMX_HANDLETYPE hComponent) } } -EXIT: - FunctionOut(); return ret; @@ -870,7 +842,6 @@ OMX_ERRORTYPE Exynos_OMX_FlushPort(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 por EXYNOS_OMX_DATABUFFER *flushPortBuffer = NULL; OMX_BUFFERHEADERTYPE *bufferHeader = NULL; EXYNOS_OMX_MESSAGE *message = NULL; - OMX_U32 flushNum = 0; OMX_S32 semValue = 0; FunctionIn(); @@ -926,7 +897,6 @@ OMX_ERRORTYPE Exynos_OMX_FlushPort(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 por pExynosPort->processData.timeStamp = 0; pExynosPort->processData.usedDataLen = 0; -EXIT: FunctionOut(); return ret; @@ -936,10 +906,8 @@ OMX_ERRORTYPE Exynos_OMX_BufferFlush(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 n { OMX_ERRORTYPE ret = OMX_ErrorNone; EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL; - EXYNOS_OMX_AUDIODEC_COMPONENT *pAudioDec = NULL; EXYNOS_OMX_BASEPORT *pExynosPort = NULL; EXYNOS_OMX_DATABUFFER *flushPortBuffer = NULL; - OMX_U32 i = 0, cnt = 0; FunctionIn(); #ifdef TIZEN_FEATURE_E3250 @@ -960,7 +928,6 @@ OMX_ERRORTYPE Exynos_OMX_BufferFlush(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 n goto EXIT; } pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; - pAudioDec = (EXYNOS_OMX_AUDIODEC_COMPONENT *)pExynosComponent->hComponentHandle; Exynos_OSAL_SignalSet(pExynosComponent->pauseEvent); @@ -1014,7 +981,6 @@ OMX_ERRORTYPE Exynos_OMX_AudioDecodeGetParameter( OMX_ERRORTYPE ret = OMX_ErrorNone; OMX_COMPONENTTYPE *pOMXComponent = NULL; EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL; - EXYNOS_OMX_BASEPORT *pExynosPort = NULL; FunctionIn(); @@ -1124,7 +1090,6 @@ OMX_ERRORTYPE Exynos_OMX_AudioDecodeSetParameter( OMX_ERRORTYPE ret = OMX_ErrorNone; OMX_COMPONENTTYPE *pOMXComponent = NULL; EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL; - EXYNOS_OMX_BASEPORT *pExynosPort = NULL; FunctionIn(); @@ -1159,10 +1124,8 @@ OMX_ERRORTYPE Exynos_OMX_AudioDecodeSetParameter( { OMX_AUDIO_PARAM_PORTFORMATTYPE *portFormat = (OMX_AUDIO_PARAM_PORTFORMATTYPE *)ComponentParameterStructure; OMX_U32 portIndex = portFormat->nPortIndex; - OMX_U32 index = portFormat->nIndex; EXYNOS_OMX_BASEPORT *pExynosPort = NULL; OMX_PARAM_PORTDEFINITIONTYPE *portDefinition = NULL; - OMX_U32 supportFormatNum = 0; /* supportFormatNum = N-1 */ ret = Exynos_OMX_Check_SizeVersion(portFormat, sizeof(OMX_AUDIO_PARAM_PORTFORMATTYPE)); if (ret != OMX_ErrorNone) { @@ -1350,8 +1313,6 @@ static OMX_ERRORTYPE Exynos_OMX_BufferProcessThread(OMX_PTR threadData) { OMX_ERRORTYPE ret = OMX_ErrorNone; OMX_COMPONENTTYPE *pOMXComponent = NULL; - EXYNOS_OMX_BASECOMPONENT *pSECComponent = NULL; - EXYNOS_OMX_MESSAGE *message = NULL; FunctionIn(); @@ -1364,7 +1325,6 @@ static OMX_ERRORTYPE Exynos_OMX_BufferProcessThread(OMX_PTR threadData) if (ret != OMX_ErrorNone) { goto EXIT; } - pSECComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; Exynos_OMX_BufferProcess(pOMXComponent); Exynos_OSAL_ThreadExit(NULL); @@ -1390,7 +1350,6 @@ OMX_ERRORTYPE Exynos_OMX_BufferProcess_Create(OMX_HANDLETYPE hComponent) Exynos_OMX_BufferProcessThread, pOMXComponent); -EXIT: FunctionOut(); return ret; @@ -1419,7 +1378,6 @@ OMX_ERRORTYPE Exynos_OMX_BufferProcess_Terminate(OMX_HANDLETYPE hComponent) Exynos_OSAL_ThreadTerminate(pAudioDec->hBufferProcessThread); pAudioDec->hBufferProcessThread = NULL; -EXIT: FunctionOut(); return ret; diff --git a/openmax/component/audio/dec/mp3/Exynos_OMX_Mp3dec.c b/openmax/component/audio/dec/mp3/Exynos_OMX_Mp3dec.c index 56cc7d5..1ba3815 100755 --- a/openmax/component/audio/dec/mp3/Exynos_OMX_Mp3dec.c +++ b/openmax/component/audio/dec/mp3/Exynos_OMX_Mp3dec.c @@ -130,7 +130,6 @@ OMX_ERRORTYPE Exynos_SRP_Mp3Dec_GetParameter( break; case OMX_IndexParamStandardComponentRole: { - OMX_S32 codecType; OMX_PARAM_COMPONENTROLETYPE *pComponentRole = (OMX_PARAM_COMPONENTROLETYPE *)pComponentParameterStructure; ret = Exynos_OMX_Check_SizeVersion(pComponentRole, sizeof(OMX_PARAM_COMPONENTROLETYPE)); @@ -397,7 +396,6 @@ OMX_ERRORTYPE Exynos_SRP_Mp3Dec_ComponentRoleEnum( OMX_ERRORTYPE ret = OMX_ErrorNone; OMX_COMPONENTTYPE *pOMXComponent = NULL; EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL; - OMX_S32 codecType; FunctionIn(); @@ -458,7 +456,6 @@ OMX_ERRORTYPE Exynos_SRP_Mp3Dec_Init(OMX_COMPONENTTYPE *pOMXComponent) outFile = fopen("/data/OutFile.pcm", "w+"); #endif -EXIT: FunctionOut(); return ret; @@ -467,7 +464,6 @@ EXIT: OMX_ERRORTYPE Exynos_SRP_Mp3Dec_Terminate(OMX_COMPONENTTYPE *pOMXComponent) { OMX_ERRORTYPE ret = OMX_ErrorNone; - EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; FunctionIn(); @@ -476,7 +472,6 @@ OMX_ERRORTYPE Exynos_SRP_Mp3Dec_Terminate(OMX_COMPONENTTYPE *pOMXComponent) fclose(outFile); #endif -EXIT: FunctionOut(); return ret; @@ -678,7 +673,7 @@ OMX_ERRORTYPE Exynos_SRP_Mp3Dec_bufferProcess(OMX_COMPONENTTYPE *pOMXComponent, ret = Exynos_SRP_Mp3_Decode_Block(pOMXComponent, pInputData, pOutputData); if (ret != OMX_ErrorNone) { - if (ret == OMX_ErrorInputDataDecodeYet) { + if (ret == (OMX_ERRORTYPE)OMX_ErrorInputDataDecodeYet) { pOutputData->usedDataLen = 0; pOutputData->remainDataLen = pOutputData->dataLen; } else { @@ -717,7 +712,6 @@ OSCL_EXPORT_REF OMX_ERRORTYPE Exynos_OMX_ComponentInit(OMX_HANDLETYPE hComponent unsigned int outputBufferSize = 0; unsigned int outputBufferNum = 0; OMX_S32 returnCodec; - int i = 0; FunctionIn(); diff --git a/openmax/component/common/Exynos_OMX_Basecomponent.c b/openmax/component/common/Exynos_OMX_Basecomponent.c index b440efe..4cf6289 100755 --- a/openmax/component/common/Exynos_OMX_Basecomponent.c +++ b/openmax/component/common/Exynos_OMX_Basecomponent.c @@ -172,7 +172,6 @@ OMX_ERRORTYPE Exynos_OMX_ComponentStateSet(OMX_COMPONENTTYPE *pOMXComponent, OMX OMX_STATETYPE destState = messageParam; OMX_STATETYPE currentState = pExynosComponent->currentState; EXYNOS_OMX_BASEPORT *pExynosPort = NULL; - OMX_S32 countValue = 0; unsigned int i = 0, j = 0; int k = 0; @@ -677,7 +676,6 @@ static OMX_ERRORTYPE Exynos_StateSet(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, static OMX_ERRORTYPE Exynos_SetPortFlush(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, OMX_U32 nParam) { OMX_ERRORTYPE ret = OMX_ErrorNone; - EXYNOS_OMX_BASEPORT *pExynosPort = NULL; OMX_S32 portIndex = nParam; OMX_U16 i = 0, cnt = 0, index = 0; @@ -716,7 +714,7 @@ static OMX_ERRORTYPE Exynos_SetPortEnable(EXYNOS_OMX_BASECOMPONENT *pExynosCompo OMX_ERRORTYPE ret = OMX_ErrorNone; EXYNOS_OMX_BASEPORT *pExynosPort = NULL; OMX_S32 portIndex = nParam; - OMX_U16 i = 0, cnt = 0; + OMX_U16 i = 0; FunctionIn(); @@ -759,7 +757,7 @@ static OMX_ERRORTYPE Exynos_SetPortDisable(EXYNOS_OMX_BASECOMPONENT *pExynosComp OMX_ERRORTYPE ret = OMX_ErrorNone; EXYNOS_OMX_BASEPORT *pExynosPort = NULL; OMX_S32 portIndex = nParam; - OMX_U16 i = 0, cnt = 0; + OMX_U16 i = 0; FunctionIn(); @@ -795,10 +793,6 @@ EXIT: static OMX_ERRORTYPE Exynos_SetMarkBuffer(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, OMX_U32 nParam) { OMX_ERRORTYPE ret = OMX_ErrorNone; - EXYNOS_OMX_BASEPORT *pExynosPort = NULL; - OMX_U32 portIndex = nParam; - OMX_U16 i = 0, cnt = 0; - if (nParam >= pExynosComponent->portParam.nPorts) { ret = OMX_ErrorBadPortIndex; @@ -853,7 +847,6 @@ OMX_ERRORTYPE Exynos_OMX_SendCommand( OMX_ERRORTYPE ret = OMX_ErrorNone; OMX_COMPONENTTYPE *pOMXComponent = NULL; EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL; - EXYNOS_OMX_MESSAGE *message = NULL; FunctionIn(); diff --git a/openmax/component/common/Exynos_OMX_Basecomponent.h b/openmax/component/common/Exynos_OMX_Basecomponent.h old mode 100644 new mode 100755 index 6e889f8..5572639 --- a/openmax/component/common/Exynos_OMX_Basecomponent.h +++ b/openmax/component/common/Exynos_OMX_Basecomponent.h @@ -104,8 +104,8 @@ typedef struct _EXYNOS_OMX_BASECOMPONENT OMX_ERRORTYPE (*exynos_AllocateTunnelBuffer)(EXYNOS_OMX_BASEPORT *pOMXBasePort, OMX_U32 nPortIndex); OMX_ERRORTYPE (*exynos_FreeTunnelBuffer)(EXYNOS_OMX_BASEPORT *pOMXBasePort, OMX_U32 nPortIndex); - OMX_ERRORTYPE (*exynos_BufferProcessCreate)(OMX_COMPONENTTYPE *pOMXComponent); - OMX_ERRORTYPE (*exynos_BufferProcessTerminate)(OMX_COMPONENTTYPE *pOMXComponent); + OMX_ERRORTYPE (*exynos_BufferProcessCreate)(OMX_HANDLETYPE pOMXComponent); + OMX_ERRORTYPE (*exynos_BufferProcessTerminate)(OMX_HANDLETYPE pOMXComponent); OMX_ERRORTYPE (*exynos_BufferFlush)(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 nPortIndex, OMX_BOOL bEvent); } EXYNOS_OMX_BASECOMPONENT; diff --git a/openmax/component/common/Exynos_OMX_Baseport.c b/openmax/component/common/Exynos_OMX_Baseport.c index 552fa4d..999155c 100755 --- a/openmax/component/common/Exynos_OMX_Baseport.c +++ b/openmax/component/common/Exynos_OMX_Baseport.c @@ -99,9 +99,7 @@ OMX_ERRORTYPE Exynos_OMX_BufferFlushProcess(OMX_COMPONENTTYPE *pOMXComponent, OM { OMX_ERRORTYPE ret = OMX_ErrorNone; EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL; - EXYNOS_OMX_BASEPORT *pExynosPort = NULL; OMX_S32 portIndex = 0; - EXYNOS_OMX_DATABUFFER *flushPortBuffer[2] = {NULL, NULL}; OMX_U32 i = 0, cnt = 0; FunctionIn(); @@ -155,7 +153,6 @@ OMX_ERRORTYPE Exynos_OMX_EnablePort(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 po OMX_ERRORTYPE ret = OMX_ErrorNone; EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; EXYNOS_OMX_BASEPORT *pExynosPort = NULL; - OMX_U32 i = 0, cnt = 0; FunctionIn(); #ifdef TIZEN_FEATURE_E3250 @@ -173,7 +170,6 @@ OMX_ERRORTYPE Exynos_OMX_EnablePort(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 po ret = OMX_ErrorNone; -EXIT: FunctionOut(); return ret; @@ -242,7 +238,6 @@ OMX_ERRORTYPE Exynos_OMX_DisablePort(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 p OMX_ERRORTYPE ret = OMX_ErrorNone; EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; EXYNOS_OMX_BASEPORT *pExynosPort = NULL; - OMX_U32 i = 0, elemNum = 0; EXYNOS_OMX_MESSAGE *message; FunctionIn(); @@ -280,10 +275,8 @@ OMX_ERRORTYPE Exynos_OMX_PortDisableProcess(OMX_COMPONENTTYPE *pOMXComponent, OM { OMX_ERRORTYPE ret = OMX_ErrorNone; EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL; - EXYNOS_OMX_BASEPORT *pExynosPort = NULL; OMX_S32 portIndex = 0; OMX_U32 i = 0, cnt = 0; - EXYNOS_OMX_DATABUFFER *flushPortBuffer[2] = {NULL, NULL}; FunctionIn(); @@ -566,7 +559,6 @@ OMX_ERRORTYPE Exynos_OMX_Port_Constructor(OMX_HANDLETYPE hComponent) EXYNOS_OMX_BASEPORT *pExynosPort = NULL; EXYNOS_OMX_BASEPORT *pExynosInputPort = NULL; EXYNOS_OMX_BASEPORT *pExynosOutputPort = NULL; - int i = 0; FunctionIn(); diff --git a/openmax/component/common/Exynos_OMX_Baseport.h b/openmax/component/common/Exynos_OMX_Baseport.h index df52a3c..ee297c8 100755 --- a/openmax/component/common/Exynos_OMX_Baseport.h +++ b/openmax/component/common/Exynos_OMX_Baseport.h @@ -201,6 +201,9 @@ typedef struct _EXYNOS_OMX_BASEPORT extern "C" { #endif +OMX_ERRORTYPE Exynos_OMX_FillThisBuffer( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_IN OMX_BUFFERHEADERTYPE *pBuffer); OMX_ERRORTYPE Exynos_OMX_PortEnableProcess(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 nPortIndex); OMX_ERRORTYPE Exynos_OMX_PortDisableProcess(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 nPortIndex); OMX_ERRORTYPE Exynos_OMX_BufferFlushProcess(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 nPortIndex, OMX_BOOL bEvent); @@ -210,6 +213,8 @@ OMX_ERRORTYPE Exynos_ResetDataBuffer(EXYNOS_OMX_DATABUFFER *pDataBuffer); OMX_ERRORTYPE Exynos_ResetCodecData(EXYNOS_OMX_DATA *pData); OMX_ERRORTYPE Exynos_Shared_BufferToData(EXYNOS_OMX_DATABUFFER *pUseBuffer, EXYNOS_OMX_DATA *pData, EXYNOS_OMX_PLANE nPlane); OMX_ERRORTYPE Exynos_Shared_DataToBuffer(EXYNOS_OMX_DATA *pData, EXYNOS_OMX_DATABUFFER *pUseBuffer); +OMX_ERRORTYPE Exynos_OMX_InputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent, OMX_BUFFERHEADERTYPE* bufferHeader); +OMX_ERRORTYPE Exynos_OMX_OutputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent, OMX_BUFFERHEADERTYPE* bufferHeader); #ifdef __cplusplus }; diff --git a/openmax/component/common/Exynos_OMX_Resourcemanager.c b/openmax/component/common/Exynos_OMX_Resourcemanager.c index 7c3aa37..279a436 100755 --- a/openmax/component/common/Exynos_OMX_Resourcemanager.c +++ b/openmax/component/common/Exynos_OMX_Resourcemanager.c @@ -163,7 +163,6 @@ int searchLowPriority(EXYNOS_OMX_RM_COMPONENT_LIST *RMComp_list, OMX_U32 inComp_ else ret = 1; -EXIT: return ret; } @@ -258,7 +257,7 @@ OMX_ERRORTYPE Exynos_OMX_ResourceManager_Deinit() ghVideoRMComponentListMutex = NULL; ret = OMX_ErrorNone; -EXIT: + FunctionOut(); return ret; diff --git a/openmax/component/video/dec/Exynos_OMX_Vdec.c b/openmax/component/video/dec/Exynos_OMX_Vdec.c old mode 100644 new mode 100755 index d426153..3fa4f06 --- a/openmax/component/video/dec/Exynos_OMX_Vdec.c +++ b/openmax/component/video/dec/Exynos_OMX_Vdec.c @@ -35,10 +35,12 @@ #include "Exynos_OMX_Vdec.h" #include "Exynos_OMX_VdecControl.h" #include "Exynos_OMX_Basecomponent.h" +#include "Exynos_OMX_Baseport.h" #include "Exynos_OSAL_Thread.h" #include "Exynos_OSAL_Semaphore.h" #include "Exynos_OSAL_Mutex.h" #include "Exynos_OSAL_ETC.h" +#include "Exynos_OSAL_SharedMemory.h" #ifdef USE_PB #include "Exynos_OSAL_Platform_Specific.h" @@ -173,7 +175,6 @@ OMX_BOOL Exynos_Check_BufferProcess_State(EXYNOS_OMX_BASECOMPONENT *pExynosCompo OMX_ERRORTYPE Exynos_Input_CodecBufferToData(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, OMX_PTR codecBuffer, EXYNOS_OMX_DATA *pData) { OMX_ERRORTYPE ret = OMX_ErrorNone; - EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle; CODEC_DEC_BUFFER *pInputCodecBuffer = (CODEC_DEC_BUFFER *)codecBuffer; pData->buffer.singlePlaneBuffer.dataBuffer = pInputCodecBuffer->pVirAddr[0]; @@ -217,8 +218,6 @@ OMX_ERRORTYPE Exynos_Output_CodecBufferToData(EXYNOS_OMX_BASECOMPONENT *pExynosC void Exynos_Wait_ProcessPause(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, OMX_U32 nPortIndex) { - EXYNOS_OMX_BASEPORT *exynosOMXInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; - EXYNOS_OMX_BASEPORT *exynosOMXOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; EXYNOS_OMX_BASEPORT *exynosOMXPort = NULL; FunctionIn(); @@ -249,7 +248,6 @@ OMX_BOOL Exynos_CSC_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA EXYNOS_OMX_BASEPORT *exynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; EXYNOS_OMX_DATABUFFER *outputUseBuffer = &exynosOutputPort->way.port2WayDataBuffer.outputDataBuffer; - OMX_U32 copySize = 0; DECODE_CODEC_EXTRA_BUFFERINFO *pBufferInfo = NULL; #ifdef TIZEN_FEATURE_E3250 MMVideoBuffer *pSlpOutBuf = NULL; @@ -313,8 +311,7 @@ OMX_BOOL Exynos_CSC_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA pSlpOutBuf->handle.dmabuf_fd[2]); ret = OMX_TRUE; - goto EXIT; -#endif +#else pSrcBuf[0] = dstOutputData->buffer.multiPlaneBuffer.dataBuffer[0]; pSrcBuf[1] = dstOutputData->buffer.multiPlaneBuffer.dataBuffer[1]; @@ -327,9 +324,9 @@ OMX_BOOL Exynos_CSC_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA csc_get_method(pVideoDec->csc_handle, &csc_method); #ifdef USE_DMA_BUF if (csc_method == CSC_METHOD_HW) { - pSrcBuf[0] = dstOutputData->buffer.multiPlaneBuffer.fd[0]; - pSrcBuf[1] = dstOutputData->buffer.multiPlaneBuffer.fd[1]; - pSrcBuf[2] = dstOutputData->buffer.multiPlaneBuffer.fd[2]; + pSrcBuf[0] = (unsigned char *)(&dstOutputData->buffer.multiPlaneBuffer.fd[0]); + pSrcBuf[1] = (unsigned char *)(&dstOutputData->buffer.multiPlaneBuffer.fd[1]); + pSrcBuf[2] = (unsigned char *)(&dstOutputData->buffer.multiPlaneBuffer.fd[2]); } #endif @@ -356,7 +353,7 @@ OMX_BOOL Exynos_CSC_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA #ifdef USE_DMA_BUF if ((exynosOutputPort->bIsPBEnabled == OMX_FALSE) && (csc_method == CSC_METHOD_HW)) { - pYUVBuf[0] = Exynos_OSAL_SharedMemory_VirtToION(pVideoDec->hSharedMemory, pOutputBuf); + pYUVBuf[0] = Exynos_OSAL_SharedMemory_VirtToION(pVideoDec->hSharedMemory, (OMX_PTR)pOutputBuf); pYUVBuf[1] = NULL; pYUVBuf[2] = NULL; } @@ -402,7 +399,7 @@ OMX_BOOL Exynos_CSC_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA ret = OMX_FALSE; else ret = OMX_TRUE; - +#endif #ifdef USE_PB if (exynosOutputPort->bIsPBEnabled == OMX_TRUE) { #ifdef TIZEN_FEATURE_E3250 @@ -423,7 +420,6 @@ OMX_BOOL Exynos_Preprocessor_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_ { OMX_BOOL ret = OMX_FALSE; EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; - EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle; EXYNOS_OMX_BASEPORT *exynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; EXYNOS_OMX_DATABUFFER *inputUseBuffer = &exynosInputPort->way.port2WayDataBuffer.inputDataBuffer; OMX_U32 copySize = 0; @@ -445,6 +441,7 @@ OMX_BOOL Exynos_Preprocessor_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_ Exynos_Shared_BufferToData(inputUseBuffer, srcInputData, ONE_PLANE); #ifndef TIZEN_FEATURE_E3250 + EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle; if (pVideoDec->bDRMPlayerMode == OMX_TRUE) { OMX_PTR dataBuffer = NULL; @@ -526,12 +523,10 @@ OMX_BOOL Exynos_Postprocess_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_ { OMX_BOOL ret = OMX_FALSE; EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; - EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle; EXYNOS_OMX_BASEPORT *exynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; EXYNOS_OMX_BASEPORT *exynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; EXYNOS_OMX_DATABUFFER *outputUseBuffer = &exynosOutputPort->way.port2WayDataBuffer.outputDataBuffer; OMX_U32 copySize = 0; - DECODE_CODEC_EXTRA_BUFFERINFO *pBufferInfo = NULL; FunctionIn(); @@ -585,15 +580,7 @@ OMX_BOOL Exynos_Postprocess_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_ } if (exynosOutputPort->bufferProcessType & BUFFER_COPY) { - OMX_U32 width = 0, height = 0; - int imageSize = 0; - void *pOutputBuf = (void *)outputUseBuffer->bufferHeader->pBuffer; - - pBufferInfo = (DECODE_CODEC_EXTRA_BUFFERINFO *)dstOutputData->extInfo; - - width = pBufferInfo->imageWidth; - height = pBufferInfo->imageHeight; - imageSize = width * height; + //void *pOutputBuf = (void *)outputUseBuffer->bufferHeader->pBuffer; if ((dstOutputData->remainDataLen <= (outputUseBuffer->allocSize - outputUseBuffer->dataLen)) && (!CHECK_PORT_BEING_FLUSHED(exynosOutputPort))) { @@ -685,7 +672,6 @@ OMX_ERRORTYPE Exynos_OMX_SrcInputBufferProcess(OMX_HANDLETYPE hComponent) EXYNOS_OMX_DATABUFFER *srcInputUseBuffer = &exynosInputPort->way.port2WayDataBuffer.inputDataBuffer; EXYNOS_OMX_DATA *pSrcInputData = &exynosInputPort->processData; OMX_BOOL bCheckInputData = OMX_FALSE; - OMX_BOOL bValidCodecData = OMX_FALSE; OMX_BOOL bCodecConfigured = OMX_FALSE; FunctionIn(); @@ -699,13 +685,13 @@ OMX_ERRORTYPE Exynos_OMX_SrcInputBufferProcess(OMX_HANDLETYPE hComponent) Exynos_OSAL_SleepMillisec(0); if ((CHECK_PORT_BEING_FLUSHED(exynosInputPort)) || - ((exynosOutputPort->exceptionFlag == NEED_PORT_DISABLE) && (ret == OMX_ErrorInputDataDecodeYet))) + ((exynosOutputPort->exceptionFlag == NEED_PORT_DISABLE) && (ret == (OMX_ERRORTYPE)OMX_ErrorInputDataDecodeYet))) break; if (exynosInputPort->portState != OMX_StateIdle) break; Exynos_OSAL_MutexLock(srcInputUseBuffer->bufferMutex); - if (ret != OMX_ErrorInputDataDecodeYet) { + if (ret != (OMX_ERRORTYPE)OMX_ErrorInputDataDecodeYet) { if (exynosInputPort->bufferProcessType & BUFFER_COPY) { OMX_PTR codecBuffer; @@ -751,7 +737,7 @@ OMX_ERRORTYPE Exynos_OMX_SrcInputBufferProcess(OMX_HANDLETYPE hComponent) ret = pVideoDec->exynos_codec_srcInputProcess(pOMXComponent, pSrcInputData); - if (ret == OMX_ErrorCorruptedFrame) { + if (ret == (OMX_ERRORTYPE)OMX_ErrorCorruptedFrame) { if (exynosInputPort->bufferProcessType & BUFFER_COPY) { OMX_PTR codecBuffer; codecBuffer = pSrcInputData->pPrivate; @@ -764,17 +750,15 @@ OMX_ERRORTYPE Exynos_OMX_SrcInputBufferProcess(OMX_HANDLETYPE hComponent) } } - if (ret != OMX_ErrorInputDataDecodeYet) { + if (ret != (OMX_ERRORTYPE)OMX_ErrorInputDataDecodeYet) { Exynos_ResetCodecData(pSrcInputData); } Exynos_OSAL_MutexUnlock(srcInputUseBuffer->bufferMutex); - if (ret == OMX_ErrorCodecInit) + if (ret == (OMX_ERRORTYPE)OMX_ErrorCodecInit) pVideoDec->bExitBufferProcessThread = OMX_TRUE; } } -EXIT: - FunctionOut(); return ret; @@ -825,8 +809,6 @@ OMX_ERRORTYPE Exynos_OMX_SrcOutputBufferProcess(OMX_HANDLETYPE hComponent) } } -EXIT: - FunctionOut(); return ret; @@ -858,7 +840,7 @@ OMX_ERRORTYPE Exynos_OMX_DstInputBufferProcess(OMX_HANDLETYPE hComponent) break; Exynos_OSAL_MutexLock(dstInputUseBuffer->bufferMutex); - if (ret != OMX_ErrorOutputBufferUseYet) { + if (ret != (OMX_ERRORTYPE)OMX_ErrorOutputBufferUseYet) { if (exynosOutputPort->bufferProcessType & BUFFER_COPY) { OMX_PTR codecBuffer; ret = Exynos_CodecBufferDeQueue(pExynosComponent, OUTPUT_PORT_INDEX, &codecBuffer); @@ -900,15 +882,13 @@ OMX_ERRORTYPE Exynos_OMX_DstInputBufferProcess(OMX_HANDLETYPE hComponent) } ret = pVideoDec->exynos_codec_dstInputProcess(pOMXComponent, &dstInputData); - if (ret != OMX_ErrorOutputBufferUseYet) { + if (ret != (OMX_ERRORTYPE)OMX_ErrorOutputBufferUseYet) { Exynos_ResetCodecData(&dstInputData); } Exynos_OSAL_MutexUnlock(dstInputUseBuffer->bufferMutex); } } -EXIT: - FunctionOut(); return ret; @@ -973,8 +953,6 @@ OMX_ERRORTYPE Exynos_OMX_DstOutputBufferProcess(OMX_HANDLETYPE hComponent) } } -EXIT: - FunctionOut(); return ret; @@ -984,8 +962,6 @@ static OMX_ERRORTYPE Exynos_OMX_SrcInputProcessThread(OMX_PTR threadData) { OMX_ERRORTYPE ret = OMX_ErrorNone; OMX_COMPONENTTYPE *pOMXComponent = NULL; - EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL; - EXYNOS_OMX_MESSAGE *message = NULL; FunctionIn(); @@ -998,7 +974,6 @@ static OMX_ERRORTYPE Exynos_OMX_SrcInputProcessThread(OMX_PTR threadData) if (ret != OMX_ErrorNone) { goto EXIT; } - pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; Exynos_OMX_SrcInputBufferProcess(pOMXComponent); Exynos_OSAL_ThreadExit(NULL); @@ -1013,8 +988,6 @@ static OMX_ERRORTYPE Exynos_OMX_SrcOutputProcessThread(OMX_PTR threadData) { OMX_ERRORTYPE ret = OMX_ErrorNone; OMX_COMPONENTTYPE *pOMXComponent = NULL; - EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL; - EXYNOS_OMX_MESSAGE *message = NULL; FunctionIn(); @@ -1027,7 +1000,6 @@ static OMX_ERRORTYPE Exynos_OMX_SrcOutputProcessThread(OMX_PTR threadData) if (ret != OMX_ErrorNone) { goto EXIT; } - pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; Exynos_OMX_SrcOutputBufferProcess(pOMXComponent); Exynos_OSAL_ThreadExit(NULL); @@ -1042,8 +1014,6 @@ static OMX_ERRORTYPE Exynos_OMX_DstInputProcessThread(OMX_PTR threadData) { OMX_ERRORTYPE ret = OMX_ErrorNone; OMX_COMPONENTTYPE *pOMXComponent = NULL; - EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL; - EXYNOS_OMX_MESSAGE *message = NULL; FunctionIn(); @@ -1056,7 +1026,6 @@ static OMX_ERRORTYPE Exynos_OMX_DstInputProcessThread(OMX_PTR threadData) if (ret != OMX_ErrorNone) { goto EXIT; } - pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; Exynos_OMX_DstInputBufferProcess(pOMXComponent); Exynos_OSAL_ThreadExit(NULL); @@ -1071,8 +1040,6 @@ static OMX_ERRORTYPE Exynos_OMX_DstOutputProcessThread(OMX_PTR threadData) { OMX_ERRORTYPE ret = OMX_ErrorNone; OMX_COMPONENTTYPE *pOMXComponent = NULL; - EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL; - EXYNOS_OMX_MESSAGE *message = NULL; FunctionIn(); @@ -1085,7 +1052,6 @@ static OMX_ERRORTYPE Exynos_OMX_DstOutputProcessThread(OMX_PTR threadData) if (ret != OMX_ErrorNone) { goto EXIT; } - pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; Exynos_OMX_DstOutputBufferProcess(pOMXComponent); Exynos_OSAL_ThreadExit(NULL); @@ -1123,7 +1089,6 @@ OMX_ERRORTYPE Exynos_OMX_BufferProcess_Create(OMX_HANDLETYPE hComponent) Exynos_OMX_SrcInputProcessThread, pOMXComponent); -EXIT: FunctionOut(); return ret; @@ -1136,7 +1101,6 @@ OMX_ERRORTYPE Exynos_OMX_BufferProcess_Terminate(OMX_HANDLETYPE hComponent) EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle; OMX_S32 countValue = 0; - unsigned int i = 0; FunctionIn(); @@ -1174,7 +1138,6 @@ OMX_ERRORTYPE Exynos_OMX_BufferProcess_Terminate(OMX_HANDLETYPE hComponent) Exynos_OSAL_ThreadTerminate(pVideoDec->hDstOutputThread); pVideoDec->hDstOutputThread = NULL; -EXIT: FunctionOut(); return ret; diff --git a/openmax/component/video/dec/Exynos_OMX_Vdec.h b/openmax/component/video/dec/Exynos_OMX_Vdec.h old mode 100644 new mode 100755 index 89fe484..d125bd9 --- a/openmax/component/video/dec/Exynos_OMX_Vdec.h +++ b/openmax/component/video/dec/Exynos_OMX_Vdec.h @@ -168,6 +168,8 @@ OMX_ERRORTYPE Exynos_OMX_DstOutputBufferProcess(OMX_HANDLETYPE hComponent); OMX_ERRORTYPE Exynos_OMX_VideoDecodeComponentInit(OMX_IN OMX_HANDLETYPE hComponent); OMX_ERRORTYPE Exynos_OMX_VideoDecodeComponentDeinit(OMX_IN OMX_HANDLETYPE hComponent); +OMX_ERRORTYPE Exynos_OMX_BufferProcess_Create(OMX_HANDLETYPE hComponent); +OMX_ERRORTYPE Exynos_OMX_BufferProcess_Terminate(OMX_HANDLETYPE hComponent); #ifdef __cplusplus } #endif diff --git a/openmax/component/video/dec/Exynos_OMX_VdecControl.c b/openmax/component/video/dec/Exynos_OMX_VdecControl.c old mode 100644 new mode 100755 index b6db0e5..3a23044 --- a/openmax/component/video/dec/Exynos_OMX_VdecControl.c +++ b/openmax/component/video/dec/Exynos_OMX_VdecControl.c @@ -38,6 +38,7 @@ #include "Exynos_OSAL_Mutex.h" #include "Exynos_OSAL_ETC.h" #include "Exynos_OSAL_SharedMemory.h" +#include "Exynos_OMX_Baseport.h" #ifdef USE_PB #include "Exynos_OSAL_Platform_Specific.h" @@ -144,7 +145,7 @@ OMX_ERRORTYPE Exynos_OMX_UseBuffer( Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "\nPlatformBuffer: buf %d pYUVBuf[0]:0x%x , pYUVBuf[1]:0x%x ", i, pExynosPort->extendBufferHeader[i].pYUVBuf[0], pExynosPort->extendBufferHeader[i].pYUVBuf[1]); } else if ((pVideoDec->bDRMPlayerMode == OMX_TRUE) && (nPortIndex == INPUT_PORT_INDEX)) { - pExynosPort->extendBufferHeader[i].buf_fd[0] = pBuffer; + pExynosPort->extendBufferHeader[i].buf_fd[0] = (int)pBuffer; } else if(nPortIndex == INPUT_PORT_INDEX){ MMVideoBuffer * pSlpOutBuf = (MMVideoBuffer *)pBuffer; temp_bufferHeader->pBuffer = pSlpOutBuf->data[0]; @@ -270,7 +271,7 @@ OMX_ERRORTYPE Exynos_OMX_AllocateBuffer( pExynosPort->bufferStateAllocate[i] = (BUFFER_STATE_ALLOCATED | HEADER_STATE_ALLOCATED); INIT_SET_SIZE_VERSION(temp_bufferHeader, OMX_BUFFERHEADERTYPE); if (mem_type == SECURE_MEMORY) - temp_bufferHeader->pBuffer = temp_buffer_fd; + temp_bufferHeader->pBuffer = (OMX_U8 *)temp_buffer_fd; else temp_bufferHeader->pBuffer = temp_buffer; temp_bufferHeader->nAllocLen = nSizeBytes; @@ -313,8 +314,6 @@ OMX_ERRORTYPE Exynos_OMX_FreeBuffer( EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL; EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = NULL; EXYNOS_OMX_BASEPORT *pExynosPort = NULL; - OMX_BUFFERHEADERTYPE *temp_bufferHeader = NULL; - OMX_U8 *temp_buffer = NULL; OMX_U32 i = 0; FunctionIn(); @@ -396,29 +395,13 @@ EXIT: OMX_ERRORTYPE Exynos_OMX_AllocateTunnelBuffer(EXYNOS_OMX_BASEPORT *pOMXBasePort, OMX_U32 nPortIndex) { - OMX_ERRORTYPE ret = OMX_ErrorNone; - EXYNOS_OMX_BASEPORT *pExynosPort = NULL; - OMX_BUFFERHEADERTYPE *temp_bufferHeader = NULL; - OMX_U8 *temp_buffer = NULL; - OMX_U32 bufferSize = 0; - OMX_PARAM_PORTDEFINITIONTYPE portDefinition; - - ret = OMX_ErrorTunnelingUnsupported; -EXIT: - return ret; + + return OMX_ErrorTunnelingUnsupported; } OMX_ERRORTYPE Exynos_OMX_FreeTunnelBuffer(EXYNOS_OMX_BASEPORT *pOMXBasePort, OMX_U32 nPortIndex) { - OMX_ERRORTYPE ret = OMX_ErrorNone; - EXYNOS_OMX_BASEPORT* pExynosPort = NULL; - OMX_BUFFERHEADERTYPE* temp_bufferHeader = NULL; - OMX_U8 *temp_buffer = NULL; - OMX_U32 bufferSize = 0; - - ret = OMX_ErrorTunnelingUnsupported; -EXIT: - return ret; + return OMX_ErrorTunnelingUnsupported; } OMX_ERRORTYPE Exynos_OMX_ComponentTunnelRequest( @@ -428,11 +411,7 @@ OMX_ERRORTYPE Exynos_OMX_ComponentTunnelRequest( OMX_IN OMX_U32 nTunneledPort, OMX_INOUT OMX_TUNNELSETUPTYPE *pTunnelSetup) { - OMX_ERRORTYPE ret = OMX_ErrorNone; - - ret = OMX_ErrorTunnelingUnsupported; -EXIT: - return ret; + return OMX_ErrorTunnelingUnsupported; } OMX_ERRORTYPE Exynos_OMX_GetFlushBuffer(EXYNOS_OMX_BASEPORT *pExynosPort, EXYNOS_OMX_DATABUFFER *pDataBuffer[]) @@ -450,7 +429,6 @@ OMX_ERRORTYPE Exynos_OMX_GetFlushBuffer(EXYNOS_OMX_BASEPORT *pExynosPort, EXYNOS pDataBuffer[1] = &(pExynosPort->way.port2WayDataBuffer.outputDataBuffer); } -EXIT: FunctionOut(); return ret; @@ -465,7 +443,6 @@ OMX_ERRORTYPE Exynos_OMX_FlushPort(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 por OMX_BUFFERHEADERTYPE *bufferHeader = NULL; EXYNOS_OMX_DATABUFFER *pDataPortBuffer[2] = {NULL, NULL}; EXYNOS_OMX_MESSAGE *message = NULL; - OMX_U32 flushNum = 0; OMX_S32 semValue = 0; int i = 0, maxBufferNum = 0; FunctionIn(); @@ -548,7 +525,6 @@ OMX_ERRORTYPE Exynos_OMX_FlushPort(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 por } Exynos_OSAL_ResetQueue(&pExynosPort->bufferQ); -EXIT: FunctionOut(); return ret; @@ -561,7 +537,7 @@ OMX_ERRORTYPE Exynos_OMX_BufferFlush(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 n EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = NULL; EXYNOS_OMX_BASEPORT *pExynosPort = NULL; EXYNOS_OMX_DATABUFFER *flushPortBuffer[2] = {NULL, NULL}; - OMX_U32 i = 0, cnt = 0; + FunctionIn(); #ifdef TIZEN_FEATURE_E3250 @@ -700,7 +676,6 @@ OMX_ERRORTYPE Exynos_InputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent) /* reset dataBuffer */ Exynos_ResetDataBuffer(dataBuffer); -EXIT: FunctionOut(); return ret; @@ -745,7 +720,6 @@ OMX_ERRORTYPE Exynos_FlushInputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent, EX /* reset dataBuffer */ Exynos_ResetDataBuffer(dataBuffer); -EXIT: FunctionOut(); return ret; @@ -856,7 +830,6 @@ OMX_ERRORTYPE Exynos_OutputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent) /* reset dataBuffer */ Exynos_ResetDataBuffer(dataBuffer); -EXIT: FunctionOut(); return ret; @@ -866,7 +839,6 @@ OMX_ERRORTYPE Exynos_FlushOutputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent, E { OMX_ERRORTYPE ret = OMX_ErrorNone; EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; - EXYNOS_OMX_BASEPORT *exynosOMXOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; OMX_BUFFERHEADERTYPE *bufferHeader = NULL; FunctionIn(); @@ -901,7 +873,6 @@ OMX_ERRORTYPE Exynos_FlushOutputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent, E /* reset dataBuffer */ Exynos_ResetDataBuffer(dataBuffer); -EXIT: FunctionOut(); return ret; @@ -1043,13 +1014,13 @@ OMX_ERRORTYPE Exynos_CodecBufferDeQueue(EXYNOS_OMX_BASECOMPONENT *pExynosCompone { OMX_ERRORTYPE ret = OMX_ErrorNone; EXYNOS_OMX_BASEPORT *pExynosPort = NULL; - OMX_U32 tempData; + void *tempData; FunctionIn(); pExynosPort = &pExynosComponent->pExynosPort[PortIndex]; Exynos_OSAL_SemaphoreWait(pExynosPort->codecSemID); - tempData = (OMX_U32)Exynos_OSAL_Dequeue(&pExynosPort->codecBufferQ); + tempData = Exynos_OSAL_Dequeue(&pExynosPort->codecBufferQ); if (tempData == NULL) { *data = NULL; ret = OMX_ErrorUndefined; @@ -1080,7 +1051,7 @@ OMX_ERRORTYPE Exynos_CodecBufferReset(EXYNOS_OMX_BASECOMPONENT *pExynosComponent goto EXIT; } while (1) { - int cnt = 0; + OMX_S32 cnt = 0; Exynos_OSAL_Get_SemaphoreCount(pExynosPort->codecSemID, &cnt); if (cnt > 0) Exynos_OSAL_SemaphoreWait(pExynosPort->codecSemID); @@ -1103,7 +1074,6 @@ OMX_ERRORTYPE Exynos_OMX_VideoDecodeGetParameter( OMX_ERRORTYPE ret = OMX_ErrorNone; OMX_COMPONENTTYPE *pOMXComponent = NULL; EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL; - EXYNOS_OMX_BASEPORT *pExynosPort = NULL; FunctionIn(); @@ -1245,7 +1215,6 @@ OMX_ERRORTYPE Exynos_OMX_VideoDecodeSetParameter( OMX_ERRORTYPE ret = OMX_ErrorNone; OMX_COMPONENTTYPE *pOMXComponent = NULL; EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL; - EXYNOS_OMX_BASEPORT *pExynosPort = NULL; FunctionIn(); @@ -1280,10 +1249,8 @@ OMX_ERRORTYPE Exynos_OMX_VideoDecodeSetParameter( { OMX_VIDEO_PARAM_PORTFORMATTYPE *portFormat = (OMX_VIDEO_PARAM_PORTFORMATTYPE *)ComponentParameterStructure; OMX_U32 portIndex = portFormat->nPortIndex; - OMX_U32 index = portFormat->nIndex; EXYNOS_OMX_BASEPORT *pExynosPort = NULL; OMX_PARAM_PORTDEFINITIONTYPE *portDefinition = NULL; - OMX_U32 supportFormatNum = 0; ret = Exynos_OMX_Check_SizeVersion(portFormat, sizeof(OMX_VIDEO_PARAM_PORTFORMATTYPE)); if (ret != OMX_ErrorNone) { diff --git a/openmax/component/video/dec/Exynos_OMX_VdecControl.h b/openmax/component/video/dec/Exynos_OMX_VdecControl.h old mode 100644 new mode 100755 index ca12a6b..c2ecef6 --- a/openmax/component/video/dec/Exynos_OMX_VdecControl.h +++ b/openmax/component/video/dec/Exynos_OMX_VdecControl.h @@ -92,6 +92,12 @@ OMX_ERRORTYPE Exynos_OutputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent); OMX_ERRORTYPE Exynos_OMX_BufferFlush(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 nPortIndex, OMX_BOOL bEvent); OMX_ERRORTYPE Exynos_FlushInputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATABUFFER *dataBuffer); OMX_ERRORTYPE Exynos_FlushOutputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATABUFFER *dataBuffer); +OMX_ERRORTYPE Exynos_CodecBufferReset(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, OMX_U32 PortIndex); +OMX_ERRORTYPE Exynos_CodecBufferEnQueue(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, OMX_U32 PortIndex, OMX_PTR data); +OMX_BUFFERHEADERTYPE *Exynos_OutputBufferGetQueue_Direct(EXYNOS_OMX_BASECOMPONENT *pExynosComponent); +OMX_ERRORTYPE Exynos_OutputBufferGetQueue(EXYNOS_OMX_BASECOMPONENT *pExynosComponent); +OMX_ERRORTYPE Exynos_CodecBufferDeQueue(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, OMX_U32 PortIndex, OMX_PTR *data); +OMX_ERRORTYPE Exynos_InputBufferGetQueue(EXYNOS_OMX_BASECOMPONENT *pExynosComponent); #ifdef USE_PB OMX_ERRORTYPE Exynos_Shared_PlatformBufferToData(EXYNOS_OMX_DATABUFFER *pUseBuffer, EXYNOS_OMX_DATA *pData, EXYNOS_OMX_BASEPORT *pExynosPort, EXYNOS_OMX_PLANE nPlane); diff --git a/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c b/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c index 62f2380..dd203ab 100755 --- a/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c +++ b/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c @@ -41,6 +41,7 @@ #include "ExynosVideoApi.h" #include "Exynos_OSAL_SharedMemory.h" #include "Exynos_OSAL_Event.h" +#include "Exynos_OMX_VdecControl.h" @@ -112,16 +113,13 @@ EXYNOS_OMX_VIDEO_PROFILELEVEL supportedAVCProfileLevels[] ={ static OMX_ERRORTYPE GetCodecInputPrivateData(OMX_PTR codecBuffer, void *pVirtAddr, OMX_U32 *dataSize) { - OMX_ERRORTYPE ret = OMX_ErrorNone; - -EXIT: - return ret; + return OMX_ErrorNone; } -static OMX_ERRORTYPE GetCodecOutputPrivateData(OMX_PTR codecBuffer, void *addr[], int size[]) +static OMX_ERRORTYPE GetCodecOutputPrivateData(OMX_PTR codecBuffer, OMX_PTR addr[], OMX_U32 size[]) { - OMX_ERRORTYPE ret = OMX_ErrorNone; - ExynosVideoBuffer *pCodecBuffer; + OMX_ERRORTYPE ret = OMX_ErrorNone; + ExynosVideoBuffer *pCodecBuffer = NULL; if (codecBuffer == NULL) { ret = OMX_ErrorBadParameter; @@ -412,7 +410,6 @@ OMX_ERRORTYPE H264CodecStart(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortInde { OMX_ERRORTYPE ret = OMX_ErrorNone; void *hMFCHandle = NULL; - ExynosVideoDecOps *pDecOps = NULL; ExynosVideoDecBufferOps *pInbufOps = NULL; ExynosVideoDecBufferOps *pOutbufOps = NULL; EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = NULL; @@ -438,7 +435,6 @@ OMX_ERRORTYPE H264CodecStart(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortInde } hMFCHandle = pH264Dec->hMFCH264Handle.hMFCHandle; - pDecOps = pH264Dec->hMFCH264Handle.pDecOps; pInbufOps = pH264Dec->hMFCH264Handle.pInbufOps; pOutbufOps = pH264Dec->hMFCH264Handle.pOutbufOps; @@ -459,7 +455,6 @@ OMX_ERRORTYPE H264CodecStop(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortIndex { OMX_ERRORTYPE ret = OMX_ErrorNone; void *hMFCHandle = NULL; - ExynosVideoDecOps *pDecOps = NULL; ExynosVideoDecBufferOps *pInbufOps = NULL; ExynosVideoDecBufferOps *pOutbufOps = NULL; EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = NULL; @@ -484,7 +479,6 @@ OMX_ERRORTYPE H264CodecStop(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortIndex } hMFCHandle = pH264Dec->hMFCH264Handle.hMFCHandle; - pDecOps = pH264Dec->hMFCH264Handle.pDecOps; pInbufOps = pH264Dec->hMFCH264Handle.pInbufOps; pOutbufOps = pH264Dec->hMFCH264Handle.pOutbufOps; @@ -513,7 +507,6 @@ OMX_ERRORTYPE H264CodecSrcInit(OMX_COMPONENTTYPE *pOMXComponent) ExynosVideoDecOps *pDecOps = pH264Dec->hMFCH264Handle.pDecOps; ExynosVideoDecBufferOps *pInbufOps = pH264Dec->hMFCH264Handle.pInbufOps; - ExynosVideoDecBufferOps *pOutbufOps = pH264Dec->hMFCH264Handle.pOutbufOps; ExynosVideoGeometry bufferConf; OMX_U32 inputBufferNumber = 0; int i, plane; @@ -610,16 +603,20 @@ OMX_ERRORTYPE H264CodecSrcInit(OMX_COMPONENTTYPE *pOMXComponent) /* Register input buffer */ for (i = 0; i < pExynosInputPort->portDefinition.nBufferCountActual; i++) { ExynosVideoPlane plane; +#if 0 if (pVideoDec->bDRMPlayerMode == OMX_TRUE) { -#ifdef TIZEN_FEATURE_E3250 +#endif +#ifdef TIZEN_FEATURE_E54XX /* IL Client assigns FD value in pBuffer */ plane.addr = pExynosInputPort->extendBufferHeader[i].OMXBufferHeader->pBuffer; #else plane.addr = Exynos_OSAL_SharedMemory_IONToVirt(pVideoDec->hSharedMemory, pExynosInputPort->extendBufferHeader[i].OMXBufferHeader->pBuffer); #endif +#if 0 } else { plane.addr = pExynosInputPort->extendBufferHeader[i].OMXBufferHeader->pBuffer; } +#endif plane.allocSize = pExynosInputPort->extendBufferHeader[i].OMXBufferHeader->nAllocLen; plane.fd = pExynosInputPort->extendBufferHeader[i].buf_fd[0]; if (pInbufOps->Register(hMFCHandle, &plane, MFC_INPUT_BUFFER_PLANE) != VIDEO_ERROR_NONE) { @@ -640,10 +637,6 @@ EXIT: OMX_ERRORTYPE H264CodecOutputBufferProcessRun(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortIndex) { OMX_ERRORTYPE ret = OMX_ErrorNone; - void *hMFCHandle = NULL; - ExynosVideoDecOps *pDecOps = NULL; - ExynosVideoDecBufferOps *pInbufOps = NULL; - ExynosVideoDecBufferOps *pOutbufOps = NULL; EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = NULL; EXYNOS_H264DEC_HANDLE *pH264Dec = NULL; @@ -665,10 +658,6 @@ OMX_ERRORTYPE H264CodecOutputBufferProcessRun(OMX_COMPONENTTYPE *pOMXComponent, goto EXIT; } - hMFCHandle = pH264Dec->hMFCH264Handle.hMFCHandle; - pDecOps = pH264Dec->hMFCH264Handle.pDecOps; - pInbufOps = pH264Dec->hMFCH264Handle.pInbufOps; - pOutbufOps = pH264Dec->hMFCH264Handle.pOutbufOps; if (nPortIndex == INPUT_PORT_INDEX) { if (pH264Dec->bSourceStart == OMX_FALSE) { @@ -699,8 +688,6 @@ OMX_ERRORTYPE H264CodecEnQueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U3 EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle; EXYNOS_H264DEC_HANDLE *pH264Dec = (EXYNOS_H264DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; void *hMFCHandle = pH264Dec->hMFCH264Handle.hMFCHandle; - EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; - EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; int i, nOutbufs; ExynosVideoDecOps *pDecOps = pH264Dec->hMFCH264Handle.pDecOps; @@ -728,7 +715,6 @@ OMX_ERRORTYPE H264CodecEnQueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U3 pInbufOps->Clear_Queue(hMFCHandle); } else if ((nPortIndex == OUTPUT_PORT_INDEX) && (pH264Dec->bDestinationStart == OMX_TRUE)) { - OMX_U32 dataLen[MFC_OUTPUT_BUFFER_PLANE] = {0, 0}; ExynosVideoBuffer *pBuffer = NULL; Exynos_CodecBufferReset(pExynosComponent, OUTPUT_PORT_INDEX); @@ -797,7 +783,6 @@ EXIT: OMX_ERRORTYPE H264CodecDstFreeCodecBuffers( OMX_COMPONENTTYPE *pOMXComponent) { - 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; EXYNOS_H264DEC_HANDLE *pH264Dec = (EXYNOS_H264DEC_HANDLE *)pVideoDec->hCodecHandle; @@ -938,8 +923,6 @@ OMX_ERRORTYPE H264CodecResetupAllElement( EXYNOS_OMX_BASEPORT *pOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; ExynosVideoDecBufferOps *pOutbufOps = pH264Dec->hMFCH264Handle.pOutbufOps; - int i, j, nOutbufs; - FunctionIn(); if ((nPortIndex == INPUT_PORT_INDEX) && @@ -989,19 +972,15 @@ OMX_ERRORTYPE H264CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DAT { 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; EXYNOS_H264DEC_HANDLE *pH264Dec = (EXYNOS_H264DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; void *hMFCHandle = pH264Dec->hMFCH264Handle.hMFCHandle; EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; - EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; OMX_U32 oneFrameSize = pSrcInputData->dataLen; ExynosVideoDecOps *pDecOps = pH264Dec->hMFCH264Handle.pDecOps; ExynosVideoDecBufferOps *pInbufOps = pH264Dec->hMFCH264Handle.pInbufOps; ExynosVideoDecBufferOps *pOutbufOps = pH264Dec->hMFCH264Handle.pOutbufOps; ExynosVideoGeometry bufferConf; - OMX_U32 inputBufferNumber = 0; - int i; FunctionIn(); @@ -1082,11 +1061,9 @@ OMX_ERRORTYPE H264CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle; EXYNOS_H264DEC_HANDLE *pH264Dec = (EXYNOS_H264DEC_HANDLE *)pVideoDec->hCodecHandle; void *hMFCHandle = pH264Dec->hMFCH264Handle.hMFCHandle; - EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; ExynosVideoDecOps *pDecOps = pH264Dec->hMFCH264Handle.pDecOps; - ExynosVideoDecBufferOps *pInbufOps = pH264Dec->hMFCH264Handle.pInbufOps; ExynosVideoDecBufferOps *pOutbufOps = pH264Dec->hMFCH264Handle.pOutbufOps; int i, nOutbufs; @@ -1221,10 +1198,7 @@ OMX_ERRORTYPE H264CodecCheckResolutionChange(OMX_COMPONENTTYPE *pOMXComponent) EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; ExynosVideoDecOps *pDecOps = pH264Dec->hMFCH264Handle.pDecOps; - ExynosVideoDecBufferOps *pInbufOps = pH264Dec->hMFCH264Handle.pInbufOps; ExynosVideoDecBufferOps *pOutbufOps = pH264Dec->hMFCH264Handle.pOutbufOps; - ExynosVideoGeometry bufferConf; - int i; FunctionIn(); @@ -1875,7 +1849,6 @@ OMX_ERRORTYPE Exynos_H264Dec_GetExtensionIndex( } if (Exynos_OSAL_Strcmp(cParameterName, EXYNOS_INDEX_PARAM_ENABLE_THUMBNAIL) == 0) { - EXYNOS_H264DEC_HANDLE *pH264Dec = (EXYNOS_H264DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; *pIndexType = OMX_IndexVendorThumbnailMode; ret = OMX_ErrorNone; } @@ -1901,8 +1874,6 @@ OMX_ERRORTYPE Exynos_H264Dec_ComponentRoleEnum( OMX_U32 nIndex) { OMX_ERRORTYPE ret = OMX_ErrorNone; - OMX_COMPONENTTYPE *pOMXComponent = NULL; - EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL; FunctionIn(); @@ -1932,11 +1903,6 @@ OMX_ERRORTYPE Exynos_H264Dec_Init(OMX_COMPONENTTYPE *pOMXComponent) EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; EXYNOS_H264DEC_HANDLE *pH264Dec = (EXYNOS_H264DEC_HANDLE *)pVideoDec->hCodecHandle; - OMX_PTR hMFCHandle = pH264Dec->hMFCH264Handle.hMFCHandle; - - ExynosVideoDecOps *pDecOps = NULL; - ExynosVideoDecBufferOps *pInbufOps = NULL; - ExynosVideoDecBufferOps *pOutbufOps = NULL; CSC_METHOD csc_method = CSC_METHOD_SW; int i, plane; @@ -1954,10 +1920,6 @@ OMX_ERRORTYPE Exynos_H264Dec_Init(OMX_COMPONENTTYPE *pOMXComponent) goto EXIT; } - pDecOps = pH264Dec->hMFCH264Handle.pDecOps; - pInbufOps = pH264Dec->hMFCH264Handle.pInbufOps; - pOutbufOps = pH264Dec->hMFCH264Handle.pOutbufOps; - if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { Exynos_OSAL_SemaphoreCreate(&pExynosInputPort->codecSemID); Exynos_OSAL_QueueCreate(&pExynosInputPort->codecBufferQ, MAX_QUEUE_ELEMENTS); @@ -2055,13 +2017,8 @@ OMX_ERRORTYPE Exynos_H264Dec_Terminate(OMX_COMPONENTTYPE *pOMXComponent) EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; EXYNOS_H264DEC_HANDLE *pH264Dec = (EXYNOS_H264DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; - OMX_PTR hMFCHandle = pH264Dec->hMFCH264Handle.hMFCHandle; - ExynosVideoDecOps *pDecOps = pH264Dec->hMFCH264Handle.pDecOps; - ExynosVideoDecBufferOps *pInbufOps = pH264Dec->hMFCH264Handle.pInbufOps; - ExynosVideoDecBufferOps *pOutbufOps = pH264Dec->hMFCH264Handle.pOutbufOps; - - int i, plane; + int i; FunctionIn(); @@ -2113,7 +2070,7 @@ OMX_ERRORTYPE Exynos_H264Dec_Terminate(OMX_COMPONENTTYPE *pOMXComponent) } H264CodecClose(pH264Dec); -EXIT: + FunctionOut(); return ret; @@ -2126,15 +2083,11 @@ OMX_ERRORTYPE Exynos_H264Dec_SrcIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_ EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle; EXYNOS_H264DEC_HANDLE *pH264Dec = (EXYNOS_H264DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; void *hMFCHandle = pH264Dec->hMFCH264Handle.hMFCHandle; - EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; - EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; OMX_U32 oneFrameSize = pSrcInputData->dataLen; OMX_BOOL bInStartCode = OMX_FALSE; ExynosVideoDecOps *pDecOps = pH264Dec->hMFCH264Handle.pDecOps; ExynosVideoDecBufferOps *pInbufOps = pH264Dec->hMFCH264Handle.pInbufOps; - ExynosVideoDecBufferOps *pOutbufOps = pH264Dec->hMFCH264Handle.pOutbufOps; ExynosVideoErrorType codecReturn = VIDEO_ERROR_NONE; - int i; FunctionIn(); @@ -2215,7 +2168,6 @@ OMX_ERRORTYPE Exynos_H264Dec_SrcOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX EXYNOS_H264DEC_HANDLE *pH264Dec = (EXYNOS_H264DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; void *hMFCHandle = pH264Dec->hMFCH264Handle.hMFCHandle; EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; - ExynosVideoDecOps *pDecOps = pH264Dec->hMFCH264Handle.pDecOps; ExynosVideoDecBufferOps *pInbufOps = pH264Dec->hMFCH264Handle.pInbufOps; ExynosVideoBuffer *pVideoBuffer; @@ -2273,7 +2225,6 @@ OMX_ERRORTYPE Exynos_H264Dec_DstIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_ EXYNOS_H264DEC_HANDLE *pH264Dec = (EXYNOS_H264DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; void *hMFCHandle = pH264Dec->hMFCH264Handle.hMFCHandle; EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; - ExynosVideoDecOps *pDecOps = pH264Dec->hMFCH264Handle.pDecOps; ExynosVideoDecBufferOps *pOutbufOps = pH264Dec->hMFCH264Handle.pOutbufOps; OMX_U32 dataLen[MFC_OUTPUT_BUFFER_PLANE] = {0,}; ExynosVideoErrorType codecReturn = VIDEO_ERROR_NONE; @@ -2326,7 +2277,6 @@ OMX_ERRORTYPE Exynos_H264Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle; EXYNOS_H264DEC_HANDLE *pH264Dec = (EXYNOS_H264DEC_HANDLE *)pVideoDec->hCodecHandle; void *hMFCHandle = pH264Dec->hMFCH264Handle.hMFCHandle; - EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; ExynosVideoDecOps *pDecOps = pH264Dec->hMFCH264Handle.pDecOps; ExynosVideoDecBufferOps *pOutbufOps = pH264Dec->hMFCH264Handle.pOutbufOps; @@ -2485,7 +2435,7 @@ OMX_ERRORTYPE Exynos_H264Dec_srcInputBufferProcess(OMX_COMPONENTTYPE *pOMXCompon { OMX_ERRORTYPE ret = OMX_ErrorNone; EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; - EXYNOS_H264DEC_HANDLE *pH264Dec = (EXYNOS_H264DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; + EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; FunctionIn(); @@ -2501,8 +2451,8 @@ OMX_ERRORTYPE Exynos_H264Dec_srcInputBufferProcess(OMX_COMPONENTTYPE *pOMXCompon ret = Exynos_H264Dec_SrcIn(pOMXComponent, pSrcInputData); if ((ret != OMX_ErrorNone) && - (ret != OMX_ErrorInputDataDecodeYet) && - (ret != OMX_ErrorCorruptedFrame)) { + (ret != (OMX_ERRORTYPE)OMX_ErrorInputDataDecodeYet) && + (ret != (OMX_ERRORTYPE)OMX_ErrorCorruptedFrame)) { pExynosComponent->pCallbacks->EventHandler((OMX_HANDLETYPE)pOMXComponent, pExynosComponent->callbackData, OMX_EventError, ret, 0, NULL); diff --git a/openmax/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c b/openmax/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c index cb77ee1..e5ecb8c 100755 --- a/openmax/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c +++ b/openmax/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c @@ -41,6 +41,7 @@ #include "ExynosVideoApi.h" #include "Exynos_OSAL_SharedMemory.h" #include "Exynos_OSAL_Event.h" +#include "Exynos_OMX_VdecControl.h" #ifdef USE_PB #include "Exynos_OSAL_Platform_Specific.h" @@ -62,16 +63,13 @@ static OMX_ERRORTYPE GetCodecInputPrivateData(OMX_PTR codecBuffer, void *pVirtAddr, OMX_U32 *dataSize) { - OMX_ERRORTYPE ret = OMX_ErrorNone; - -EXIT: - return ret; + return OMX_ErrorNone; } -static OMX_ERRORTYPE GetCodecOutputPrivateData(OMX_PTR codecBuffer, void *addr[], int size[]) +static OMX_ERRORTYPE GetCodecOutputPrivateData(OMX_PTR codecBuffer, OMX_PTR addr[], OMX_U32 size[]) { - OMX_ERRORTYPE ret = OMX_ErrorNone; - ExynosVideoBuffer *pCodecBuffer; + OMX_ERRORTYPE ret = OMX_ErrorNone; + ExynosVideoBuffer *pCodecBuffer = NULL; if (codecBuffer == NULL) { ret = OMX_ErrorBadParameter; @@ -279,7 +277,6 @@ OMX_ERRORTYPE Mpeg2CodecStart(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortInd { OMX_ERRORTYPE ret = OMX_ErrorNone; void *hMFCHandle = NULL; - ExynosVideoDecOps *pDecOps = NULL; ExynosVideoDecBufferOps *pInbufOps = NULL; ExynosVideoDecBufferOps *pOutbufOps = NULL; EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = NULL; @@ -305,7 +302,6 @@ OMX_ERRORTYPE Mpeg2CodecStart(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortInd } hMFCHandle = pMpeg2Dec->hMFCMpeg2Handle.hMFCHandle; - pDecOps = pMpeg2Dec->hMFCMpeg2Handle.pDecOps; pInbufOps = pMpeg2Dec->hMFCMpeg2Handle.pInbufOps; pOutbufOps = pMpeg2Dec->hMFCMpeg2Handle.pOutbufOps; @@ -326,7 +322,6 @@ OMX_ERRORTYPE Mpeg2CodecStop(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortInde { OMX_ERRORTYPE ret = OMX_ErrorNone; void *hMFCHandle = NULL; - ExynosVideoDecOps *pDecOps = NULL; ExynosVideoDecBufferOps *pInbufOps = NULL; ExynosVideoDecBufferOps *pOutbufOps = NULL; EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = NULL; @@ -351,7 +346,6 @@ OMX_ERRORTYPE Mpeg2CodecStop(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortInde } hMFCHandle = pMpeg2Dec->hMFCMpeg2Handle.hMFCHandle; - pDecOps = pMpeg2Dec->hMFCMpeg2Handle.pDecOps; pInbufOps = pMpeg2Dec->hMFCMpeg2Handle.pInbufOps; pOutbufOps = pMpeg2Dec->hMFCMpeg2Handle.pOutbufOps; @@ -371,10 +365,6 @@ EXIT: OMX_ERRORTYPE Mpeg2CodecOutputBufferProcessRun(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortIndex) { OMX_ERRORTYPE ret = OMX_ErrorNone; - void *hMFCHandle = NULL; - ExynosVideoDecOps *pDecOps = NULL; - ExynosVideoDecBufferOps *pInbufOps = NULL; - ExynosVideoDecBufferOps *pOutbufOps = NULL; EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = NULL; EXYNOS_MPEG2DEC_HANDLE *pMpeg2Dec = NULL; @@ -396,11 +386,6 @@ OMX_ERRORTYPE Mpeg2CodecOutputBufferProcessRun(OMX_COMPONENTTYPE *pOMXComponent, goto EXIT; } - hMFCHandle = pMpeg2Dec->hMFCMpeg2Handle.hMFCHandle; - pDecOps = pMpeg2Dec->hMFCMpeg2Handle.pDecOps; - pInbufOps = pMpeg2Dec->hMFCMpeg2Handle.pInbufOps; - pOutbufOps = pMpeg2Dec->hMFCMpeg2Handle.pOutbufOps; - if (nPortIndex == INPUT_PORT_INDEX) { if (pMpeg2Dec->bSourceStart == OMX_FALSE) { Exynos_OSAL_SignalSet(pMpeg2Dec->hSourceStartEvent); @@ -430,8 +415,6 @@ OMX_ERRORTYPE Mpeg2CodecEnQueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle; EXYNOS_MPEG2DEC_HANDLE *pMpeg2Dec = (EXYNOS_MPEG2DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; void *hMFCHandle = pMpeg2Dec->hMFCMpeg2Handle.hMFCHandle; - EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; - EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; int i, nOutbufs; ExynosVideoDecOps *pDecOps = pMpeg2Dec->hMFCMpeg2Handle.pDecOps; @@ -454,7 +437,6 @@ OMX_ERRORTYPE Mpeg2CodecEnQueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U pInbufOps->Clear_Queue(hMFCHandle); } else if ((nPortIndex == OUTPUT_PORT_INDEX) && (pMpeg2Dec->bDestinationStart == OMX_TRUE)) { - OMX_U32 dataLen[MFC_OUTPUT_BUFFER_PLANE] = {0, 0}; ExynosVideoBuffer *pBuffer = NULL; Exynos_CodecBufferReset(pExynosComponent, OUTPUT_PORT_INDEX); @@ -682,11 +664,8 @@ OMX_ERRORTYPE Mpeg2CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle; EXYNOS_MPEG2DEC_HANDLE *pMpeg2Dec = (EXYNOS_MPEG2DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; void *hMFCHandle = pMpeg2Dec->hMFCMpeg2Handle.hMFCHandle; - EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; - ExynosVideoDecOps *pDecOps = pMpeg2Dec->hMFCMpeg2Handle.pDecOps; - ExynosVideoDecBufferOps *pInbufOps = pMpeg2Dec->hMFCMpeg2Handle.pInbufOps; ExynosVideoDecBufferOps *pOutbufOps = pMpeg2Dec->hMFCMpeg2Handle.pOutbufOps; int i, nOutbufs; @@ -1255,7 +1234,6 @@ OMX_ERRORTYPE Exynos_Mpeg2Dec_GetExtensionIndex( } if (Exynos_OSAL_Strcmp(cParameterName, EXYNOS_INDEX_PARAM_ENABLE_THUMBNAIL) == 0) { - EXYNOS_MPEG2DEC_HANDLE *pMpeg2Dec = (EXYNOS_MPEG2DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; *pIndexType = OMX_IndexVendorThumbnailMode; ret = OMX_ErrorNone; } else { @@ -1274,8 +1252,6 @@ OMX_ERRORTYPE Exynos_Mpeg2Dec_ComponentRoleEnum( OMX_U32 nIndex) { OMX_ERRORTYPE ret = OMX_ErrorNone; - OMX_COMPONENTTYPE *pOMXComponent = NULL; - EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL; FunctionIn(); @@ -1305,11 +1281,8 @@ OMX_ERRORTYPE Exynos_Mpeg2Dec_Init(OMX_COMPONENTTYPE *pOMXComponent) EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; EXYNOS_MPEG2DEC_HANDLE *pMpeg2Dec = (EXYNOS_MPEG2DEC_HANDLE *)pVideoDec->hCodecHandle; - OMX_PTR hMFCHandle = pMpeg2Dec->hMFCMpeg2Handle.hMFCHandle; - ExynosVideoDecOps *pDecOps = NULL; - ExynosVideoDecBufferOps *pInbufOps = NULL; - ExynosVideoDecBufferOps *pOutbufOps = NULL; + CSC_METHOD csc_method = CSC_METHOD_SW; int i, plane; @@ -1327,10 +1300,6 @@ OMX_ERRORTYPE Exynos_Mpeg2Dec_Init(OMX_COMPONENTTYPE *pOMXComponent) goto EXIT; } - pDecOps = pMpeg2Dec->hMFCMpeg2Handle.pDecOps; - pInbufOps = pMpeg2Dec->hMFCMpeg2Handle.pInbufOps; - pOutbufOps = pMpeg2Dec->hMFCMpeg2Handle.pOutbufOps; - if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { Exynos_OSAL_SemaphoreCreate(&pExynosInputPort->codecSemID); Exynos_OSAL_QueueCreate(&pExynosInputPort->codecBufferQ, MAX_QUEUE_ELEMENTS); @@ -1410,13 +1379,8 @@ OMX_ERRORTYPE Exynos_Mpeg2Dec_Terminate(OMX_COMPONENTTYPE *pOMXComponent) EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; EXYNOS_MPEG2DEC_HANDLE *pMpeg2Dec = (EXYNOS_MPEG2DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; - OMX_PTR hMFCHandle = pMpeg2Dec->hMFCMpeg2Handle.hMFCHandle; - ExynosVideoDecOps *pDecOps = pMpeg2Dec->hMFCMpeg2Handle.pDecOps; - ExynosVideoDecBufferOps *pInbufOps = pMpeg2Dec->hMFCMpeg2Handle.pInbufOps; - ExynosVideoDecBufferOps *pOutbufOps = pMpeg2Dec->hMFCMpeg2Handle.pOutbufOps; - - int i, plane; + int i; FunctionIn(); @@ -1479,7 +1443,6 @@ OMX_ERRORTYPE Exynos_Mpeg2Dec_Terminate(OMX_COMPONENTTYPE *pOMXComponent) } Mpeg2CodecClose(pMpeg2Dec); -EXIT: FunctionOut(); return ret; @@ -1489,17 +1452,12 @@ OMX_ERRORTYPE Exynos_Mpeg2Dec_SrcIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX { 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; EXYNOS_MPEG2DEC_HANDLE *pMpeg2Dec = (EXYNOS_MPEG2DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; void *hMFCHandle = pMpeg2Dec->hMFCMpeg2Handle.hMFCHandle; - EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; - EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; OMX_U32 oneFrameSize = pSrcInputData->dataLen; ExynosVideoDecOps *pDecOps = pMpeg2Dec->hMFCMpeg2Handle.pDecOps; ExynosVideoDecBufferOps *pInbufOps = pMpeg2Dec->hMFCMpeg2Handle.pInbufOps; - ExynosVideoDecBufferOps *pOutbufOps = pMpeg2Dec->hMFCMpeg2Handle.pOutbufOps; ExynosVideoErrorType codecReturn = VIDEO_ERROR_NONE; - int i; FunctionIn(); @@ -1558,7 +1516,6 @@ OMX_ERRORTYPE Exynos_Mpeg2Dec_SrcOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OM EXYNOS_MPEG2DEC_HANDLE *pMpeg2Dec = (EXYNOS_MPEG2DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; void *hMFCHandle = pMpeg2Dec->hMFCMpeg2Handle.hMFCHandle; EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; - ExynosVideoDecOps *pDecOps = pMpeg2Dec->hMFCMpeg2Handle.pDecOps; ExynosVideoDecBufferOps *pInbufOps = pMpeg2Dec->hMFCMpeg2Handle.pInbufOps; ExynosVideoBuffer *pVideoBuffer; @@ -1612,11 +1569,8 @@ OMX_ERRORTYPE Exynos_Mpeg2Dec_DstIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX { 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; EXYNOS_MPEG2DEC_HANDLE *pMpeg2Dec = (EXYNOS_MPEG2DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; void *hMFCHandle = pMpeg2Dec->hMFCMpeg2Handle.hMFCHandle; - EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; - ExynosVideoDecOps *pDecOps = pMpeg2Dec->hMFCMpeg2Handle.pDecOps; ExynosVideoDecBufferOps *pOutbufOps = pMpeg2Dec->hMFCMpeg2Handle.pOutbufOps; OMX_U32 dataLen[MFC_OUTPUT_BUFFER_PLANE] = {0,}; ExynosVideoErrorType codecReturn = VIDEO_ERROR_NONE; @@ -1655,10 +1609,10 @@ OMX_ERRORTYPE Exynos_Mpeg2Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OM { 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; + EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle; EXYNOS_MPEG2DEC_HANDLE *pMpeg2Dec = (EXYNOS_MPEG2DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; void *hMFCHandle = pMpeg2Dec->hMFCMpeg2Handle.hMFCHandle; - EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; + EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; ExynosVideoDecOps *pDecOps = pMpeg2Dec->hMFCMpeg2Handle.pDecOps; ExynosVideoDecBufferOps *pOutbufOps = pMpeg2Dec->hMFCMpeg2Handle.pOutbufOps; @@ -1786,7 +1740,6 @@ OMX_ERRORTYPE Exynos_Mpeg2Dec_srcInputBufferProcess(OMX_COMPONENTTYPE *pOMXCompo { OMX_ERRORTYPE ret = OMX_ErrorNone; EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; - EXYNOS_MPEG2DEC_HANDLE *pMpeg2Dec = (EXYNOS_MPEG2DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; FunctionIn(); @@ -1801,7 +1754,7 @@ OMX_ERRORTYPE Exynos_Mpeg2Dec_srcInputBufferProcess(OMX_COMPONENTTYPE *pOMXCompo } ret = Exynos_Mpeg2Dec_SrcIn(pOMXComponent, pSrcInputData); - if ((ret != OMX_ErrorNone) && (ret != OMX_ErrorInputDataDecodeYet)) { + if ((ret != OMX_ErrorNone) && (ret != (OMX_ERRORTYPE)OMX_ErrorInputDataDecodeYet)) { pExynosComponent->pCallbacks->EventHandler((OMX_HANDLETYPE)pOMXComponent, pExynosComponent->callbackData, OMX_EventError, ret, 0, NULL); diff --git a/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c b/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c index 7d99bcf..acb4037 100755 --- a/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c +++ b/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c @@ -42,6 +42,7 @@ #include "ExynosVideoApi.h" #include "Exynos_OSAL_SharedMemory.h" #include "Exynos_OSAL_Event.h" +#include "Exynos_OMX_VdecControl.h" #ifdef USE_PB #include "Exynos_OSAL_Platform_Specific.h" @@ -122,16 +123,13 @@ EXYNOS_OMX_VIDEO_PROFILELEVEL supportedH263ProfileLevels[] = { static OMX_ERRORTYPE GetCodecInputPrivateData(OMX_PTR codecBuffer, void *pVirtAddr, OMX_U32 *dataSize) { - OMX_ERRORTYPE ret = OMX_ErrorNone; - -EXIT: - return ret; + return OMX_ErrorNone; } -static OMX_ERRORTYPE GetCodecOutputPrivateData(OMX_PTR codecBuffer, void *addr[], int size[]) +static OMX_ERRORTYPE GetCodecOutputPrivateData(OMX_PTR codecBuffer, OMX_PTR addr[], OMX_U32 size[]) { - OMX_ERRORTYPE ret = OMX_ErrorNone; - ExynosVideoBuffer *pCodecBuffer; + OMX_ERRORTYPE ret = OMX_ErrorNone; + ExynosVideoBuffer *pCodecBuffer = NULL; if (codecBuffer == NULL) { ret = OMX_ErrorBadParameter; @@ -355,7 +353,7 @@ static OMX_BOOL Check_Stream_StartCode( } } -static void getAByte(char *buff, int *code) +static void getAByte(OMX_U8 *buff, int *code) { int byte; @@ -463,15 +461,11 @@ OMX_ERRORTYPE Mpeg4CodecOpen(EXYNOS_MPEG4DEC_HANDLE *pMpeg4Dec) } /* alloc context, open, querycap */ - if (pMpeg4Dec->hMFCMpeg4Handle.bShareableBuf == OMX_TRUE) { #ifdef USE_DMA_BUF - pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.pDecOps->Init(V4L2_MEMORY_DMABUF); + pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.pDecOps->Init(V4L2_MEMORY_DMABUF); #else - pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.pDecOps->Init(V4L2_MEMORY_USERPTR); + pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.pDecOps->Init(V4L2_MEMORY_USERPTR); #endif - } else { - 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; @@ -550,7 +544,6 @@ OMX_ERRORTYPE Mpeg4CodecStart(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortInd { OMX_ERRORTYPE ret = OMX_ErrorNone; void *hMFCHandle = NULL; - ExynosVideoDecOps *pDecOps = NULL; ExynosVideoDecBufferOps *pInbufOps = NULL; ExynosVideoDecBufferOps *pOutbufOps = NULL; EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = NULL; @@ -576,7 +569,6 @@ OMX_ERRORTYPE Mpeg4CodecStart(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortInd } hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle; - pDecOps = pMpeg4Dec->hMFCMpeg4Handle.pDecOps; pInbufOps = pMpeg4Dec->hMFCMpeg4Handle.pInbufOps; pOutbufOps = pMpeg4Dec->hMFCMpeg4Handle.pOutbufOps; @@ -597,7 +589,6 @@ OMX_ERRORTYPE Mpeg4CodecStop(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortInde { OMX_ERRORTYPE ret = OMX_ErrorNone; void *hMFCHandle = NULL; - ExynosVideoDecOps *pDecOps = NULL; ExynosVideoDecBufferOps *pInbufOps = NULL; ExynosVideoDecBufferOps *pOutbufOps = NULL; EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = NULL; @@ -622,7 +613,6 @@ OMX_ERRORTYPE Mpeg4CodecStop(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortInde } hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle; - pDecOps = pMpeg4Dec->hMFCMpeg4Handle.pDecOps; pInbufOps = pMpeg4Dec->hMFCMpeg4Handle.pInbufOps; pOutbufOps = pMpeg4Dec->hMFCMpeg4Handle.pOutbufOps; @@ -651,7 +641,6 @@ OMX_ERRORTYPE Mpeg4CodecSrcInit(OMX_COMPONENTTYPE *pOMXComponent) ExynosVideoDecOps *pDecOps = pMpeg4Dec->hMFCMpeg4Handle.pDecOps; ExynosVideoDecBufferOps *pInbufOps = pMpeg4Dec->hMFCMpeg4Handle.pInbufOps; - ExynosVideoDecBufferOps *pOutbufOps = pMpeg4Dec->hMFCMpeg4Handle.pOutbufOps; ExynosVideoGeometry bufferConf; OMX_U32 inputBufferNumber = 0; int i, plane; @@ -751,7 +740,7 @@ OMX_ERRORTYPE Mpeg4CodecSrcInit(OMX_COMPONENTTYPE *pOMXComponent) for (i = 0; i < pExynosInputPort->portDefinition.nBufferCountActual; i++) { ExynosVideoPlane plane; if (pVideoDec->bDRMPlayerMode == OMX_TRUE) { - plane.addr = Exynos_OSAL_SharedMemory_IONToVirt(pVideoDec->hSharedMemory, pExynosInputPort->extendBufferHeader[i].OMXBufferHeader->pBuffer); + plane.addr = Exynos_OSAL_SharedMemory_IONToVirt(pVideoDec->hSharedMemory, (int)pExynosInputPort->extendBufferHeader[i].OMXBufferHeader->pBuffer); } else { plane.addr = pExynosInputPort->extendBufferHeader[i].OMXBufferHeader->pBuffer; } @@ -776,10 +765,6 @@ EXIT: OMX_ERRORTYPE Mpeg4CodecOutputBufferProcessRun(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortIndex) { OMX_ERRORTYPE ret = OMX_ErrorNone; - void *hMFCHandle = NULL; - ExynosVideoDecOps *pDecOps = NULL; - ExynosVideoDecBufferOps *pInbufOps = NULL; - ExynosVideoDecBufferOps *pOutbufOps = NULL; EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = NULL; EXYNOS_MPEG4DEC_HANDLE *pMpeg4Dec = NULL; @@ -801,11 +786,6 @@ OMX_ERRORTYPE Mpeg4CodecOutputBufferProcessRun(OMX_COMPONENTTYPE *pOMXComponent, goto EXIT; } - hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle; - pDecOps = pMpeg4Dec->hMFCMpeg4Handle.pDecOps; - pInbufOps = pMpeg4Dec->hMFCMpeg4Handle.pInbufOps; - pOutbufOps = pMpeg4Dec->hMFCMpeg4Handle.pOutbufOps; - if (nPortIndex == INPUT_PORT_INDEX) { if (pMpeg4Dec->bSourceStart == OMX_FALSE) { Exynos_OSAL_SignalSet(pMpeg4Dec->hSourceStartEvent); @@ -835,8 +815,6 @@ OMX_ERRORTYPE Mpeg4CodecEnQueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle; EXYNOS_MPEG4DEC_HANDLE *pMpeg4Dec = (EXYNOS_MPEG4DEC_HANDLE *)pVideoDec->hCodecHandle; void *hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle; - EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; - EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; int i, nOutbufs; ExynosVideoDecOps *pDecOps = pMpeg4Dec->hMFCMpeg4Handle.pDecOps; @@ -864,7 +842,6 @@ OMX_ERRORTYPE Mpeg4CodecEnQueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U pInbufOps->Clear_Queue(hMFCHandle); } else if ((nPortIndex == OUTPUT_PORT_INDEX) && (pMpeg4Dec->bDestinationStart == OMX_TRUE)) { - OMX_U32 dataLen[MFC_OUTPUT_BUFFER_PLANE] = {0, 0}; ExynosVideoBuffer *pBuffer = NULL; Exynos_CodecBufferReset(pExynosComponent, OUTPUT_PORT_INDEX); @@ -888,7 +865,6 @@ EXIT: OMX_ERRORTYPE Mpeg4CodecDstFreeCodecBuffers( OMX_COMPONENTTYPE *pOMXComponent) { - 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; EXYNOS_MPEG4DEC_HANDLE *pMpeg4Dec = (EXYNOS_MPEG4DEC_HANDLE *)pVideoDec->hCodecHandle; @@ -1026,8 +1002,6 @@ OMX_ERRORTYPE Mpeg4CodecResetupAllElement( EXYNOS_OMX_BASEPORT *pOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; ExynosVideoDecBufferOps *pOutbufOps = pMpeg4Dec->hMFCMpeg4Handle.pOutbufOps; - int i, j, nOutbufs; - FunctionIn(); if ((nPortIndex == INPUT_PORT_INDEX) && @@ -1078,19 +1052,15 @@ OMX_ERRORTYPE Mpeg4CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DA { 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; EXYNOS_MPEG4DEC_HANDLE *pMpeg4Dec = (EXYNOS_MPEG4DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; void *hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle; EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; - EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; OMX_U32 oneFrameSize = pSrcInputData->dataLen; ExynosVideoDecOps *pDecOps = pMpeg4Dec->hMFCMpeg4Handle.pDecOps; ExynosVideoDecBufferOps *pInbufOps = pMpeg4Dec->hMFCMpeg4Handle.pInbufOps; ExynosVideoDecBufferOps *pOutbufOps = pMpeg4Dec->hMFCMpeg4Handle.pOutbufOps; ExynosVideoGeometry bufferConf; - OMX_U32 inputBufferNumber = 0; - int i; FunctionIn(); @@ -1180,11 +1150,8 @@ OMX_ERRORTYPE Mpeg4CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle; EXYNOS_MPEG4DEC_HANDLE *pMpeg4Dec = (EXYNOS_MPEG4DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; void *hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle; - EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; - ExynosVideoDecOps *pDecOps = pMpeg4Dec->hMFCMpeg4Handle.pDecOps; - ExynosVideoDecBufferOps *pInbufOps = pMpeg4Dec->hMFCMpeg4Handle.pInbufOps; ExynosVideoDecBufferOps *pOutbufOps = pMpeg4Dec->hMFCMpeg4Handle.pOutbufOps; int i, nOutbufs; @@ -1313,10 +1280,7 @@ OMX_ERRORTYPE Mpeg4CodecCheckResolutionChange(OMX_COMPONENTTYPE *pOMXComponent) EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; ExynosVideoDecOps *pDecOps = pMpeg4Dec->hMFCMpeg4Handle.pDecOps; - ExynosVideoDecBufferOps *pInbufOps = pMpeg4Dec->hMFCMpeg4Handle.pInbufOps; ExynosVideoDecBufferOps *pOutbufOps = pMpeg4Dec->hMFCMpeg4Handle.pOutbufOps; - ExynosVideoGeometry bufferConf; - int i; FunctionIn(); @@ -1972,7 +1936,6 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_GetExtensionIndex( } if (Exynos_OSAL_Strcmp(cParameterName, EXYNOS_INDEX_PARAM_ENABLE_THUMBNAIL) == 0) { - EXYNOS_MPEG4DEC_HANDLE *pMpeg4Dec = (EXYNOS_MPEG4DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; *pIndexType = OMX_IndexVendorThumbnailMode; ret = OMX_ErrorNone; } else { @@ -2041,11 +2004,6 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_Init(OMX_COMPONENTTYPE *pOMXComponent) EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; EXYNOS_MPEG4DEC_HANDLE *pMpeg4Dec = (EXYNOS_MPEG4DEC_HANDLE *)pVideoDec->hCodecHandle; - OMX_PTR hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle; - - ExynosVideoDecOps *pDecOps = NULL; - ExynosVideoDecBufferOps *pInbufOps = NULL; - ExynosVideoDecBufferOps *pOutbufOps = NULL; CSC_METHOD csc_method = CSC_METHOD_SW; int i, plane; @@ -2063,10 +2021,6 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_Init(OMX_COMPONENTTYPE *pOMXComponent) goto EXIT; } - pDecOps = pMpeg4Dec->hMFCMpeg4Handle.pDecOps; - pInbufOps = pMpeg4Dec->hMFCMpeg4Handle.pInbufOps; - pOutbufOps = pMpeg4Dec->hMFCMpeg4Handle.pOutbufOps; - if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { Exynos_OSAL_SemaphoreCreate(&pExynosInputPort->codecSemID); Exynos_OSAL_QueueCreate(&pExynosInputPort->codecBufferQ, MAX_QUEUE_ELEMENTS); @@ -2157,13 +2111,8 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_Terminate(OMX_COMPONENTTYPE *pOMXComponent) EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; EXYNOS_MPEG4DEC_HANDLE *pMpeg4Dec = (EXYNOS_MPEG4DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; - OMX_PTR hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle; - ExynosVideoDecOps *pDecOps = pMpeg4Dec->hMFCMpeg4Handle.pDecOps; - ExynosVideoDecBufferOps *pInbufOps = pMpeg4Dec->hMFCMpeg4Handle.pInbufOps; - ExynosVideoDecBufferOps *pOutbufOps = pMpeg4Dec->hMFCMpeg4Handle.pOutbufOps; - - int i, plane; + int i; FunctionIn(); @@ -2195,6 +2144,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_Terminate(OMX_COMPONENTTYPE *pOMXComponent) for (i = 0; i < MFC_INPUT_BUFFER_NUM_MAX; i++) { if (pVideoDec->pMFCDecInputBuffer[i] != NULL) { #ifndef TIZEN_FEATURE_E3250 /* do not use ion */ + int plane; for (plane = 0; plane < MFC_INPUT_BUFFER_PLANE; plane++) { if (pVideoDec->pMFCDecInputBuffer[i]->pVirAddr[plane] != NULL) Exynos_OSAL_SharedMemory_Free(pVideoDec->hSharedMemory, pVideoDec->pMFCDecInputBuffer[i]->pVirAddr[plane]); @@ -2215,7 +2165,6 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_Terminate(OMX_COMPONENTTYPE *pOMXComponent) } Mpeg4CodecClose(pMpeg4Dec); -EXIT: FunctionOut(); return ret; @@ -2225,18 +2174,13 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_SrcIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX { 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; EXYNOS_MPEG4DEC_HANDLE *pMpeg4Dec = (EXYNOS_MPEG4DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; void *hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle; - EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; - EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; OMX_U32 oneFrameSize = pSrcInputData->dataLen; OMX_BOOL bInStartCode = OMX_FALSE; ExynosVideoDecOps *pDecOps = pMpeg4Dec->hMFCMpeg4Handle.pDecOps; ExynosVideoDecBufferOps *pInbufOps = pMpeg4Dec->hMFCMpeg4Handle.pInbufOps; - ExynosVideoDecBufferOps *pOutbufOps = pMpeg4Dec->hMFCMpeg4Handle.pOutbufOps; ExynosVideoErrorType codecReturn = VIDEO_ERROR_NONE; - int i; FunctionIn(); @@ -2308,7 +2252,6 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_SrcOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OM EXYNOS_MPEG4DEC_HANDLE *pMpeg4Dec = (EXYNOS_MPEG4DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; void *hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle; EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; - ExynosVideoDecOps *pDecOps = pMpeg4Dec->hMFCMpeg4Handle.pDecOps; ExynosVideoDecBufferOps *pInbufOps = pMpeg4Dec->hMFCMpeg4Handle.pInbufOps; ExynosVideoBuffer *pVideoBuffer; @@ -2366,7 +2309,6 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_DstIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX EXYNOS_MPEG4DEC_HANDLE *pMpeg4Dec = (EXYNOS_MPEG4DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; void *hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle; EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; - ExynosVideoDecOps *pDecOps = pMpeg4Dec->hMFCMpeg4Handle.pDecOps; ExynosVideoDecBufferOps *pOutbufOps = pMpeg4Dec->hMFCMpeg4Handle.pOutbufOps; OMX_U32 dataLen[MFC_OUTPUT_BUFFER_PLANE] = {0,}; ExynosVideoErrorType codecReturn = VIDEO_ERROR_NONE; @@ -2419,7 +2361,6 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OM EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle; EXYNOS_MPEG4DEC_HANDLE *pMpeg4Dec = (EXYNOS_MPEG4DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; void *hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle; - EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; ExynosVideoDecOps *pDecOps = pMpeg4Dec->hMFCMpeg4Handle.pDecOps; ExynosVideoDecBufferOps *pOutbufOps = pMpeg4Dec->hMFCMpeg4Handle.pOutbufOps; @@ -2568,7 +2509,6 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_srcInputBufferProcess(OMX_COMPONENTTYPE *pOMXCompo { OMX_ERRORTYPE ret = OMX_ErrorNone; EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; - EXYNOS_MPEG4DEC_HANDLE *pMpeg4Dec = (EXYNOS_MPEG4DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; FunctionIn(); @@ -2584,8 +2524,8 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_srcInputBufferProcess(OMX_COMPONENTTYPE *pOMXCompo ret = Exynos_Mpeg4Dec_SrcIn(pOMXComponent, pSrcInputData); if ((ret != OMX_ErrorNone) && - (ret != OMX_ErrorInputDataDecodeYet) && - (ret != OMX_ErrorCorruptedFrame)) { + (ret != (OMX_ERRORTYPE)OMX_ErrorInputDataDecodeYet) && + (ret != (OMX_ERRORTYPE)OMX_ErrorCorruptedFrame)) { pExynosComponent->pCallbacks->EventHandler((OMX_HANDLETYPE)pOMXComponent, pExynosComponent->callbackData, OMX_EventError, ret, 0, NULL); diff --git a/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c b/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c index cbd65e9..b809ed9 100755 --- a/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c +++ b/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c @@ -44,6 +44,7 @@ #include "ExynosVideoApi.h" #include "Exynos_OSAL_SharedMemory.h" #include "Exynos_OSAL_Event.h" +#include "Exynos_OMX_VdecControl.h" #ifdef USE_PB #include "Exynos_OSAL_Platform_Specific.h" @@ -75,16 +76,13 @@ const OMX_U32 wmva = 0x41564d57; static OMX_ERRORTYPE GetCodecInputPrivateData(OMX_PTR codecBuffer, void *pVirtAddr, OMX_U32 *dataSize) { - OMX_ERRORTYPE ret = OMX_ErrorNone; - -EXIT: - return ret; + return OMX_ErrorNone; } -static OMX_ERRORTYPE GetCodecOutputPrivateData(OMX_PTR codecBuffer, void *addr[], int size[]) +static OMX_ERRORTYPE GetCodecOutputPrivateData(OMX_PTR codecBuffer, OMX_PTR addr[], OMX_U32 size[]) { - OMX_ERRORTYPE ret = OMX_ErrorNone; - ExynosVideoBuffer *pCodecBuffer; + OMX_ERRORTYPE ret = OMX_ErrorNone; + ExynosVideoBuffer *pCodecBuffer = NULL; if (codecBuffer == NULL) { ret = OMX_ErrorBadParameter; @@ -271,7 +269,7 @@ static OMX_BOOL Make_Stream_MetaData( switch (wmvFormat) { case WMV_FORMAT_WMV3: - if (*pStreamSize >= BITMAPINFOHEADER_SIZE) { + #ifndef TIZEN_FEATURE_E3250 BitmapInfoHhr *pBitmapInfoHeader; pBitmapInfoHeader = (BitmapInfoHhr *)pInputStream; @@ -319,10 +317,6 @@ static OMX_BOOL Make_Stream_MetaData( *pStreamSize = currPos; return OMX_TRUE; - } else { - Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "%s: *pStreamSize is too small to contain metadata(%d)", __FUNCTION__, *pStreamSize); - return OMX_FALSE; - } break; case WMV_FORMAT_VC1: if (*pStreamSize >= BITMAPINFOHEADER_ASFBINDING_SIZE) { @@ -351,7 +345,6 @@ static OMX_BOOL Make_Stream_StartCode( /* first 4 bytes : size of Frame, second 4 bytes : present Time stamp */ OMX_U8 frameStartCode2[8] = {0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00}; #endif - OMX_U32 i; switch (wmvFormat) { case WMV_FORMAT_WMV3: @@ -383,10 +376,8 @@ OMX_ERRORTYPE Process_Wmv_CodecConfigData(OMX_COMPONENTTYPE *pOMXComponent, void 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; - EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; - EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; EXYNOS_WMVDEC_HANDLE *pWmvDec = (EXYNOS_WMVDEC_HANDLE *)pVideoDec->hCodecHandle; - OMX_PTR hMFCHandle = pWmvDec->hMFCWmvHandle.hMFCHandle; + #ifdef TIZEN_FEATURE_E3250 EXYNOS_OMX_DATABUFFER *pSrcInputData = (EXYNOS_OMX_DATA *)pConfig; OMX_U8 *pInputStream = pSrcInputData->bufferHeader->pBuffer; @@ -592,7 +583,6 @@ OMX_ERRORTYPE WmvCodecStart(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortIndex { OMX_ERRORTYPE ret = OMX_ErrorNone; void *hMFCHandle = NULL; - ExynosVideoDecOps *pDecOps = NULL; ExynosVideoDecBufferOps *pInbufOps = NULL; ExynosVideoDecBufferOps *pOutbufOps = NULL; EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = NULL; @@ -618,7 +608,6 @@ OMX_ERRORTYPE WmvCodecStart(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortIndex } hMFCHandle = pWmvDec->hMFCWmvHandle.hMFCHandle; - pDecOps = pWmvDec->hMFCWmvHandle.pDecOps; pInbufOps = pWmvDec->hMFCWmvHandle.pInbufOps; pOutbufOps = pWmvDec->hMFCWmvHandle.pOutbufOps; @@ -639,7 +628,6 @@ OMX_ERRORTYPE WmvCodecStop(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortIndex) { OMX_ERRORTYPE ret = OMX_ErrorNone; void *hMFCHandle = NULL; - ExynosVideoDecOps *pDecOps = NULL; ExynosVideoDecBufferOps *pInbufOps = NULL; ExynosVideoDecBufferOps *pOutbufOps = NULL; EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = NULL; @@ -664,7 +652,6 @@ OMX_ERRORTYPE WmvCodecStop(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortIndex) } hMFCHandle = pWmvDec->hMFCWmvHandle.hMFCHandle; - pDecOps = pWmvDec->hMFCWmvHandle.pDecOps; pInbufOps = pWmvDec->hMFCWmvHandle.pInbufOps; pOutbufOps = pWmvDec->hMFCWmvHandle.pOutbufOps; @@ -690,11 +677,9 @@ OMX_ERRORTYPE WmvCodecSrcInit(OMX_COMPONENTTYPE *pOMXComponent) EXYNOS_WMVDEC_HANDLE *pWmvDec = (EXYNOS_WMVDEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; void *hMFCHandle = pWmvDec->hMFCWmvHandle.hMFCHandle; EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; - EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; ExynosVideoDecOps *pDecOps = pWmvDec->hMFCWmvHandle.pDecOps; ExynosVideoDecBufferOps *pInbufOps = pWmvDec->hMFCWmvHandle.pInbufOps; - ExynosVideoDecBufferOps *pOutbufOps = pWmvDec->hMFCWmvHandle.pOutbufOps; ExynosVideoGeometry bufferConf; OMX_U32 inputBufferNumber = 0; int i, plane; @@ -817,10 +802,6 @@ EXIT: OMX_ERRORTYPE WmvCodecOutputBufferProcessRun(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortIndex) { OMX_ERRORTYPE ret = OMX_ErrorNone; - void *hMFCHandle = NULL; - ExynosVideoDecOps *pDecOps = NULL; - ExynosVideoDecBufferOps *pInbufOps = NULL; - ExynosVideoDecBufferOps *pOutbufOps = NULL; EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = NULL; EXYNOS_WMVDEC_HANDLE *pWmvDec = NULL; @@ -842,11 +823,6 @@ OMX_ERRORTYPE WmvCodecOutputBufferProcessRun(OMX_COMPONENTTYPE *pOMXComponent, O goto EXIT; } - hMFCHandle = pWmvDec->hMFCWmvHandle.hMFCHandle; - pDecOps = pWmvDec->hMFCWmvHandle.pDecOps; - pInbufOps = pWmvDec->hMFCWmvHandle.pInbufOps; - pOutbufOps = pWmvDec->hMFCWmvHandle.pOutbufOps; - if (nPortIndex == INPUT_PORT_INDEX) { if (pWmvDec->bSourceStart == OMX_FALSE) { Exynos_OSAL_SignalSet(pWmvDec->hSourceStartEvent); @@ -876,8 +852,6 @@ OMX_ERRORTYPE WmvCodecEnQueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle; EXYNOS_WMVDEC_HANDLE *pWmvDec = (EXYNOS_WMVDEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; void *hMFCHandle = pWmvDec->hMFCWmvHandle.hMFCHandle; - EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; - EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; int i, nOutbufs; ExynosVideoDecOps *pDecOps = pWmvDec->hMFCWmvHandle.pDecOps; @@ -905,7 +879,6 @@ OMX_ERRORTYPE WmvCodecEnQueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 pInbufOps->Clear_Queue(hMFCHandle); } else if ((nPortIndex == OUTPUT_PORT_INDEX) && (pWmvDec->bDestinationStart == OMX_TRUE)) { - OMX_U32 dataLen[MFC_OUTPUT_BUFFER_PLANE] = {0, 0}; ExynosVideoBuffer *pBuffer = NULL; Exynos_CodecBufferReset(pExynosComponent, OUTPUT_PORT_INDEX); @@ -928,7 +901,6 @@ EXIT: OMX_ERRORTYPE WmvCodecDstFreeCodecBuffers( OMX_COMPONENTTYPE *pOMXComponent) { - 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; EXYNOS_WMVDEC_HANDLE *pWmvDec = (EXYNOS_WMVDEC_HANDLE *)pVideoDec->hCodecHandle; @@ -1066,8 +1038,6 @@ OMX_ERRORTYPE WmvCodecResetupAllElement( EXYNOS_OMX_BASEPORT *pOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; ExynosVideoDecBufferOps *pOutbufOps = pWmvDec->hMFCWmvHandle.pOutbufOps; - int i, j, nOutbufs; - FunctionIn(); if ((nPortIndex == INPUT_PORT_INDEX) && @@ -1117,11 +1087,9 @@ OMX_ERRORTYPE WmvCodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA { 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; EXYNOS_WMVDEC_HANDLE *pWmvDec = (EXYNOS_WMVDEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; void *hMFCHandle = pWmvDec->hMFCWmvHandle.hMFCHandle; EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; - EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; OMX_U32 oneFrameSize = pSrcInputData->dataLen; OMX_BOOL bMetaData = OMX_FALSE; @@ -1129,8 +1097,6 @@ OMX_ERRORTYPE WmvCodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA ExynosVideoDecBufferOps *pInbufOps = pWmvDec->hMFCWmvHandle.pInbufOps; ExynosVideoDecBufferOps *pOutbufOps = pWmvDec->hMFCWmvHandle.pOutbufOps; ExynosVideoGeometry bufferConf; - OMX_U32 inputBufferNumber = 0; - int i; FunctionIn(); @@ -1235,11 +1201,8 @@ OMX_ERRORTYPE WmvCodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle; EXYNOS_WMVDEC_HANDLE *pWmvDec = (EXYNOS_WMVDEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; void *hMFCHandle = pWmvDec->hMFCWmvHandle.hMFCHandle; - EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; - ExynosVideoDecOps *pDecOps = pWmvDec->hMFCWmvHandle.pDecOps; - ExynosVideoDecBufferOps *pInbufOps = pWmvDec->hMFCWmvHandle.pInbufOps; ExynosVideoDecBufferOps *pOutbufOps = pWmvDec->hMFCWmvHandle.pOutbufOps; int i, nOutbufs; @@ -1367,10 +1330,7 @@ OMX_ERRORTYPE WmvCodecCheckResolutionChange(OMX_COMPONENTTYPE *pOMXComponent) EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; ExynosVideoDecOps *pDecOps = pWmvDec->hMFCWmvHandle.pDecOps; - ExynosVideoDecBufferOps *pInbufOps = pWmvDec->hMFCWmvHandle.pInbufOps; ExynosVideoDecBufferOps *pOutbufOps = pWmvDec->hMFCWmvHandle.pOutbufOps; - ExynosVideoGeometry bufferConf; - int i; FunctionIn(); @@ -1865,7 +1825,6 @@ OMX_ERRORTYPE Exynos_WmvDec_GetExtensionIndex( } if (Exynos_OSAL_Strcmp(cParameterName, EXYNOS_INDEX_PARAM_ENABLE_THUMBNAIL) == 0) { - EXYNOS_WMVDEC_HANDLE *pWmvDec = (EXYNOS_WMVDEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; *pIndexType = OMX_IndexVendorThumbnailMode; ret = OMX_ErrorNone; } else { @@ -1884,8 +1843,6 @@ OMX_ERRORTYPE Exynos_WmvDec_ComponentRoleEnum( OMX_U32 nIndex) { OMX_ERRORTYPE ret = OMX_ErrorNone; - OMX_COMPONENTTYPE *pOMXComponent = NULL; - EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL; FunctionIn(); @@ -1915,11 +1872,6 @@ OMX_ERRORTYPE Exynos_WmvDec_Init(OMX_COMPONENTTYPE *pOMXComponent) EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; EXYNOS_WMVDEC_HANDLE *pWmvDec = (EXYNOS_WMVDEC_HANDLE *)pVideoDec->hCodecHandle; - OMX_PTR hMFCHandle = pWmvDec->hMFCWmvHandle.hMFCHandle; - - ExynosVideoDecOps *pDecOps = NULL; - ExynosVideoDecBufferOps *pInbufOps = NULL; - ExynosVideoDecBufferOps *pOutbufOps = NULL; CSC_METHOD csc_method = CSC_METHOD_SW; int i, plane; @@ -1937,10 +1889,6 @@ OMX_ERRORTYPE Exynos_WmvDec_Init(OMX_COMPONENTTYPE *pOMXComponent) goto EXIT; } - pDecOps = pWmvDec->hMFCWmvHandle.pDecOps; - pInbufOps = pWmvDec->hMFCWmvHandle.pInbufOps; - pOutbufOps = pWmvDec->hMFCWmvHandle.pOutbufOps; - if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { Exynos_OSAL_SemaphoreCreate(&pExynosInputPort->codecSemID); Exynos_OSAL_QueueCreate(&pExynosInputPort->codecBufferQ, MAX_QUEUE_ELEMENTS); @@ -2028,11 +1976,6 @@ OMX_ERRORTYPE Exynos_WmvDec_Terminate(OMX_COMPONENTTYPE *pOMXComponent) EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; EXYNOS_WMVDEC_HANDLE *pWmvDec = (EXYNOS_WMVDEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; - OMX_PTR hMFCHandle = pWmvDec->hMFCWmvHandle.hMFCHandle; - - ExynosVideoDecOps *pDecOps = pWmvDec->hMFCWmvHandle.pDecOps; - ExynosVideoDecBufferOps *pInbufOps = pWmvDec->hMFCWmvHandle.pInbufOps; - ExynosVideoDecBufferOps *pOutbufOps = pWmvDec->hMFCWmvHandle.pOutbufOps; int i, plane; @@ -2085,7 +2028,6 @@ OMX_ERRORTYPE Exynos_WmvDec_Terminate(OMX_COMPONENTTYPE *pOMXComponent) } WmvCodecClose(pWmvDec); -EXIT: FunctionOut(); return ret; @@ -2095,18 +2037,13 @@ OMX_ERRORTYPE Exynos_WmvDec_SrcIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_D { 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; EXYNOS_WMVDEC_HANDLE *pWmvDec = (EXYNOS_WMVDEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; void *hMFCHandle = pWmvDec->hMFCWmvHandle.hMFCHandle; - EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; - EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; OMX_U32 oneFrameSize = pSrcInputData->dataLen; OMX_BOOL bStartCode = OMX_FALSE; ExynosVideoDecOps *pDecOps = pWmvDec->hMFCWmvHandle.pDecOps; ExynosVideoDecBufferOps *pInbufOps = pWmvDec->hMFCWmvHandle.pInbufOps; - ExynosVideoDecBufferOps *pOutbufOps = pWmvDec->hMFCWmvHandle.pOutbufOps; ExynosVideoErrorType codecReturn = VIDEO_ERROR_NONE; - int i; FunctionIn(); @@ -2191,7 +2128,6 @@ OMX_ERRORTYPE Exynos_WmvDec_SrcOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_ EXYNOS_WMVDEC_HANDLE *pWmvDec = (EXYNOS_WMVDEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; void *hMFCHandle = pWmvDec->hMFCWmvHandle.hMFCHandle; EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; - ExynosVideoDecOps *pDecOps = pWmvDec->hMFCWmvHandle.pDecOps; ExynosVideoDecBufferOps *pInbufOps = pWmvDec->hMFCWmvHandle.pInbufOps; ExynosVideoBuffer *pVideoBuffer; @@ -2249,7 +2185,6 @@ OMX_ERRORTYPE Exynos_WmvDec_DstIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_D EXYNOS_WMVDEC_HANDLE *pWmvDec = (EXYNOS_WMVDEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; void *hMFCHandle = pWmvDec->hMFCWmvHandle.hMFCHandle; EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; - ExynosVideoDecOps *pDecOps = pWmvDec->hMFCWmvHandle.pDecOps; ExynosVideoDecBufferOps *pOutbufOps = pWmvDec->hMFCWmvHandle.pOutbufOps; OMX_U32 dataLen[2] = {0,}; ExynosVideoErrorType codecReturn = VIDEO_ERROR_NONE; @@ -2303,7 +2238,6 @@ OMX_ERRORTYPE Exynos_WmvDec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_ EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle; EXYNOS_WMVDEC_HANDLE *pWmvDec = (EXYNOS_WMVDEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; void *hMFCHandle = pWmvDec->hMFCWmvHandle.hMFCHandle; - EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; ExynosVideoDecOps *pDecOps = pWmvDec->hMFCWmvHandle.pDecOps; ExynosVideoDecBufferOps *pOutbufOps = pWmvDec->hMFCWmvHandle.pOutbufOps; @@ -2451,7 +2385,6 @@ OMX_ERRORTYPE Exynos_WmvDec_srcInputBufferProcess(OMX_COMPONENTTYPE *pOMXCompone { OMX_ERRORTYPE ret = OMX_ErrorNone; EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; - EXYNOS_WMVDEC_HANDLE *pWmvDec = (EXYNOS_WMVDEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; FunctionIn(); @@ -2466,7 +2399,7 @@ OMX_ERRORTYPE Exynos_WmvDec_srcInputBufferProcess(OMX_COMPONENTTYPE *pOMXCompone } ret = Exynos_WmvDec_SrcIn(pOMXComponent, pSrcInputData); - if ((ret != OMX_ErrorNone) && (ret != OMX_ErrorInputDataDecodeYet)) { + if ((ret != OMX_ErrorNone) && (ret != (OMX_ERRORTYPE)OMX_ErrorInputDataDecodeYet)) { pExynosComponent->pCallbacks->EventHandler((OMX_HANDLETYPE)pOMXComponent, pExynosComponent->callbackData, OMX_EventError, ret, 0, NULL); diff --git a/openmax/component/video/enc/Exynos_OMX_Venc.c b/openmax/component/video/enc/Exynos_OMX_Venc.c old mode 100755 new mode 100644 index c66643c..1b1b0ed --- a/openmax/component/video/enc/Exynos_OMX_Venc.c +++ b/openmax/component/video/enc/Exynos_OMX_Venc.c @@ -40,6 +40,7 @@ #include "Exynos_OSAL_ETC.h" #include "ExynosVideoApi.h" #include "csc.h" +#include "Exynos_OSAL_SharedMemory.h" #undef EXYNOS_LOG_TAG #define EXYNOS_LOG_TAG "EXYNOS_VIDEO_ENC" @@ -95,7 +96,6 @@ OMX_BOOL Exynos_Check_BufferProcess_State(EXYNOS_OMX_BASECOMPONENT *pExynosCompo OMX_ERRORTYPE Exynos_Input_CodecBufferToData(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, OMX_PTR codecBuffer, EXYNOS_OMX_DATA *pData) { OMX_ERRORTYPE ret = OMX_ErrorNone; - EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle; CODEC_ENC_BUFFER *pInputCodecBuffer = (CODEC_ENC_BUFFER*)codecBuffer; pData->buffer.multiPlaneBuffer.dataBuffer[0] = pInputCodecBuffer->pVirAddr[0]; @@ -137,8 +137,6 @@ OMX_ERRORTYPE Exynos_Output_CodecBufferToData(EXYNOS_OMX_BASECOMPONENT *pExynosC void Exynos_Wait_ProcessPause(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, OMX_U32 nPortIndex) { - EXYNOS_OMX_BASEPORT *exynosOMXInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; - EXYNOS_OMX_BASEPORT *exynosOMXOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; EXYNOS_OMX_BASEPORT *exynosOMXPort = NULL; FunctionIn(); @@ -171,7 +169,6 @@ OMX_BOOL Exynos_CSC_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA OMX_U32 nFrameHeight = exynosInputPort->portDefinition.format.video.nFrameHeight; OMX_COLOR_FORMATTYPE eColorFormat = exynosInputPort->portDefinition.format.video.eColorFormat; OMX_BYTE checkInputStream = NULL; - OMX_BOOL flagEOS = OMX_FALSE; FunctionIn(); @@ -200,9 +197,9 @@ OMX_BOOL Exynos_CSC_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA 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]; + pDstBuf[0] = (unsigned char*)(&srcInputData->buffer.multiPlaneBuffer.fd[0]); + pDstBuf[1] = (unsigned char*)(&srcInputData->buffer.multiPlaneBuffer.fd[1]); + pDstBuf[2] = (unsigned char*)(&srcInputData->buffer.multiPlaneBuffer.fd[2]); } #ifdef USE_METADATABUFFERTYPE @@ -306,7 +303,6 @@ OMX_BOOL Exynos_CSC_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA ret = OMX_TRUE; -EXIT: FunctionOut(); return ret; @@ -316,16 +312,10 @@ OMX_BOOL Exynos_Preprocessor_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_ { OMX_BOOL ret = OMX_FALSE; EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; - EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle; EXYNOS_OMX_BASEPORT *exynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; EXYNOS_OMX_DATABUFFER *inputUseBuffer = &exynosInputPort->way.port2WayDataBuffer.inputDataBuffer; - OMX_U32 nFrameWidth = exynosInputPort->portDefinition.format.video.nFrameWidth; - OMX_U32 nFrameHeight = exynosInputPort->portDefinition.format.video.nFrameHeight; - OMX_COLOR_FORMATTYPE eColorFormat = exynosInputPort->portDefinition.format.video.eColorFormat; OMX_U32 copySize = 0; - OMX_BYTE checkInputStream = NULL; OMX_U32 checkInputStreamLen = 0; - OMX_BOOL flagEOS = OMX_FALSE; FunctionIn(); @@ -349,6 +339,8 @@ OMX_BOOL Exynos_Preprocessor_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_ /* kMetadataBufferTypeCameraSource */ Exynos_OSAL_GetInfoFromMetaData((OMX_BYTE)inputUseBuffer->bufferHeader->pBuffer, ppBuf); #ifdef USE_DMA_BUF + EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle; + srcInputData->buffer.multiPlaneBuffer.fd[0] = ppBuf[0]; srcInputData->buffer.multiPlaneBuffer.fd[1] = ppBuf[1]; allocSize[0] = nFrameWidth * nFrameHeight; @@ -393,14 +385,12 @@ OMX_BOOL Exynos_Preprocessor_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_ /* reset dataBuffer */ Exynos_ResetDataBuffer(inputUseBuffer); } else if (exynosInputPort->bufferProcessType & BUFFER_COPY) { - checkInputStream = inputUseBuffer->bufferHeader->pBuffer + inputUseBuffer->usedDataLen; checkInputStreamLen = inputUseBuffer->remainDataLen; pExynosComponent->bUseFlagEOF = OMX_TRUE; if (checkInputStreamLen == 0) { inputUseBuffer->nFlags |= OMX_BUFFERFLAG_EOS; - flagEOS = OMX_TRUE; } copySize = checkInputStreamLen; @@ -550,7 +540,6 @@ OMX_ERRORTYPE Exynos_OMX_SrcInputBufferProcess(OMX_HANDLETYPE hComponent) EXYNOS_OMX_DATABUFFER *srcInputUseBuffer = &exynosInputPort->way.port2WayDataBuffer.inputDataBuffer; EXYNOS_OMX_DATA *pSrcInputData = &exynosInputPort->processData; OMX_BOOL bCheckInputData = OMX_FALSE; - OMX_BOOL bValidCodecData = OMX_FALSE; FunctionIn(); @@ -601,13 +590,11 @@ OMX_ERRORTYPE Exynos_OMX_SrcInputBufferProcess(OMX_HANDLETYPE hComponent) ret = pVideoEnc->exynos_codec_srcInputProcess(pOMXComponent, pSrcInputData); Exynos_ResetCodecData(pSrcInputData); Exynos_OSAL_MutexUnlock(srcInputUseBuffer->bufferMutex); - if (ret == OMX_ErrorCodecInit) + if (ret == (OMX_ERRORTYPE)OMX_ErrorCodecInit) pVideoEnc->bExitBufferProcessThread = OMX_TRUE; } } -EXIT: - FunctionOut(); return ret; @@ -658,8 +645,6 @@ OMX_ERRORTYPE Exynos_OMX_SrcOutputBufferProcess(OMX_HANDLETYPE hComponent) } } -EXIT: - FunctionOut(); return ret; @@ -725,8 +710,6 @@ OMX_ERRORTYPE Exynos_OMX_DstInputBufferProcess(OMX_HANDLETYPE hComponent) } } -EXIT: - FunctionOut(); return ret; @@ -791,8 +774,6 @@ OMX_ERRORTYPE Exynos_OMX_DstOutputBufferProcess(OMX_HANDLETYPE hComponent) } } -EXIT: - FunctionOut(); return ret; @@ -802,8 +783,6 @@ static OMX_ERRORTYPE Exynos_OMX_SrcInputProcessThread(OMX_PTR threadData) { OMX_ERRORTYPE ret = OMX_ErrorNone; OMX_COMPONENTTYPE *pOMXComponent = NULL; - EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL; - EXYNOS_OMX_MESSAGE *message = NULL; FunctionIn(); @@ -816,7 +795,6 @@ static OMX_ERRORTYPE Exynos_OMX_SrcInputProcessThread(OMX_PTR threadData) if (ret != OMX_ErrorNone) { goto EXIT; } - pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; Exynos_OMX_SrcInputBufferProcess(pOMXComponent); Exynos_OSAL_ThreadExit(NULL); @@ -831,8 +809,6 @@ static OMX_ERRORTYPE Exynos_OMX_SrcOutputProcessThread(OMX_PTR threadData) { OMX_ERRORTYPE ret = OMX_ErrorNone; OMX_COMPONENTTYPE *pOMXComponent = NULL; - EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL; - EXYNOS_OMX_MESSAGE *message = NULL; FunctionIn(); @@ -845,7 +821,6 @@ static OMX_ERRORTYPE Exynos_OMX_SrcOutputProcessThread(OMX_PTR threadData) if (ret != OMX_ErrorNone) { goto EXIT; } - pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; Exynos_OMX_SrcOutputBufferProcess(pOMXComponent); Exynos_OSAL_ThreadExit(NULL); @@ -860,8 +835,6 @@ static OMX_ERRORTYPE Exynos_OMX_DstInputProcessThread(OMX_PTR threadData) { OMX_ERRORTYPE ret = OMX_ErrorNone; OMX_COMPONENTTYPE *pOMXComponent = NULL; - EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL; - EXYNOS_OMX_MESSAGE *message = NULL; FunctionIn(); @@ -874,7 +847,6 @@ static OMX_ERRORTYPE Exynos_OMX_DstInputProcessThread(OMX_PTR threadData) if (ret != OMX_ErrorNone) { goto EXIT; } - pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; Exynos_OMX_DstInputBufferProcess(pOMXComponent); Exynos_OSAL_ThreadExit(NULL); @@ -889,8 +861,6 @@ static OMX_ERRORTYPE Exynos_OMX_DstOutputProcessThread(OMX_PTR threadData) { OMX_ERRORTYPE ret = OMX_ErrorNone; OMX_COMPONENTTYPE *pOMXComponent = NULL; - EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL; - EXYNOS_OMX_MESSAGE *message = NULL; FunctionIn(); @@ -903,7 +873,6 @@ static OMX_ERRORTYPE Exynos_OMX_DstOutputProcessThread(OMX_PTR threadData) if (ret != OMX_ErrorNone) { goto EXIT; } - pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; Exynos_OMX_DstOutputBufferProcess(pOMXComponent); Exynos_OSAL_ThreadExit(NULL); @@ -941,7 +910,6 @@ OMX_ERRORTYPE Exynos_OMX_BufferProcess_Create(OMX_HANDLETYPE hComponent) Exynos_OMX_SrcInputProcessThread, pOMXComponent); -EXIT: FunctionOut(); return ret; @@ -954,7 +922,6 @@ OMX_ERRORTYPE Exynos_OMX_BufferProcess_Terminate(OMX_HANDLETYPE hComponent) EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle; OMX_S32 countValue = 0; - unsigned int i = 0; FunctionIn(); @@ -992,7 +959,6 @@ OMX_ERRORTYPE Exynos_OMX_BufferProcess_Terminate(OMX_HANDLETYPE hComponent) Exynos_OSAL_ThreadTerminate(pVideoEnc->hDstOutputThread); pVideoEnc->hDstOutputThread = NULL; -EXIT: FunctionOut(); return ret; diff --git a/openmax/component/video/enc/Exynos_OMX_Venc.h b/openmax/component/video/enc/Exynos_OMX_Venc.h index bdd3b08..53f77f9 100755 --- a/openmax/component/video/enc/Exynos_OMX_Venc.h +++ b/openmax/component/video/enc/Exynos_OMX_Venc.h @@ -126,7 +126,7 @@ typedef struct _EXYNOS_OMX_VIDEOENC_COMPONENT int (*exynos_checkInputFrame) (OMX_U8 *pInputStream, OMX_U32 buffSize, OMX_U32 flag, OMX_BOOL bPreviousFrameEOF, OMX_BOOL *pbEndOfFrame); OMX_ERRORTYPE (*exynos_codec_getCodecInputPrivateData) (OMX_PTR codecBuffer, OMX_PTR addr[], OMX_U32 size[]); - OMX_ERRORTYPE (*exynos_codec_getCodecOutputPrivateData) (OMX_PTR codecBuffer, OMX_PTR addr, OMX_U32 *size); + OMX_ERRORTYPE (*exynos_codec_getCodecOutputPrivateData) (OMX_PTR codecBuffer, OMX_PTR *addr, OMX_U32 *size); } EXYNOS_OMX_VIDEOENC_COMPONENT; #ifdef __cplusplus diff --git a/openmax/component/video/enc/Exynos_OMX_VencControl.c b/openmax/component/video/enc/Exynos_OMX_VencControl.c index 7053059..5734400 100755 --- a/openmax/component/video/enc/Exynos_OMX_VencControl.c +++ b/openmax/component/video/enc/Exynos_OMX_VencControl.c @@ -91,8 +91,7 @@ OMX_ERRORTYPE Exynos_OMX_UseBuffer( } pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle; - if ((nPortIndex < 0) || - (nPortIndex >= pExynosComponent->portParam.nPorts)) { + if (nPortIndex >= pExynosComponent->portParam.nPorts) { ret = OMX_ErrorBadPortIndex; goto EXIT; } @@ -222,8 +221,8 @@ OMX_ERRORTYPE Exynos_OMX_AllocateBuffer( } pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle; - if ((nPortIndex < 0) || - (nPortIndex >= pExynosComponent->portParam.nPorts)) { + if (nPortIndex >= pExynosComponent->portParam.nPorts) { + Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "[%p][%s] invalid parameter(0x%x)", pExynosComponent, __FUNCTION__, nPortIndex); ret = OMX_ErrorBadPortIndex; goto EXIT; } @@ -333,8 +332,8 @@ OMX_ERRORTYPE Exynos_OMX_FreeBuffer( } pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle; - if ((nPortIndex < 0) || - (nPortIndex >= pExynosComponent->portParam.nPorts)) { + if (nPortIndex >= pExynosComponent->portParam.nPorts) { + Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "[%p][%s] invalid parameter(0x%x)", pExynosComponent, __FUNCTION__, nPortIndex); ret = OMX_ErrorBadPortIndex; goto EXIT; } @@ -401,31 +400,14 @@ OMX_ERRORTYPE Exynos_OMX_AllocateTunnelBuffer( EXYNOS_OMX_BASEPORT *pOMXBasePort, OMX_U32 nPortIndex) { - OMX_ERRORTYPE ret = OMX_ErrorNone; - EXYNOS_OMX_BASEPORT *pExynosPort = NULL; - OMX_BUFFERHEADERTYPE *pTempBufferHdr = NULL; - OMX_U8 *pTempBuffer = NULL; - OMX_U32 nBufferSize = 0; - OMX_PARAM_PORTDEFINITIONTYPE portDefinition; - - ret = OMX_ErrorTunnelingUnsupported; -EXIT: - return ret; + return OMX_ErrorTunnelingUnsupported; } OMX_ERRORTYPE Exynos_OMX_FreeTunnelBuffer( EXYNOS_OMX_BASEPORT *pOMXBasePort, OMX_U32 nPortIndex) { - OMX_ERRORTYPE ret = OMX_ErrorNone; - EXYNOS_OMX_BASEPORT *pExynosPort = NULL; - OMX_BUFFERHEADERTYPE *pTempBufferHdr = NULL; - OMX_U8 *pTempBuffer = NULL; - OMX_U32 nBufferSize = 0; - - ret = OMX_ErrorTunnelingUnsupported; -EXIT: - return ret; + return OMX_ErrorTunnelingUnsupported; } OMX_ERRORTYPE Exynos_OMX_ComponentTunnelRequest( @@ -435,11 +417,7 @@ OMX_ERRORTYPE Exynos_OMX_ComponentTunnelRequest( OMX_IN OMX_U32 nTunneledPort, OMX_INOUT OMX_TUNNELSETUPTYPE *pTunnelSetup) { - OMX_ERRORTYPE ret = OMX_ErrorNone; - - ret = OMX_ErrorTunnelingUnsupported; -EXIT: - return ret; + return OMX_ErrorTunnelingUnsupported; } OMX_ERRORTYPE Exynos_OMX_GetFlushBuffer( @@ -459,7 +437,6 @@ OMX_ERRORTYPE Exynos_OMX_GetFlushBuffer( pDataBuffer[1] = &(pExynosPort->way.port2WayDataBuffer.outputDataBuffer); } -EXIT: FunctionOut(); return ret; @@ -591,7 +568,6 @@ OMX_ERRORTYPE Exynos_OMX_BufferFlush( EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = NULL; EXYNOS_OMX_BASEPORT *pExynosPort = NULL; EXYNOS_OMX_DATABUFFER *pDataBuffer[2] = {NULL, NULL}; - OMX_U32 i = 0; FunctionIn(); #ifdef TIZEN_FEATURE_E3250 @@ -1126,8 +1102,7 @@ OMX_ERRORTYPE Exynos_CodecBufferEnqueue( goto EXIT; } - if ((nPortIndex < 0) || - (nPortIndex >= pExynosComponent->portParam.nPorts)) { + if (nPortIndex >= pExynosComponent->portParam.nPorts) { ret = OMX_ErrorBadPortIndex; goto EXIT; } @@ -1169,8 +1144,7 @@ OMX_ERRORTYPE Exynos_CodecBufferDequeue( goto EXIT; } - if ((nPortIndex < 0) || - (nPortIndex >= pExynosComponent->portParam.nPorts)) { + if (nPortIndex >= pExynosComponent->portParam.nPorts) { ret = OMX_ErrorBadPortIndex; goto EXIT; } @@ -1206,8 +1180,7 @@ OMX_ERRORTYPE Exynos_CodecBufferReset( goto EXIT; } - if ((nPortIndex < 0) || - (nPortIndex >= pExynosComponent->portParam.nPorts)) { + if (nPortIndex >= pExynosComponent->portParam.nPorts) { ret = OMX_ErrorBadPortIndex; goto EXIT; } @@ -1220,7 +1193,7 @@ OMX_ERRORTYPE Exynos_CodecBufferReset( } while (1) { - int cnt = 0; + OMX_S32 cnt = 0; Exynos_OSAL_Get_SemaphoreCount(pExynosPort->codecSemID, &cnt); if (cnt > 0) Exynos_OSAL_SemaphoreWait(pExynosPort->codecSemID); @@ -1243,7 +1216,6 @@ OMX_ERRORTYPE Exynos_OMX_VideoEncodeGetParameter( OMX_ERRORTYPE ret = OMX_ErrorNone; OMX_COMPONENTTYPE *pOMXComponent = NULL; EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL; - EXYNOS_OMX_BASEPORT *pExynosPort = NULL; FunctionIn(); @@ -1302,8 +1274,7 @@ OMX_ERRORTYPE Exynos_OMX_VideoEncodeGetParameter( goto EXIT; } - if ((nPortIndex < 0) || - (nPortIndex >= pExynosComponent->portParam.nPorts)) { + if (nPortIndex >= pExynosComponent->portParam.nPorts) { ret = OMX_ErrorBadPortIndex; goto EXIT; } @@ -1406,9 +1377,7 @@ OMX_ERRORTYPE Exynos_OMX_VideoEncodeGetParameter( { OMX_VIDEO_PARAM_QUANTIZATIONTYPE *pVideoQuantization = (OMX_VIDEO_PARAM_QUANTIZATIONTYPE *)pComponentParameterStructure; OMX_U32 nPortIndex = pVideoQuantization->nPortIndex; - EXYNOS_OMX_BASEPORT *pExynosPort = NULL; EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = NULL; - OMX_PARAM_PORTDEFINITIONTYPE *pPortDef = NULL; if (nPortIndex != OUTPUT_PORT_INDEX) { ret = OMX_ErrorBadPortIndex; @@ -1419,8 +1388,6 @@ OMX_ERRORTYPE Exynos_OMX_VideoEncodeGetParameter( ret = OMX_ErrorBadParameter; goto EXIT; } - pExynosPort = &pExynosComponent->pExynosPort[nPortIndex]; - pPortDef = &pExynosPort->portDefinition; pVideoQuantization->nQpI = pVideoEnc->quantization.nQpI; pVideoQuantization->nQpP = pVideoEnc->quantization.nQpP; @@ -1435,8 +1402,7 @@ OMX_ERRORTYPE Exynos_OMX_VideoEncodeGetParameter( OMX_U32 nPortIndex = pPortDef->nPortIndex; EXYNOS_OMX_BASEPORT *pExynosPort = NULL; - if ((nPortIndex < 0) || - (nPortIndex >= pExynosComponent->portParam.nPorts)) { + if (nPortIndex >= pExynosComponent->portParam.nPorts) { ret = OMX_ErrorBadPortIndex; goto EXIT; } @@ -1477,7 +1443,6 @@ OMX_ERRORTYPE Exynos_OMX_VideoEncodeSetParameter( OMX_ERRORTYPE ret = OMX_ErrorNone; OMX_COMPONENTTYPE *pOMXComponent = NULL; EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL; - EXYNOS_OMX_BASEPORT *pExynosPort = NULL; FunctionIn(); @@ -1513,17 +1478,14 @@ OMX_ERRORTYPE Exynos_OMX_VideoEncodeSetParameter( { OMX_VIDEO_PARAM_PORTFORMATTYPE *pPortFormat = (OMX_VIDEO_PARAM_PORTFORMATTYPE *)pComponentParameterStructure; OMX_U32 nPortIndex = pPortFormat->nPortIndex; - OMX_U32 nIndex = pPortFormat->nIndex; OMX_PARAM_PORTDEFINITIONTYPE *pPortDef = NULL; - OMX_U32 nSupportFormat = 0; ret = Exynos_OMX_Check_SizeVersion(pPortFormat, sizeof(OMX_VIDEO_PARAM_PORTFORMATTYPE)); if (ret != OMX_ErrorNone) { goto EXIT; } - if ((nPortIndex < 0) || - (nPortIndex >= pExynosComponent->portParam.nPorts)) { + if (nPortIndex >= pExynosComponent->portParam.nPorts) { ret = OMX_ErrorBadPortIndex; goto EXIT; } @@ -1538,7 +1500,6 @@ OMX_ERRORTYPE Exynos_OMX_VideoEncodeSetParameter( { OMX_VIDEO_PARAM_BITRATETYPE *pVideoBitrate = (OMX_VIDEO_PARAM_BITRATETYPE *)pComponentParameterStructure; OMX_U32 nPortIndex = pVideoBitrate->nPortIndex; - EXYNOS_OMX_BASEPORT *pExynosPort = NULL; EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = NULL; OMX_PARAM_PORTDEFINITIONTYPE *pPortDef = NULL; @@ -1563,9 +1524,7 @@ OMX_ERRORTYPE Exynos_OMX_VideoEncodeSetParameter( { OMX_VIDEO_PARAM_QUANTIZATIONTYPE *pVideoQuantization = (OMX_VIDEO_PARAM_QUANTIZATIONTYPE *)pComponentParameterStructure; OMX_U32 nPortIndex = pVideoQuantization->nPortIndex; - EXYNOS_OMX_BASEPORT *pExynosPort = NULL; EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = NULL; - OMX_PARAM_PORTDEFINITIONTYPE *pPortDef = NULL; if (nPortIndex != OUTPUT_PORT_INDEX) { ret = OMX_ErrorBadPortIndex; @@ -1576,8 +1535,6 @@ OMX_ERRORTYPE Exynos_OMX_VideoEncodeSetParameter( ret = OMX_ErrorBadParameter; goto EXIT; } - pExynosPort = &pExynosComponent->pExynosPort[nPortIndex]; - pPortDef = &pExynosPort->portDefinition; pVideoEnc->quantization.nQpI = pVideoQuantization->nQpI; pVideoEnc->quantization.nQpP = pVideoQuantization->nQpP; @@ -1591,10 +1548,8 @@ OMX_ERRORTYPE Exynos_OMX_VideoEncodeSetParameter( OMX_PARAM_PORTDEFINITIONTYPE *pPortDef = (OMX_PARAM_PORTDEFINITIONTYPE *)pComponentParameterStructure; OMX_U32 nPortIndex = pPortDef->nPortIndex; EXYNOS_OMX_BASEPORT *pExynosPort = NULL; - OMX_U32 width, height, size; - if ((nPortIndex < 0) || - (nPortIndex >= pExynosComponent->portParam.nPorts)) { + if (nPortIndex >= pExynosComponent->portParam.nPorts) { ret = OMX_ErrorBadPortIndex; goto EXIT; } diff --git a/openmax/component/video/enc/Exynos_OMX_VencControl.h b/openmax/component/video/enc/Exynos_OMX_VencControl.h old mode 100644 new mode 100755 index f2bd4ed..3a7b5f4 --- a/openmax/component/video/enc/Exynos_OMX_VencControl.h +++ b/openmax/component/video/enc/Exynos_OMX_VencControl.h @@ -87,6 +87,23 @@ OMX_ERRORTYPE Exynos_OMX_VideoEncodeGetExtensionIndex( OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_STRING szParameterName, OMX_OUT OMX_INDEXTYPE *pIndexType); +OMX_ERRORTYPE Exynos_OutputBufferGetQueue( + EXYNOS_OMX_BASECOMPONENT *pExynosComponent); +OMX_BUFFERHEADERTYPE *Exynos_OutputBufferGetQueue_Direct( + EXYNOS_OMX_BASECOMPONENT *pExynosComponent); +OMX_ERRORTYPE Exynos_InputBufferGetQueue( + EXYNOS_OMX_BASECOMPONENT *pExynosComponent); +OMX_ERRORTYPE Exynos_CodecBufferEnqueue( + EXYNOS_OMX_BASECOMPONENT *pExynosComponent, + OMX_U32 nPortIndex, + OMX_PTR pData); +OMX_ERRORTYPE Exynos_CodecBufferReset( + EXYNOS_OMX_BASECOMPONENT *pExynosComponent, + OMX_U32 nPortIndex); +OMX_ERRORTYPE Exynos_CodecBufferDequeue( + EXYNOS_OMX_BASECOMPONENT *pExynosComponent, + OMX_U32 nPortIndex, + OMX_PTR *pData); OMX_ERRORTYPE Exynos_InputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent); OMX_ERRORTYPE Exynos_OutputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent); OMX_ERRORTYPE Exynos_OMX_BufferFlush(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 nPortIndex, OMX_BOOL bEvent); diff --git a/openmax/component/video/enc/h264/Exynos_OMX_H264enc.c b/openmax/component/video/enc/h264/Exynos_OMX_H264enc.c index 2173513..974bc0c 100755 --- a/openmax/component/video/enc/h264/Exynos_OMX_H264enc.c +++ b/openmax/component/video/enc/h264/Exynos_OMX_H264enc.c @@ -40,6 +40,7 @@ //#include "ExynosVideoApi.h" #include "Exynos_OSAL_SharedMemory.h" #include "Exynos_OSAL_Event.h" +#include "Exynos_OMX_VencControl.h" /* To use CSC_METHOD_HW in EXYNOS OMX, gralloc should allocate physical memory using FIMC */ /* It means GRALLOC_USAGE_HW_FIMC1 should be set on Native Window usage */ @@ -376,10 +377,7 @@ static void Change_H264Enc_Param(EXYNOS_OMX_BASECOMPONENT *pExynosComponent) OMX_ERRORTYPE GetCodecInputPrivateData(OMX_PTR codecBuffer, OMX_PTR addr[], OMX_U32 size[]) { - OMX_ERRORTYPE ret = OMX_ErrorNone; - -EXIT: - return ret; + return OMX_ErrorNone; } OMX_ERRORTYPE GetCodecOutputPrivateData(OMX_PTR codecBuffer, OMX_PTR *pVirtAddr, OMX_U32 *dataSize) @@ -558,7 +556,6 @@ OMX_ERRORTYPE H264CodecStart(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortInde { OMX_ERRORTYPE ret = OMX_ErrorNone; void *hMFCHandle = NULL; - ExynosVideoEncOps *pEncOps = NULL; ExynosVideoEncBufferOps *pInbufOps = NULL; ExynosVideoEncBufferOps *pOutbufOps = NULL; EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = NULL; @@ -584,7 +581,6 @@ OMX_ERRORTYPE H264CodecStart(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortInde } hMFCHandle = pH264Enc->hMFCH264Handle.hMFCHandle; - pEncOps = pH264Enc->hMFCH264Handle.pEncOps; pInbufOps = pH264Enc->hMFCH264Handle.pInbufOps; pOutbufOps = pH264Enc->hMFCH264Handle.pOutbufOps; @@ -604,10 +600,10 @@ EXIT: OMX_ERRORTYPE H264CodecStop(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortIndex) { OMX_ERRORTYPE ret = OMX_ErrorNone; - void *hMFCHandle = NULL; - ExynosVideoEncOps *pEncOps = NULL; - ExynosVideoEncBufferOps *pInbufOps = NULL; + + void *hMFCHandle = NULL; ExynosVideoEncBufferOps *pOutbufOps = NULL; + ExynosVideoEncBufferOps *pInbufOps = NULL; EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = NULL; EXYNOS_H264ENC_HANDLE *pH264Enc = NULL; @@ -628,9 +624,7 @@ OMX_ERRORTYPE H264CodecStop(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortIndex ret = OMX_ErrorBadParameter; goto EXIT; } - hMFCHandle = pH264Enc->hMFCH264Handle.hMFCHandle; - pEncOps = pH264Enc->hMFCH264Handle.pEncOps; pInbufOps = pH264Enc->hMFCH264Handle.pInbufOps; pOutbufOps = pH264Enc->hMFCH264Handle.pOutbufOps; @@ -656,16 +650,14 @@ OMX_ERRORTYPE H264CodecSrcInit(OMX_COMPONENTTYPE *pOMXComponent) EXYNOS_MFC_H264ENC_HANDLE *pMFCH264Handle = &pH264Enc->hMFCH264Handle; void *hMFCHandle = pMFCH264Handle->hMFCHandle; EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; - EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; ExynosVideoEncOps *pEncOps = pH264Enc->hMFCH264Handle.pEncOps; ExynosVideoEncBufferOps *pInbufOps = pH264Enc->hMFCH264Handle.pInbufOps; - ExynosVideoEncBufferOps *pOutbufOps = pH264Enc->hMFCH264Handle.pOutbufOps; ExynosVideoEncParam *pEncParam = NULL; ExynosVideoGeometry bufferConf; OMX_U32 inputBufferNumber = 0; - int i, nOutbufs; + int i; FunctionIn(); @@ -795,10 +787,6 @@ EXIT: OMX_ERRORTYPE H264CodecOutputBufferProcessRun(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortIndex) { OMX_ERRORTYPE ret = OMX_ErrorNone; - void *hMFCHandle = NULL; - ExynosVideoEncOps *pEncOps = NULL; - ExynosVideoEncBufferOps *pInbufOps = NULL; - ExynosVideoEncBufferOps *pOutbufOps = NULL; EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = NULL; EXYNOS_H264ENC_HANDLE *pH264Enc = NULL; @@ -820,11 +808,6 @@ OMX_ERRORTYPE H264CodecOutputBufferProcessRun(OMX_COMPONENTTYPE *pOMXComponent, goto EXIT; } - hMFCHandle = pH264Enc->hMFCH264Handle.hMFCHandle; - pEncOps = pH264Enc->hMFCH264Handle.pEncOps; - pInbufOps = pH264Enc->hMFCH264Handle.pInbufOps; - pOutbufOps = pH264Enc->hMFCH264Handle.pOutbufOps; - if (nPortIndex == INPUT_PORT_INDEX) { if (pH264Enc->bSourceStart == OMX_FALSE) { Exynos_OSAL_SignalSet(pH264Enc->hSourceStartEvent); @@ -854,11 +837,8 @@ OMX_ERRORTYPE H264CodecEnqueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U3 EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle; EXYNOS_H264ENC_HANDLE *pH264Enc = (EXYNOS_H264ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; void *hMFCHandle = pH264Enc->hMFCH264Handle.hMFCHandle; - EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; - EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; - int i, nOutbufs; + int i; - ExynosVideoEncOps *pEncOps = pH264Enc->hMFCH264Handle.pEncOps; ExynosVideoEncBufferOps *pInbufOps = pH264Enc->hMFCH264Handle.pInbufOps; ExynosVideoEncBufferOps *pOutbufOps = pH264Enc->hMFCH264Handle.pOutbufOps; @@ -884,7 +864,6 @@ OMX_ERRORTYPE H264CodecEnqueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U3 pInbufOps->Clear_Queue(hMFCHandle); } else if ((nPortIndex == OUTPUT_PORT_INDEX) && (pH264Enc->bDestinationStart == OMX_TRUE)) { - OMX_U32 dataLen[2] = {0, 0}; ExynosVideoBuffer *pBuffer = NULL; Exynos_CodecBufferReset(pExynosComponent, OUTPUT_PORT_INDEX); @@ -909,23 +888,10 @@ OMX_ERRORTYPE H264CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DAT { 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; EXYNOS_H264ENC_HANDLE *pH264Enc = (EXYNOS_H264ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; - EXYNOS_MFC_H264ENC_HANDLE *pMFCH264Handle = &pH264Enc->hMFCH264Handle; - void *hMFCHandle = pMFCH264Handle->hMFCHandle; EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; - EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; OMX_U32 oneFrameSize = pSrcInputData->dataLen; - ExynosVideoEncOps *pEncOps = pH264Enc->hMFCH264Handle.pEncOps; - ExynosVideoEncBufferOps *pInbufOps = pH264Enc->hMFCH264Handle.pInbufOps; - ExynosVideoEncBufferOps *pOutbufOps = pH264Enc->hMFCH264Handle.pOutbufOps; - ExynosVideoEncParam *pEncParam = NULL; - - ExynosVideoGeometry bufferConf; - OMX_U32 inputBufferNumber = 0; - int i, nOutbufs; - FunctionIn(); if ((oneFrameSize <= 0) && (pSrcInputData->nFlags & OMX_BUFFERFLAG_EOS)) { @@ -969,14 +935,11 @@ OMX_ERRORTYPE H264CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) EXYNOS_H264ENC_HANDLE *pH264Enc = (EXYNOS_H264ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; EXYNOS_MFC_H264ENC_HANDLE *pMFCH264Handle = &pH264Enc->hMFCH264Handle; void *hMFCHandle = pMFCH264Handle->hMFCHandle; - EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; - ExynosVideoEncOps *pEncOps = pH264Enc->hMFCH264Handle.pEncOps; - ExynosVideoEncBufferOps *pInbufOps = pH264Enc->hMFCH264Handle.pInbufOps; ExynosVideoEncBufferOps *pOutbufOps = pH264Enc->hMFCH264Handle.pOutbufOps; ExynosVideoGeometry bufferConf; - int i, nOutbufs, nPlanes, OutBufferSize; + int i,nPlanes, OutBufferSize; FunctionIn(); @@ -1545,7 +1508,6 @@ OMX_ERRORTYPE Exynos_H264Enc_SetConfig( switch (nIndex) { case OMX_IndexConfigVideoIntraPeriod: { - EXYNOS_OMX_VIDEOENC_COMPONENT *pVEncBase = ((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle); OMX_U32 nPFrames = (*((OMX_U32 *)pComponentConfigStructure)) - 1; pH264Enc->AVCComponent[OUTPUT_PORT_INDEX].nPFrames = nPFrames; @@ -1644,8 +1606,6 @@ EXIT: OMX_ERRORTYPE Exynos_H264Enc_ComponentRoleEnum(OMX_HANDLETYPE hComponent, OMX_U8 *cRole, OMX_U32 nIndex) { OMX_ERRORTYPE ret = OMX_ErrorNone; - OMX_COMPONENTTYPE *pOMXComponent = NULL; - EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL; FunctionIn(); @@ -1675,19 +1635,13 @@ OMX_ERRORTYPE Exynos_H264Enc_Init(OMX_COMPONENTTYPE *pOMXComponent) EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; EXYNOS_H264ENC_HANDLE *pH264Enc = (EXYNOS_H264ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;; - EXYNOS_MFC_H264ENC_HANDLE *pMFCH264Handle = &pH264Enc->hMFCH264Handle; - OMX_PTR hMFCHandle = pH264Enc->hMFCH264Handle.hMFCHandle; OMX_COLOR_FORMATTYPE eColorFormat; - ExynosVideoEncOps *pEncOps = NULL; - ExynosVideoEncBufferOps *pInbufOps = NULL; - ExynosVideoEncBufferOps *pOutbufOps = NULL; - - CSC_METHOD csc_method = CSC_METHOD_SW; int i = 0; FunctionIn(); + CSC_METHOD csc_method = CSC_METHOD_SW; pH264Enc->hMFCH264Handle.bConfiguredMFCSrc = OMX_FALSE; pH264Enc->hMFCH264Handle.bConfiguredMFCDst = OMX_FALSE; pVideoEnc->bFirstOutput = OMX_FALSE; @@ -1704,8 +1658,8 @@ OMX_ERRORTYPE Exynos_H264Enc_Init(OMX_COMPONENTTYPE *pOMXComponent) } #endif } else { - if (eColorFormat == OMX_SEC_COLOR_FormatNV12L_DmaBuf_Fd || - eColorFormat == OMX_SEC_COLOR_FormatNV12T_DmaBuf_Fd) { + if (eColorFormat == (OMX_COLOR_FORMATTYPE)OMX_SEC_COLOR_FormatNV12L_DmaBuf_Fd || + eColorFormat == (OMX_COLOR_FORMATTYPE)OMX_SEC_COLOR_FormatNV12T_DmaBuf_Fd) { pExynosInputPort->bufferProcessType = BUFFER_SHARE; } else { pExynosInputPort->bufferProcessType = BUFFER_COPY; @@ -1726,10 +1680,6 @@ OMX_ERRORTYPE Exynos_H264Enc_Init(OMX_COMPONENTTYPE *pOMXComponent) goto EXIT; } - pEncOps = pH264Enc->hMFCH264Handle.pEncOps; - pInbufOps = pH264Enc->hMFCH264Handle.pInbufOps; - pOutbufOps = pH264Enc->hMFCH264Handle.pOutbufOps; - if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { Exynos_OSAL_SemaphoreCreate(&pExynosInputPort->codecSemID); Exynos_OSAL_QueueCreate(&pExynosInputPort->codecBufferQ, MAX_QUEUE_ELEMENTS); @@ -1802,6 +1752,7 @@ OMX_ERRORTYPE Exynos_H264Enc_Init(OMX_COMPONENTTYPE *pOMXComponent) pExynosComponent->getAllDelayBuffer = OMX_FALSE; #if 0//defined(USE_CSC_GSCALER) + csc_method = CSC_METHOD_HW; //in case of Use ION buffer. #endif pVideoEnc->csc_handle = csc_init(csc_method); @@ -1826,13 +1777,8 @@ OMX_ERRORTYPE Exynos_H264Enc_Terminate(OMX_COMPONENTTYPE *pOMXComponent) EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; EXYNOS_H264ENC_HANDLE *pH264Enc = (EXYNOS_H264ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; - OMX_PTR hMFCHandle = pH264Enc->hMFCH264Handle.hMFCHandle; - - ExynosVideoEncOps *pEncOps = pH264Enc->hMFCH264Handle.pEncOps; - ExynosVideoEncBufferOps *pInbufOps = pH264Enc->hMFCH264Handle.pInbufOps; - ExynosVideoEncBufferOps *pOutbufOps = pH264Enc->hMFCH264Handle.pOutbufOps; - int i = 0, plane = 0; + int i = 0; FunctionIn(); @@ -1895,7 +1841,6 @@ OMX_ERRORTYPE Exynos_H264Enc_Terminate(OMX_COMPONENTTYPE *pOMXComponent) } H264CodecClose(pH264Enc); -EXIT: FunctionOut(); return ret; @@ -1909,13 +1854,10 @@ OMX_ERRORTYPE Exynos_H264Enc_SrcIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_ EXYNOS_H264ENC_HANDLE *pH264Enc = (EXYNOS_H264ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; void *hMFCHandle = pH264Enc->hMFCH264Handle.hMFCHandle; EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; - EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; OMX_U32 oneFrameSize = pSrcInputData->dataLen; ExynosVideoEncOps *pEncOps = pH264Enc->hMFCH264Handle.pEncOps; ExynosVideoEncBufferOps *pInbufOps = pH264Enc->hMFCH264Handle.pInbufOps; - ExynosVideoEncBufferOps *pOutbufOps = pH264Enc->hMFCH264Handle.pOutbufOps; ExynosVideoErrorType codecReturn = VIDEO_ERROR_NONE; - int i; FunctionIn(); @@ -1933,9 +1875,8 @@ OMX_ERRORTYPE Exynos_H264Enc_SrcIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_ pVideoEnc->configChange = OMX_FALSE; } - if ((pSrcInputData->dataLen >= 0) || - ((pSrcInputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS)) { - OMX_U32 pMFCYUVDataSize[MFC_INPUT_BUFFER_PLANE] = {NULL, NULL}; + if ((pSrcInputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) { + OMX_U32 pMFCYUVDataSize[MFC_INPUT_BUFFER_PLANE] = {0, }; ExynosVideoPlane planes[MFC_INPUT_BUFFER_PLANE]; int plane; @@ -2037,7 +1978,6 @@ OMX_ERRORTYPE Exynos_H264Enc_SrcOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX EXYNOS_H264ENC_HANDLE *pH264Enc = (EXYNOS_H264ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; void *hMFCHandle = pH264Enc->hMFCH264Handle.hMFCHandle; EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; - ExynosVideoEncOps *pEncOps = pH264Enc->hMFCH264Handle.pEncOps; ExynosVideoEncBufferOps *pInbufOps = pH264Enc->hMFCH264Handle.pInbufOps; ExynosVideoBuffer *pVideoBuffer; @@ -2096,10 +2036,8 @@ OMX_ERRORTYPE Exynos_H264Enc_DstIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_ { 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; EXYNOS_H264ENC_HANDLE *pH264Enc = (EXYNOS_H264ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; void *hMFCHandle = pH264Enc->hMFCH264Handle.hMFCHandle; - ExynosVideoEncOps *pEncOps = pH264Enc->hMFCH264Handle.pEncOps; ExynosVideoEncBufferOps *pOutbufOps = pH264Enc->hMFCH264Handle.pOutbufOps; OMX_U32 dataLen = 0; ExynosVideoErrorType codecReturn = VIDEO_ERROR_NONE; @@ -2141,7 +2079,6 @@ OMX_ERRORTYPE Exynos_H264Enc_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX ExynosVideoEncBufferOps *pOutbufOps = pH264Enc->hMFCH264Handle.pOutbufOps; ExynosVideoBuffer *pVideoBuffer; ExynosVideoFrameStatusType displayStatus = VIDEO_FRAME_STATUS_UNKNOWN; - ExynosVideoGeometry bufferGeometry; OMX_S32 indexTimestamp = 0; FunctionIn(); @@ -2226,7 +2163,6 @@ OMX_ERRORTYPE Exynos_H264Enc_srcInputBufferProcess(OMX_COMPONENTTYPE *pOMXCompon { OMX_ERRORTYPE ret = OMX_ErrorNone; EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; - EXYNOS_H264ENC_HANDLE *pH264Enc = (EXYNOS_H264ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; FunctionIn(); diff --git a/openmax/component/video/enc/h264/Exynos_OMX_H264enc.h b/openmax/component/video/enc/h264/Exynos_OMX_H264enc.h old mode 100644 new mode 100755 index caa606d..d988c02 --- a/openmax/component/video/enc/h264/Exynos_OMX_H264enc.h +++ b/openmax/component/video/enc/h264/Exynos_OMX_H264enc.h @@ -52,9 +52,9 @@ typedef struct _EXYNOS_MFC_H264ENC_HANDLE OMX_BOOL bPrependSpsPpsToIdr; EXTRA_DATA headerData; - ExynosVideoDecOps *pEncOps; - ExynosVideoDecBufferOps *pInbufOps; - ExynosVideoDecBufferOps *pOutbufOps; + ExynosVideoEncOps *pEncOps; + ExynosVideoEncBufferOps *pInbufOps; + ExynosVideoEncBufferOps *pOutbufOps; ExynosVideoEncParam encParam; } EXYNOS_MFC_H264ENC_HANDLE; @@ -79,6 +79,7 @@ extern "C" { OSCL_EXPORT_REF OMX_ERRORTYPE Exynos_OMX_ComponentInit(OMX_HANDLETYPE hComponent, OMX_STRING componentName); OMX_ERRORTYPE Exynos_OMX_ComponentDeinit(OMX_HANDLETYPE hComponent); +OMX_ERRORTYPE GetCodecOutputPrivateData(OMX_PTR codecBuffer, OMX_PTR *pVirtAddr, OMX_U32 *dataSize); #ifdef __cplusplus }; diff --git a/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c b/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c index c582237..99c4757 100755 --- a/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c +++ b/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c @@ -40,6 +40,7 @@ //#include "ExynosVideoApi.h" #include "Exynos_OSAL_SharedMemory.h" #include "Exynos_OSAL_Event.h" +#include "Exynos_OMX_VencControl.h" /* To use CSC_METHOD_HW in EXYNOS OMX, gralloc should allocate physical memory using FIMC */ /* It means GRALLOC_USAGE_HW_FIMC1 should be set on Native Window usage */ @@ -491,10 +492,7 @@ static void Change_H263Enc_Param(EXYNOS_OMX_BASECOMPONENT *pExynosComponent) OMX_ERRORTYPE GetCodecInputPrivateData(OMX_PTR codecBuffer, OMX_PTR addr[], OMX_U32 size[]) { - OMX_ERRORTYPE ret = OMX_ErrorNone; - -EXIT: - return ret; + return OMX_ErrorNone; } OMX_ERRORTYPE GetCodecOutputPrivateData(OMX_PTR codecBuffer, OMX_PTR *pVirtAddr, OMX_U32 *dataSize) @@ -673,7 +671,6 @@ OMX_ERRORTYPE Mpeg4CodecStart(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortInd { OMX_ERRORTYPE ret = OMX_ErrorNone; void *hMFCHandle = NULL; - ExynosVideoEncOps *pEncOps = NULL; ExynosVideoEncBufferOps *pInbufOps = NULL; ExynosVideoEncBufferOps *pOutbufOps = NULL; EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = NULL; @@ -699,7 +696,6 @@ OMX_ERRORTYPE Mpeg4CodecStart(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortInd } hMFCHandle = pMpeg4Enc->hMFCMpeg4Handle.hMFCHandle; - pEncOps = pMpeg4Enc->hMFCMpeg4Handle.pEncOps; pInbufOps = pMpeg4Enc->hMFCMpeg4Handle.pInbufOps; pOutbufOps = pMpeg4Enc->hMFCMpeg4Handle.pOutbufOps; @@ -720,7 +716,6 @@ OMX_ERRORTYPE Mpeg4CodecStop(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortInde { OMX_ERRORTYPE ret = OMX_ErrorNone; void *hMFCHandle = NULL; - ExynosVideoEncOps *pEncOps = NULL; ExynosVideoEncBufferOps *pInbufOps = NULL; ExynosVideoEncBufferOps *pOutbufOps = NULL; EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = NULL; @@ -745,7 +740,6 @@ OMX_ERRORTYPE Mpeg4CodecStop(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortInde } hMFCHandle = pMpeg4Enc->hMFCMpeg4Handle.hMFCHandle; - pEncOps = pMpeg4Enc->hMFCMpeg4Handle.pEncOps; pInbufOps = pMpeg4Enc->hMFCMpeg4Handle.pInbufOps; pOutbufOps = pMpeg4Enc->hMFCMpeg4Handle.pOutbufOps; @@ -771,16 +765,16 @@ OMX_ERRORTYPE Mpeg4CodecSrcInit(OMX_COMPONENTTYPE *pOMXComponent) EXYNOS_MFC_MPEG4ENC_HANDLE *pMFCMpeg4Handle = &pMpeg4Enc->hMFCMpeg4Handle; void *hMFCHandle = pMFCMpeg4Handle->hMFCHandle; EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; - EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; + ExynosVideoEncOps *pEncOps = pMpeg4Enc->hMFCMpeg4Handle.pEncOps; ExynosVideoEncBufferOps *pInbufOps = pMpeg4Enc->hMFCMpeg4Handle.pInbufOps; - ExynosVideoEncBufferOps *pOutbufOps = pMpeg4Enc->hMFCMpeg4Handle.pOutbufOps; + ExynosVideoEncParam *pEncParam = NULL; ExynosVideoGeometry bufferConf; OMX_U32 inputBufferNumber = 0; - int i, nOutbufs; + int i; FunctionIn(); @@ -909,10 +903,6 @@ EXIT: OMX_ERRORTYPE Mpeg4CodecOutputBufferProcessRun(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortIndex) { OMX_ERRORTYPE ret = OMX_ErrorNone; - void *hMFCHandle = NULL; - ExynosVideoEncOps *pEncOps = NULL; - ExynosVideoEncBufferOps *pInbufOps = NULL; - ExynosVideoEncBufferOps *pOutbufOps = NULL; EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = NULL; EXYNOS_MPEG4ENC_HANDLE *pMpeg4Enc = NULL; @@ -934,11 +924,6 @@ OMX_ERRORTYPE Mpeg4CodecOutputBufferProcessRun(OMX_COMPONENTTYPE *pOMXComponent, goto EXIT; } - hMFCHandle = pMpeg4Enc->hMFCMpeg4Handle.hMFCHandle; - pEncOps = pMpeg4Enc->hMFCMpeg4Handle.pEncOps; - pInbufOps = pMpeg4Enc->hMFCMpeg4Handle.pInbufOps; - pOutbufOps = pMpeg4Enc->hMFCMpeg4Handle.pOutbufOps; - if (nPortIndex == INPUT_PORT_INDEX) { if (pMpeg4Enc->bSourceStart == OMX_FALSE) { Exynos_OSAL_SignalSet(pMpeg4Enc->hSourceStartEvent); @@ -968,11 +953,8 @@ OMX_ERRORTYPE Mpeg4CodecEnqueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle; EXYNOS_MPEG4ENC_HANDLE *pMpeg4Enc = (EXYNOS_MPEG4ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; void *hMFCHandle = pMpeg4Enc->hMFCMpeg4Handle.hMFCHandle; - EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; - EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; - int i, nOutbufs; + int i; - ExynosVideoEncOps *pEncOps = pMpeg4Enc->hMFCMpeg4Handle.pEncOps; ExynosVideoEncBufferOps *pInbufOps = pMpeg4Enc->hMFCMpeg4Handle.pInbufOps; ExynosVideoEncBufferOps *pOutbufOps = pMpeg4Enc->hMFCMpeg4Handle.pOutbufOps; @@ -998,7 +980,6 @@ OMX_ERRORTYPE Mpeg4CodecEnqueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U pInbufOps->Clear_Queue(hMFCHandle); } else if ((nPortIndex == OUTPUT_PORT_INDEX) && (pMpeg4Enc->bDestinationStart == OMX_TRUE)) { - OMX_U32 dataLen[2] = {0, 0}; ExynosVideoBuffer *pBuffer = NULL; Exynos_CodecBufferReset(pExynosComponent, OUTPUT_PORT_INDEX); @@ -1023,23 +1004,10 @@ OMX_ERRORTYPE Mpeg4CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DA { 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; EXYNOS_MPEG4ENC_HANDLE *pMpeg4Enc = (EXYNOS_MPEG4ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; - EXYNOS_MFC_MPEG4ENC_HANDLE *pMFCMpeg4Handle = &pMpeg4Enc->hMFCMpeg4Handle; - void *hMFCHandle = pMFCMpeg4Handle->hMFCHandle; EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; - EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; OMX_U32 oneFrameSize = pSrcInputData->dataLen; - ExynosVideoEncOps *pEncOps = pMpeg4Enc->hMFCMpeg4Handle.pEncOps; - ExynosVideoEncBufferOps *pInbufOps = pMpeg4Enc->hMFCMpeg4Handle.pInbufOps; - ExynosVideoEncBufferOps *pOutbufOps = pMpeg4Enc->hMFCMpeg4Handle.pOutbufOps; - ExynosVideoEncParam *pEncParam = NULL; - - ExynosVideoGeometry bufferConf; - OMX_U32 inputBufferNumber = 0; - int i, nOutbufs; - FunctionIn(); if ((oneFrameSize <= 0) && (pSrcInputData->nFlags & OMX_BUFFERFLAG_EOS)) { @@ -1052,9 +1020,10 @@ OMX_ERRORTYPE Mpeg4CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DA OMXBuffer->nTimeStamp = pSrcInputData->timeStamp; OMXBuffer->nFlags = pSrcInputData->nFlags; - Exynos_OMX_OutputBufferReturn(pOMXComponent, OMXBuffer); - - ret = OMX_ErrorNone; + ret = Exynos_OMX_OutputBufferReturn(pOMXComponent, OMXBuffer); + if (ret != OMX_ErrorNone) { + goto EXIT; + } goto EXIT; } @@ -1087,14 +1056,11 @@ OMX_ERRORTYPE Mpeg4CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) EXYNOS_MPEG4ENC_HANDLE *pMpeg4Enc = (EXYNOS_MPEG4ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; EXYNOS_MFC_MPEG4ENC_HANDLE *pMFCMpeg4Handle = &pMpeg4Enc->hMFCMpeg4Handle; void *hMFCHandle = pMFCMpeg4Handle->hMFCHandle; - EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; - ExynosVideoEncOps *pEncOps = pMpeg4Enc->hMFCMpeg4Handle.pEncOps; - ExynosVideoEncBufferOps *pInbufOps = pMpeg4Enc->hMFCMpeg4Handle.pInbufOps; ExynosVideoEncBufferOps *pOutbufOps = pMpeg4Enc->hMFCMpeg4Handle.pOutbufOps; ExynosVideoGeometry bufferConf; - int i, nOutbufs, nPlanes, OutBufferSize; + int i, nPlanes, OutBufferSize; FunctionIn(); @@ -1686,7 +1652,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_SetConfig( pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle; pMpeg4Enc = (EXYNOS_MPEG4ENC_HANDLE *)pVideoEnc->hCodecHandle; - switch (nIndex) { + switch ((EXYNOS_OMX_INDEXTYPE)nIndex) { case OMX_IndexConfigVideoIntraPeriod: { OMX_U32 nPFrames = (*((OMX_U32 *)pComponentConfigStructure)) - 1; @@ -1816,15 +1782,11 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_Init(OMX_COMPONENTTYPE *pOMXComponent) EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; EXYNOS_MPEG4ENC_HANDLE *pMpeg4Enc = (EXYNOS_MPEG4ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;; - EXYNOS_MFC_MPEG4ENC_HANDLE *pMFCMpeg4Handle = &pMpeg4Enc->hMFCMpeg4Handle; - OMX_PTR hMFCHandle = pMpeg4Enc->hMFCMpeg4Handle.hMFCHandle; OMX_COLOR_FORMATTYPE eColorFormat; - ExynosVideoEncOps *pEncOps = NULL; - ExynosVideoEncBufferOps *pInbufOps = NULL; - ExynosVideoEncBufferOps *pOutbufOps = NULL; CSC_METHOD csc_method = CSC_METHOD_SW; + int i = 0; FunctionIn(); @@ -1845,8 +1807,8 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_Init(OMX_COMPONENTTYPE *pOMXComponent) } #endif } else { - if (eColorFormat == OMX_SEC_COLOR_FormatNV12L_DmaBuf_Fd || - eColorFormat == OMX_SEC_COLOR_FormatNV12T_DmaBuf_Fd) { + if (eColorFormat == (OMX_COLOR_FORMATTYPE)OMX_SEC_COLOR_FormatNV12L_DmaBuf_Fd || + eColorFormat == (OMX_COLOR_FORMATTYPE)OMX_SEC_COLOR_FormatNV12T_DmaBuf_Fd) { pExynosInputPort->bufferProcessType = BUFFER_SHARE; } else { pExynosInputPort->bufferProcessType = BUFFER_COPY; @@ -1859,10 +1821,6 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_Init(OMX_COMPONENTTYPE *pOMXComponent) goto EXIT; } - pEncOps = pMpeg4Enc->hMFCMpeg4Handle.pEncOps; - pInbufOps = pMpeg4Enc->hMFCMpeg4Handle.pInbufOps; - pOutbufOps = pMpeg4Enc->hMFCMpeg4Handle.pOutbufOps; - if (pExynosInputPort->bufferProcessType & BUFFER_COPY) { Exynos_OSAL_SemaphoreCreate(&pExynosInputPort->codecSemID); Exynos_OSAL_QueueCreate(&pExynosInputPort->codecBufferQ, MAX_QUEUE_ELEMENTS); @@ -1870,6 +1828,11 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_Init(OMX_COMPONENTTYPE *pOMXComponent) if (pMpeg4Enc->hMFCMpeg4Handle.bShareableBuf == OMX_TRUE) { for (i = 0; i < MFC_INPUT_BUFFER_NUM_MAX; i++) { pVideoEnc->pMFCEncInputBuffer[i] = Exynos_OSAL_Malloc(sizeof(CODEC_ENC_BUFFER)); + if (pVideoEnc->pMFCEncInputBuffer[i] == NULL) { + Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to Alloc input buffer"); + ret = OMX_ErrorInsufficientResources; + goto EXIT; + } /* Use ION Allocator */ /*Alloc Y-Buffer */ pVideoEnc->pMFCEncInputBuffer[i]->pVirAddr[0] = (void *)Exynos_OSAL_SharedMemory_Alloc(pVideoEnc->hSharedMemory, DEFAULT_MFC_INPUT_YBUFFER_SIZE, NORMAL_MEMORY); @@ -1959,13 +1922,8 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_Terminate(OMX_COMPONENTTYPE *pOMXComponent) EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; EXYNOS_MPEG4ENC_HANDLE *pMpeg4Enc = (EXYNOS_MPEG4ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; - OMX_PTR hMFCHandle = pMpeg4Enc->hMFCMpeg4Handle.hMFCHandle; - ExynosVideoEncOps *pEncOps = pMpeg4Enc->hMFCMpeg4Handle.pEncOps; - ExynosVideoEncBufferOps *pInbufOps = pMpeg4Enc->hMFCMpeg4Handle.pInbufOps; - ExynosVideoEncBufferOps *pOutbufOps = pMpeg4Enc->hMFCMpeg4Handle.pOutbufOps; - - int i = 0, plane = 0; + int i = 0; FunctionIn(); @@ -1986,7 +1944,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_Terminate(OMX_COMPONENTTYPE *pOMXComponent) for (i = 0; i < MFC_INPUT_BUFFER_NUM_MAX; i++) { if (pVideoEnc->pMFCEncInputBuffer[i] != NULL) { #ifndef TIZEN_FEATURE_E3250 /* do not use ion */ - for (plane = 0; plane < MFC_INPUT_BUFFER_PLANE; plane++) { + for (int plane = 0; plane < MFC_INPUT_BUFFER_PLANE; plane++) { if (pVideoEnc->pMFCEncInputBuffer[i]->pVirAddr[plane] != NULL) Exynos_OSAL_SharedMemory_Free(pVideoEnc->hSharedMemory, pVideoEnc->pMFCEncInputBuffer[i]->pVirAddr[plane]); } @@ -2010,7 +1968,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_Terminate(OMX_COMPONENTTYPE *pOMXComponent) for (i = 0; i < MFC_INPUT_BUFFER_NUM_MAX; i++) { if (pVideoEnc->pMFCEncInputBuffer[i] != NULL) { #ifndef TIZEN_FEATURE_E3250 /* do not use ion */ - for (plane = 0; plane < MFC_INPUT_BUFFER_PLANE; plane++) { + for (int plane = 0; plane < MFC_INPUT_BUFFER_PLANE; plane++) { if (pVideoEnc->pMFCEncInputBuffer[i]->pVirAddr[plane] != NULL) Exynos_OSAL_SharedMemory_Free(pVideoEnc->hSharedMemory, pVideoEnc->pMFCEncInputBuffer[i]->pVirAddr[plane]); } @@ -2030,7 +1988,6 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_Terminate(OMX_COMPONENTTYPE *pOMXComponent) } Mpeg4CodecClose(pMpeg4Enc); -EXIT: FunctionOut(); return ret; @@ -2044,13 +2001,10 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_SrcIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX EXYNOS_MPEG4ENC_HANDLE *pMpeg4Enc = (EXYNOS_MPEG4ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; void *hMFCHandle = pMpeg4Enc->hMFCMpeg4Handle.hMFCHandle; EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; - EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; OMX_U32 oneFrameSize = pSrcInputData->dataLen; ExynosVideoEncOps *pEncOps = pMpeg4Enc->hMFCMpeg4Handle.pEncOps; ExynosVideoEncBufferOps *pInbufOps = pMpeg4Enc->hMFCMpeg4Handle.pInbufOps; - ExynosVideoEncBufferOps *pOutbufOps = pMpeg4Enc->hMFCMpeg4Handle.pOutbufOps; ExynosVideoErrorType codecReturn = VIDEO_ERROR_NONE; - int i; FunctionIn(); @@ -2074,9 +2028,8 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_SrcIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX } - if ((pSrcInputData->dataLen >= 0) || - ((pSrcInputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS)) { - OMX_U32 pMFCYUVDataSize[MFC_INPUT_BUFFER_PLANE] = {NULL, NULL}; + if ((pSrcInputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) { + OMX_U32 pMFCYUVDataSize[MFC_INPUT_BUFFER_PLANE] = {0, }; ExynosVideoPlane planes[MFC_INPUT_BUFFER_PLANE]; int plane; @@ -2154,7 +2107,6 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_SrcOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OM EXYNOS_MPEG4ENC_HANDLE *pMpeg4Enc = (EXYNOS_MPEG4ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; void *hMFCHandle = pMpeg4Enc->hMFCMpeg4Handle.hMFCHandle; EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; - ExynosVideoEncOps *pEncOps = pMpeg4Enc->hMFCMpeg4Handle.pEncOps; ExynosVideoEncBufferOps *pInbufOps = pMpeg4Enc->hMFCMpeg4Handle.pInbufOps; ExynosVideoBuffer *pVideoBuffer; @@ -2213,10 +2165,8 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_DstIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX { 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; EXYNOS_MPEG4ENC_HANDLE *pMpeg4Enc = (EXYNOS_MPEG4ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; void *hMFCHandle = pMpeg4Enc->hMFCMpeg4Handle.hMFCHandle; - ExynosVideoEncOps *pEncOps = pMpeg4Enc->hMFCMpeg4Handle.pEncOps; ExynosVideoEncBufferOps *pOutbufOps = pMpeg4Enc->hMFCMpeg4Handle.pOutbufOps; OMX_U32 dataLen = 0; ExynosVideoErrorType codecReturn = VIDEO_ERROR_NONE; @@ -2252,13 +2202,12 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OM 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; - EXYNOS_MPEG4ENC_HANDLE *pMpeg4Enc = (EXYNOS_MPEG4ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; + EXYNOS_MPEG4ENC_HANDLE *pMpeg4Enc = (EXYNOS_MPEG4ENC_HANDLE *)pVideoEnc->hCodecHandle; void *hMFCHandle = pMpeg4Enc->hMFCMpeg4Handle.hMFCHandle; ExynosVideoEncOps *pEncOps = pMpeg4Enc->hMFCMpeg4Handle.pEncOps; ExynosVideoEncBufferOps *pOutbufOps = pMpeg4Enc->hMFCMpeg4Handle.pOutbufOps; ExynosVideoBuffer *pVideoBuffer; ExynosVideoFrameStatusType displayStatus = VIDEO_FRAME_STATUS_UNKNOWN; - ExynosVideoGeometry bufferGeometry; OMX_S32 indexTimestamp = 0; FunctionIn(); @@ -2287,7 +2236,6 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OM pDstOutputData->bufferHeader = (OMX_BUFFERHEADERTYPE *)pVideoBuffer->pPrivate; if (pVideoEnc->bFirstOutput == OMX_FALSE) { - OMX_U8 *p = NULL; pDstOutputData->timeStamp = 0; pDstOutputData->nFlags |= OMX_BUFFERFLAG_CODECCONFIG; @@ -2326,7 +2274,6 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_srcInputBufferProcess(OMX_COMPONENTTYPE *pOMXCompo { OMX_ERRORTYPE ret = OMX_ErrorNone; EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; - EXYNOS_MPEG4ENC_HANDLE *pMpeg4Enc = (EXYNOS_MPEG4ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; FunctionIn(); @@ -2683,9 +2630,12 @@ OMX_ERRORTYPE Exynos_OMX_ComponentDeinit(OMX_HANDLETYPE hComponent) OMX_ERRORTYPE ret = OMX_ErrorNone; OMX_COMPONENTTYPE *pOMXComponent = NULL; EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL; - EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = NULL; EXYNOS_MPEG4ENC_HANDLE *pMpeg4Enc = NULL; +#ifndef TIZEN_FEATURE_E3250 /* do not use ion */ + EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = NULL; + pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle; +#endif FunctionIn(); if (hComponent == NULL) { @@ -2694,7 +2644,6 @@ OMX_ERRORTYPE Exynos_OMX_ComponentDeinit(OMX_HANDLETYPE hComponent) } pOMXComponent = (OMX_COMPONENTTYPE *)hComponent; pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; - pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle; #ifndef TIZEN_FEATURE_E3250 /* do not use ion */ Exynos_OSAL_SharedMemory_Close(pVideoEnc->hSharedMemory); #endif diff --git a/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.h b/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.h old mode 100644 new mode 100755 index 37792bb..6db3033 --- a/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.h +++ b/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.h @@ -49,9 +49,9 @@ typedef struct _EXYNOS_MFC_MPEG4ENC_HANDLE OMX_BOOL bConfiguredMFCDst; CODEC_TYPE codecType; - ExynosVideoDecOps *pEncOps; - ExynosVideoDecBufferOps *pInbufOps; - ExynosVideoDecBufferOps *pOutbufOps; + ExynosVideoEncOps *pEncOps; + ExynosVideoEncBufferOps *pInbufOps; + ExynosVideoEncBufferOps *pOutbufOps; ExynosVideoEncParam encParam; } EXYNOS_MFC_MPEG4ENC_HANDLE; diff --git a/openmax/core/Exynos_OMX_Component_Register.c b/openmax/core/Exynos_OMX_Component_Register.c old mode 100644 new mode 100755 index 37415c2..544d4af --- a/openmax/core/Exynos_OMX_Component_Register.c +++ b/openmax/core/Exynos_OMX_Component_Register.c @@ -48,10 +48,8 @@ OMX_ERRORTYPE Exynos_OMX_Component_Register(EXYNOS_OMX_COMPONENT_REGLIST **compList, OMX_U32 *compNum) { OMX_ERRORTYPE ret = OMX_ErrorNone; - int componentNum = 0, roleNum = 0, totalCompNum = 0; - int read; + int componentNum = 0, totalCompNum = 0; char *libName; - size_t len; const char *errorMsg; DIR *dir; struct dirent *d; @@ -139,13 +137,10 @@ EXIT: OMX_ERRORTYPE Exynos_OMX_Component_Unregister(EXYNOS_OMX_COMPONENT_REGLIST *componentList) { - OMX_ERRORTYPE ret = OMX_ErrorNone; - Exynos_OSAL_Memset(componentList, 0, sizeof(EXYNOS_OMX_COMPONENT_REGLIST) * MAX_OMX_COMPONENT_NUM); Exynos_OSAL_Free(componentList); -EXIT: - return ret; + return OMX_ErrorNone; } OMX_ERRORTYPE Exynos_OMX_ComponentAPICheck(OMX_COMPONENTTYPE *component) diff --git a/openmax/core/Exynos_OMX_Core.c b/openmax/core/Exynos_OMX_Core.c index 0cabd0a..e783ea5 100644 --- a/openmax/core/Exynos_OMX_Core.c +++ b/openmax/core/Exynos_OMX_Core.c @@ -260,20 +260,14 @@ OMX_API OMX_ERRORTYPE OMX_APIENTRY Exynos_OMX_SetupTunnel( OMX_IN OMX_HANDLETYPE hInput, OMX_IN OMX_U32 nPortInput) { - OMX_ERRORTYPE ret = OMX_ErrorNotImplemented; - -EXIT: - return ret; + return OMX_ErrorNotImplemented; } OMX_API OMX_ERRORTYPE Exynos_OMX_GetContentPipe( OMX_OUT OMX_HANDLETYPE *hPipe, OMX_IN OMX_STRING szURI) { - OMX_ERRORTYPE ret = OMX_ErrorNotImplemented; - -EXIT: - return ret; + return OMX_ErrorNotImplemented; } OMX_API OMX_ERRORTYPE Exynos_OMX_GetComponentsOfRole ( @@ -283,7 +277,6 @@ OMX_API OMX_ERRORTYPE Exynos_OMX_GetComponentsOfRole ( { OMX_ERRORTYPE ret = OMX_ErrorNone; int max_role_num = 0; - OMX_STRING RoleString[MAX_OMX_COMPONENT_ROLE_SIZE]; int i = 0, j = 0; FunctionIn(); diff --git a/openmax/osal/Exynos_OSAL_Event.c b/openmax/osal/Exynos_OSAL_Event.c old mode 100644 new mode 100755 index ef14f85..b686f4d --- a/openmax/osal/Exynos_OSAL_Event.c +++ b/openmax/osal/Exynos_OSAL_Event.c @@ -30,6 +30,7 @@ #include #include #include +#include #include "Exynos_OSAL_Memory.h" #include "Exynos_OSAL_Mutex.h" diff --git a/openmax/osal/Exynos_OSAL_Mutex.c b/openmax/osal/Exynos_OSAL_Mutex.c old mode 100644 new mode 100755 index 4ef773c..511a715 --- a/openmax/osal/Exynos_OSAL_Mutex.c +++ b/openmax/osal/Exynos_OSAL_Mutex.c @@ -66,7 +66,6 @@ OMX_ERRORTYPE Exynos_OSAL_MutexTerminate(OMX_HANDLETYPE mutexHandle) OMX_ERRORTYPE Exynos_OSAL_MutexLock(OMX_HANDLETYPE mutexHandle) { pthread_mutex_t *mutex = (pthread_mutex_t *)mutexHandle; - int result; if (mutex == NULL) return OMX_ErrorBadParameter; @@ -80,7 +79,6 @@ OMX_ERRORTYPE Exynos_OSAL_MutexLock(OMX_HANDLETYPE mutexHandle) OMX_ERRORTYPE Exynos_OSAL_MutexUnlock(OMX_HANDLETYPE mutexHandle) { pthread_mutex_t *mutex = (pthread_mutex_t *)mutexHandle; - int result; if (mutex == NULL) return OMX_ErrorBadParameter; diff --git a/openmax/osal/Exynos_OSAL_Platform_Specific.c b/openmax/osal/Exynos_OSAL_Platform_Specific.c index e82d3d9..9ae846c 100755 --- a/openmax/osal/Exynos_OSAL_Platform_Specific.c +++ b/openmax/osal/Exynos_OSAL_Platform_Specific.c @@ -28,6 +28,7 @@ #include #include +#include #include #include "Exynos_OSAL_Semaphore.h" @@ -105,9 +106,9 @@ OMX_ERRORTYPE Exynos_OSAL_LockPBHandle( vplanes[2].addr = vaddr[2]; Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "%s: buffer locked: 0x%x", __func__, *vaddr); -#endif EXIT: +#endif FunctionOut(); return ret; @@ -132,9 +133,10 @@ OMX_ERRORTYPE Exynos_OSAL_UnlockPBHandle(OMX_IN OMX_U32 handle) } Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "%s: buffer unlocked: 0x%x", __func__, handle); -#endif EXIT: +#endif + FunctionOut(); return ret; @@ -177,7 +179,6 @@ OMX_ERRORTYPE Exynos_OSAL_LockPB( *pStride = pANB->stride; #endif -EXIT: FunctionOut(); return ret; @@ -461,7 +462,6 @@ OMX_ERRORTYPE Exynos_OSAL_SetPBParameter( OMX_ERRORTYPE ret = OMX_ErrorNone; OMX_COMPONENTTYPE *pOMXComponent = NULL; EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL; - EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = NULL; FunctionIn(); @@ -492,8 +492,6 @@ OMX_ERRORTYPE Exynos_OSAL_SetPBParameter( goto EXIT; } - pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle; - switch (nIndex) { #ifdef TIZEN_FEATURE_E3250 case OMX_IndexParamEnablePlatformSpecificBuffers: diff --git a/openmax/osal/Exynos_OSAL_SharedMemory.c b/openmax/osal/Exynos_OSAL_SharedMemory.c index 93c2416..dff3cfa 100755 --- a/openmax/osal/Exynos_OSAL_SharedMemory.c +++ b/openmax/osal/Exynos_OSAL_SharedMemory.c @@ -38,7 +38,9 @@ #include #include +#include "Exynos_OSAL_Memory.h" #include "Exynos_OSAL_SharedMemory.h" +#include "Exynos_OSAL_Mutex.h" #include "ion.h" #define EXYNOS_LOG_OFF -- 2.7.4 From 917e7d0b5a3c75db81f1b38ce031013f4eee2efb Mon Sep 17 00:00:00 2001 From: Sejun Park Date: Fri, 15 Sep 2017 18:23:59 +0900 Subject: [PATCH 11/16] fixed svace issue Change-Id: I3377746de3fc03c59f06175bb077330fc1fc666d --- openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c b/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c index 99c4757..9b2f920 100755 --- a/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c +++ b/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c @@ -1120,8 +1120,15 @@ OMX_ERRORTYPE Mpeg4CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) for (i = 0; i < MFC_OUTPUT_BUFFER_NUM_MAX; i++) { ExynosVideoPlane plane; pVideoEnc->pMFCEncOutputBuffer[i] = (CODEC_ENC_BUFFER *)Exynos_OSAL_Malloc(sizeof(CODEC_ENC_BUFFER)); + + if (pVideoEnc->pMFCEncOutputBuffer[i] == NULL) { + Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to Alloc output buffer"); + ret = OMX_ErrorInsufficientResources; + goto EXIT; + } pVideoEnc->pMFCEncOutputBuffer[i]->pVirAddr[0] = (void *)Exynos_OSAL_SharedMemory_Alloc(pVideoEnc->hSharedMemory, OutBufferSize, NORMAL_MEMORY); + if (pVideoEnc->pMFCEncOutputBuffer[i]->pVirAddr[0] == NULL) { Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to Alloc output buffer"); ret = OMX_ErrorInsufficientResources; -- 2.7.4 From 9c52feff76e50675ca475124c2df37d19c5177f8 Mon Sep 17 00:00:00 2001 From: Youngjae Shin Date: Mon, 25 Sep 2017 18:18:53 +0900 Subject: [PATCH 12/16] fix build warning Change-Id: Ica8ab613ae3aa6a3b851e8e6219b5dab149c0d53 --- exynos/libcsc/csc.c | 15 ++++++-- exynos/libcsc/csc_helper.c | 2 +- exynos/libv4l2/exynos_mc.c | 18 +++++----- exynos/libv4l2/exynos_subdev.c | 28 +++++++++------ exynos/libv4l2/exynos_v4l2.c | 5 +-- .../libcodec/video/v4l2/dec/ExynosVideoDecoder.c | 10 +++--- .../libcodec/video/v4l2/enc/ExynosVideoEncoder.c | 7 ++-- .../libcodec/video/v4l2/include/ExynosVideoApi.h | 6 ++-- exynos4/libswconverter/swconvertor.c | 21 ++++------- openmax/component/video/dec/Exynos_OMX_Vdec.c | 41 +++++++++++++--------- .../component/video/dec/Exynos_OMX_VdecControl.c | 6 ++-- .../component/video/dec/h264/Exynos_OMX_H264dec.c | 4 +-- .../video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c | 2 +- .../video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c | 2 +- .../component/video/dec/vc1/Exynos_OMX_Wmvdec.c | 4 +-- openmax/component/video/enc/Exynos_OMX_Venc.c | 4 +-- .../component/video/enc/h264/Exynos_OMX_H264enc.c | 6 ++-- .../video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c | 4 +-- openmax/osal/Exynos_OSAL_Log.h | 5 +++ openmax/osal/Exynos_OSAL_Platform_Specific.c | 4 +-- openmax/osal/Exynos_OSAL_SharedMemory.c | 6 ++-- 21 files changed, 110 insertions(+), 90 deletions(-) diff --git a/exynos/libcsc/csc.c b/exynos/libcsc/csc.c index df7a09d..a55a011 100644 --- a/exynos/libcsc/csc.c +++ b/exynos/libcsc/csc.c @@ -34,6 +34,7 @@ #include #include +#include #ifndef TIZEN_FEATURE_E3250 /* build env */ #include #include @@ -235,6 +236,12 @@ static CSC_ERRORCODE conv_sw_src_nv12t( return ret; } +void csc_interleave_memcpy_neon( + unsigned char *dest, + unsigned char *src1, + unsigned char *src2, + unsigned int src_size); + /* source is YUV420P */ static CSC_ERRORCODE conv_sw_src_yuv420p( CSC_HANDLE *handle) @@ -422,7 +429,7 @@ static CSC_ERRORCODE csc_init_hw( #endif default: ALOGE("%s:: unsupported csc_hw_type, csc use sw", __func__); - csc_handle->csc_hw_handle == NULL; + csc_handle->csc_hw_handle = NULL; break; } } @@ -495,20 +502,24 @@ static CSC_ERRORCODE csc_set_buffer( { CSC_HANDLE *csc_handle; CSC_ERRORCODE ret = CSC_ErrorNone; +#ifdef ENABLE_GSCALER void *src_addr[3] = {NULL, }; void *dst_addr[3] = {NULL, }; +#endif if (handle == NULL) return CSC_ErrorNotInit; csc_handle = (CSC_HANDLE *)handle; if (csc_handle->csc_method == CSC_METHOD_HW) { +#ifdef ENABLE_GSCALER src_addr[0] = csc_handle->src_buffer.planes[CSC_Y_PLANE]; src_addr[1] = csc_handle->src_buffer.planes[CSC_U_PLANE]; src_addr[2] = csc_handle->src_buffer.planes[CSC_V_PLANE]; dst_addr[0] = csc_handle->dst_buffer.planes[CSC_Y_PLANE]; dst_addr[1] = csc_handle->dst_buffer.planes[CSC_U_PLANE]; dst_addr[2] = csc_handle->dst_buffer.planes[CSC_V_PLANE]; +#endif switch (csc_handle->csc_hw_type) { case CSC_HW_TYPE_FIMC: @@ -749,7 +760,6 @@ CSC_ERRORCODE csc_set_src_buffer( { CSC_HANDLE *csc_handle; CSC_ERRORCODE ret = CSC_ErrorNone; - void *addr[3] = {NULL, }; if (handle == NULL) return CSC_ErrorNotInit; @@ -771,7 +781,6 @@ CSC_ERRORCODE csc_set_dst_buffer( { CSC_HANDLE *csc_handle; CSC_ERRORCODE ret = CSC_ErrorNone; - void *addr[3] = {NULL, }; if (handle == NULL) return CSC_ErrorNotInit; diff --git a/exynos/libcsc/csc_helper.c b/exynos/libcsc/csc_helper.c index c333fa4..142086d 100644 --- a/exynos/libcsc/csc_helper.c +++ b/exynos/libcsc/csc_helper.c @@ -64,7 +64,7 @@ unsigned int omx_2_hal_pixel_format( OMX_COLOR_FORMATTYPE omx_format) { unsigned int hal_format; - switch (omx_format) { + switch ((int)omx_format) { #ifndef TIZEN_FEATURE_E3250 /* build env */ /* useless */ case OMX_COLOR_FormatYCbYCr: hal_format = HAL_PIXEL_FORMAT_YCbCr_422_I; diff --git a/exynos/libv4l2/exynos_mc.c b/exynos/libv4l2/exynos_mc.c index 66ec719..cca6cff 100755 --- a/exynos/libv4l2/exynos_mc.c +++ b/exynos/libv4l2/exynos_mc.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -179,11 +180,11 @@ static int __media_get_devname_sysfs(struct media_entity *entity) char *p; int ret; - sprintf(sysname, "/sys/dev/char/%u:%u", entity->info.v4l.major, + snprintf(sysname, sizeof(sysname), "/sys/dev/char/%u:%u", entity->info.v4l.major, entity->info.v4l.minor); ret = readlink(sysname, target, sizeof(target)); - if (ret < 0) + if (ret < 0 || ret >= (int)sizeof(target)) return -errno; target[ret] = '\0'; @@ -191,21 +192,16 @@ static int __media_get_devname_sysfs(struct media_entity *entity) if (p == NULL) return -EINVAL; - sprintf(devname, "/tmp/%s", p + 1); + snprintf(devname, sizeof(devname), "/tmp/%s", p + 1); ret = mknod(devname, 0666 | S_IFCHR, MKDEV(81, entity->info.v4l.minor)); - strcpy(entity->devname, devname); + strncpy(entity->devname, devname, sizeof(devname) - 1); return 0; } static int __media_get_media_fd(const char *filename, struct media_device *media) { - ssize_t num; - int media_node; - char *ptr; - char media_buf[6]; - ALOGD("%s: %s", __func__, filename); media->fd = open(filename, O_RDWR, 0); @@ -231,6 +227,10 @@ static int __media_enum_entities(struct media_device *media) for (id = 0, ret = 0; ; id = entity->info.id) { size = (media->entities_count + 1) * sizeof(*media->entities); media->entities = (struct media_entity*)realloc(media->entities, size); + if (media->entities == NULL) { + ret = -ENOMEM; + break; + } entity = &media->entities[media->entities_count]; memset(entity, 0, sizeof(*entity)); diff --git a/exynos/libv4l2/exynos_subdev.c b/exynos/libv4l2/exynos_subdev.c index 6c1b099..8919d2d 100755 --- a/exynos/libv4l2/exynos_subdev.c +++ b/exynos/libv4l2/exynos_subdev.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -44,7 +45,7 @@ #include "Exynos_OSAL_Log.h" #endif -#define SUBDEV_MINOR_MAX 191 +#define SUBDEV_MAX 191 static int __subdev_open(const char *filename, int oflag, va_list ap) { @@ -79,22 +80,25 @@ int exynos_subdev_open_devname(const char *devname, int oflag, ...) va_list ap; FILE *stream_fd; char filename[64], name[64]; - int minor, size, i = 0; + int i = 0; do { - if (i > (SUBDEV_MINOR_MAX - 128)) + if (i > (SUBDEV_MAX - 128)) break; /* video device node */ - sprintf(filename, "/dev/v4l-subdev%d", i++); + snprintf(filename, sizeof(filename), "/dev/v4l-subdev%d", i); /* if the node is video device */ if ((lstat(filename, &s) == 0) && S_ISCHR(s.st_mode) && ((int)((unsigned short)(s.st_rdev) >> 8) == 81)) { - minor = (int)((unsigned short)(s.st_rdev & 0x3f)); - ALOGD("try node: %s, minor: %d", filename, minor); + ALOGD("try node: %s", filename); /* open sysfs entry */ - sprintf(filename, "/sys/class/video4linux/v4l-subdev%d/name", minor); + snprintf(filename, sizeof(filename), "/sys/class/video4linux/v4l-subdev%d/name", i); + if (S_ISLNK(s.st_mode)) { + ALOGE("symbolic link detected"); + return -1; + } stream_fd = fopen(filename, "r"); if (stream_fd == NULL) { ALOGE("failed to open sysfs entry for subdev"); @@ -102,24 +106,26 @@ int exynos_subdev_open_devname(const char *devname, int oflag, ...) } /* read sysfs entry for device name */ - size = (int)fgets(name, sizeof(name), stream_fd); + char *p = fgets(name, sizeof(name), stream_fd); fclose(stream_fd); /* check read size */ - if (size == 0) { + if (p == NULL) { ALOGE("failed to read sysfs entry for subdev"); } else { /* matched */ if (strncmp(name, devname, strlen(devname)) == 0) { - ALOGI("node found for device %s: /dev/v4l-subdev%d", devname, minor); + ALOGI("node found for device %s: /dev/v4l-subdev%d", devname, i); found = true; + break; } } } + i++; } while (found == false); if (found) { - sprintf(filename, "/dev/v4l-subdev%d", minor); + snprintf(filename, sizeof(filename), "/dev/v4l-subdev%d", i); va_start(ap, oflag); fd = __subdev_open(filename, oflag, ap); va_end(ap); diff --git a/exynos/libv4l2/exynos_v4l2.c b/exynos/libv4l2/exynos_v4l2.c index e050fba..3441529 100755 --- a/exynos/libv4l2/exynos_v4l2.c +++ b/exynos/libv4l2/exynos_v4l2.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -187,7 +188,7 @@ bool exynos_v4l2_enuminput(int fd, int index, char *input_name_buf) } input.index = index; - ret = ioctl(fd, VIDIOC_ENUMINPUT, &input); + ret = ioctl(fd, VIDIOC_ENUMINPUT, &input, 32); if (ret) { ALOGE("%s: no matching index founds", __func__); return false; @@ -195,7 +196,7 @@ bool exynos_v4l2_enuminput(int fd, int index, char *input_name_buf) ALOGI("Name of input channel[%d] is %s", input.index, input.name); - strcpy(input_name_buf, (const char *)input.name); + strncpy(input_name_buf, (const char *)input.name, 32); return true; } diff --git a/exynos4/libcodec/video/v4l2/dec/ExynosVideoDecoder.c b/exynos4/libcodec/video/v4l2/dec/ExynosVideoDecoder.c index 31217df..24be448 100755 --- a/exynos4/libcodec/video/v4l2/dec/ExynosVideoDecoder.c +++ b/exynos4/libcodec/video/v4l2/dec/ExynosVideoDecoder.c @@ -107,10 +107,10 @@ static unsigned int __ColorFormatType_To_V4L2PixelFormat(ExynosVideoColorFormatT pixelformat = V4L2_PIX_FMT_NV21M; break; case VIDEO_COLORFORMAT_NV12: +#endif default: pixelformat = V4L2_PIX_FMT_NV12M; break; -#endif } return pixelformat; @@ -492,7 +492,7 @@ static ExynosVideoErrorType MFC_Decoder_Get_FramePackingInfo( struct v4l2_ext_control ext_ctrl[FRAME_PACK_SEI_INFO_NUM]; struct v4l2_ext_controls ext_ctrls; - int seiAvailable, seiInfo, seiGridPos, i; + int seiAvailable, seiInfo, seiGridPos; unsigned int seiArgmtId; @@ -571,8 +571,6 @@ EXIT: } /* - -/* * [Decoder Buffer OPS] Enable Cacheable (Input) */ static ExynosVideoErrorType MFC_Decoder_Enable_Cacheable_Inbuf(void *pHandle) @@ -1225,6 +1223,7 @@ EXIT: return ret; } +#if 0 /* * [Decoder Buffer OPS] Wait (Input) */ @@ -1266,6 +1265,7 @@ static ExynosVideoErrorType MFC_Decoder_Wait_Inbuf(void *pHandle) EXIT: return ret; } +#endif static ExynosVideoErrorType MFC_Decoder_Register_Inbuf( void *pHandle, @@ -1742,7 +1742,7 @@ static ExynosVideoBuffer *MFC_Decoder_Dequeue_Outbuf(void *pHandle) } #endif switch (buf.flags & (0x7 << 3)) { - ALOGV("%s: frameType: %d", __func__, buf.flags & (0x7 << 3)); + case V4L2_BUF_FLAG_KEYFRAME: pOutbuf->frameType = VIDEO_FRAME_I; break; diff --git a/exynos4/libcodec/video/v4l2/enc/ExynosVideoEncoder.c b/exynos4/libcodec/video/v4l2/enc/ExynosVideoEncoder.c index a3b1a74..2851560 100755 --- a/exynos4/libcodec/video/v4l2/enc/ExynosVideoEncoder.c +++ b/exynos4/libcodec/video/v4l2/enc/ExynosVideoEncoder.c @@ -701,7 +701,6 @@ EXIT: static int MFC_Encoder_Get_FrameTag(void *pHandle) { ExynosVideoEncContext *pCtx = (ExynosVideoEncContext *)pHandle; - ExynosVideoErrorType ret = VIDEO_ERROR_NONE; int frameTag = -1; @@ -712,7 +711,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 @@ -1556,6 +1554,7 @@ EXIT: return ret; } +#if 0 /* * [Encoder Buffer OPS] Wait (Src) */ @@ -1642,6 +1641,7 @@ static ExynosVideoErrorType MFC_Encoder_Wait_Outbuf(void *pHandle) EXIT: return ret; } +#endif static ExynosVideoErrorType MFC_Encoder_Register_Inbuf( void *pHandle, @@ -1986,6 +1986,7 @@ EXIT: return ret; } +#if 0 /* * [Encoder Buffer OPS] Enqueue All (Output) */ @@ -2014,6 +2015,7 @@ static ExynosVideoErrorType MFC_Encoder_Enqueue_All_Outbuf(void *pHandle) EXIT: return ret; } +#endif /* * [Encoder Buffer OPS] Dequeue (Input) @@ -2066,7 +2068,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__); diff --git a/exynos4/libcodec/video/v4l2/include/ExynosVideoApi.h b/exynos4/libcodec/video/v4l2/include/ExynosVideoApi.h index b89adcc..6638349 100755 --- a/exynos4/libcodec/video/v4l2/include/ExynosVideoApi.h +++ b/exynos4/libcodec/video/v4l2/include/ExynosVideoApi.h @@ -234,8 +234,8 @@ typedef struct _ExynosVideoDecOps { ExynosVideoErrorType (*Enable_SliceMode)(void *pHandle); ExynosVideoErrorType (*Enable_SEIParsing)(void *pHandle); ExynosVideoErrorType (*Get_FramePackingInfo)(void *pHandle, ExynosVideoFramePacking *pFramepacking); - ExynosVideoErrorType (*Set_ImmediateDisplay)(void *pHandle); - ExynosVideoErrorType (*Enable_DecodeWait)(void *pHandle); + ExynosVideoErrorType (*Set_ImmediateDisplay)(void *pHandle); + ExynosVideoErrorType (*Enable_DecodeWait)(void *pHandle); } ExynosVideoDecOps; typedef struct _ExynosVideoEncOps { @@ -247,7 +247,7 @@ typedef struct _ExynosVideoEncOps { ExynosVideoErrorType (*Set_EncParam)(void *pHandle, ExynosVideoEncParam*encParam); ExynosVideoErrorType (*Set_FrameTag)(void *pHandle, int frameTag); int (*Get_FrameTag)(void *pHandle); - ExynosVideoErrorType (*Set_FrameType)(void *pHandle, int frameType); + ExynosVideoErrorType (*Set_FrameType)(void *pHandle, ExynosVideoFrameType frameType); ExynosVideoErrorType (*Set_FrameRate)(void *pHandle, int frameRate); ExynosVideoErrorType (*Set_BitRate)(void *pHandle, int bitRate); ExynosVideoErrorType (*Set_FrameSkip)(void *pHandle, int frameSkip); diff --git a/exynos4/libswconverter/swconvertor.c b/exynos4/libswconverter/swconvertor.c index 756fb13..115795e 100755 --- a/exynos4/libswconverter/swconvertor.c +++ b/exynos4/libswconverter/swconvertor.c @@ -28,8 +28,10 @@ * 2012.02.01 : Create */ -#include "stdio.h" -#include "stdlib.h" +#include +#include +#include + #include "swconverter.h" /* @@ -53,7 +55,7 @@ static int tile_4x2_read(int x_size, int y_size, int x_pos, int y_pos) { int pixel_x_m1, pixel_y_m1; - int roundup_x, roundup_y; + int roundup_x; int linear_addr0, linear_addr1, bank_addr ; int x_addr; int trans_addr; @@ -62,7 +64,6 @@ static int tile_4x2_read(int x_size, int y_size, int x_pos, int y_pos) pixel_y_m1 = y_size -1; roundup_x = ((pixel_x_m1 >> 7) + 1); - roundup_y = ((pixel_x_m1 >> 6) + 1); x_addr = x_pos >> 2; @@ -1565,9 +1566,6 @@ void csc_RGB565_to_YUV420P( unsigned int R, G, B; unsigned int Y, U, V; - unsigned int offset1 = width * height; - unsigned int offset2 = width/2 * height/2; - unsigned short int *pSrc = (unsigned short int *)rgb_src; unsigned char *pDstY = (unsigned char *)y_dst; @@ -1639,8 +1637,6 @@ void csc_RGB565_to_YUV420SP( unsigned int R, G, B; unsigned int Y, U, V; - unsigned int offset = width * height; - unsigned short int *pSrc = (unsigned short int *)rgb_src; unsigned char *pDstY = (unsigned char *)y_dst; @@ -1716,9 +1712,6 @@ void csc_ARGB8888_to_YUV420P( unsigned int R, G, B; unsigned int Y, U, V; - unsigned int offset1 = width * height; - unsigned int offset2 = width/2 * height/2; - unsigned int *pSrc = (unsigned int *)rgb_src; unsigned char *pDstY = (unsigned char *)y_dst; @@ -1790,8 +1783,6 @@ void csc_ARGB8888_to_YUV420SP( unsigned int R, G, B; unsigned int Y, U, V; - unsigned int offset = width * height; - unsigned int *pSrc = (unsigned int *)rgb_src; unsigned char *pDstY = (unsigned char *)y_dst; @@ -1827,4 +1818,4 @@ void csc_ARGB8888_to_YUV420SP( } } } -} \ No newline at end of file +} diff --git a/openmax/component/video/dec/Exynos_OMX_Vdec.c b/openmax/component/video/dec/Exynos_OMX_Vdec.c index 3fa4f06..e42b4c5 100755 --- a/openmax/component/video/dec/Exynos_OMX_Vdec.c +++ b/openmax/component/video/dec/Exynos_OMX_Vdec.c @@ -106,7 +106,7 @@ void Exynos_UpdateFrameSize(OMX_COMPONENTTYPE *pOMXComponent) height = exynosOutputPort->portDefinition.format.video.nSliceHeight = exynosInputPort->portDefinition.format.video.nSliceHeight; - switch(exynosOutputPort->portDefinition.format.video.eColorFormat) { + switch((int)exynosOutputPort->portDefinition.format.video.eColorFormat) { case OMX_COLOR_FormatYUV420Planar: case OMX_COLOR_FormatYUV420SemiPlanar: if (width && height) @@ -251,28 +251,33 @@ OMX_BOOL Exynos_CSC_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA DECODE_CODEC_EXTRA_BUFFERINFO *pBufferInfo = NULL; #ifdef TIZEN_FEATURE_E3250 MMVideoBuffer *pSlpOutBuf = NULL; -#endif +#endif //TIZEN_FEATURE_E3250 FunctionIn(); OMX_U32 width = 0, height = 0; + +#ifndef TIZEN_FEATURE_E3250 int imageSize = 0; OMX_COLOR_FORMATTYPE colorFormat; +#endif void *pOutputBuf = (void *)outputUseBuffer->bufferHeader->pBuffer; +#ifndef TIZEN_FEATURE_E3250 void *pSrcBuf[MAX_BUFFER_PLANE] = {NULL, }; void *pYUVBuf[MAX_BUFFER_PLANE] = {NULL, }; CSC_ERRORCODE cscRet = CSC_ErrorNone; - CSC_METHOD csc_method = CSC_METHOD_SW; - unsigned int cacheable = 1; +#endif pBufferInfo = (DECODE_CODEC_EXTRA_BUFFERINFO *)dstOutputData->extInfo; width = pBufferInfo->imageWidth; height = pBufferInfo->imageHeight; +#ifndef TIZEN_FEATURE_E3250 imageSize = width * height; colorFormat = pBufferInfo->ColorFormat; +#endif #ifdef TIZEN_FEATURE_E3250 pSlpOutBuf = (MMVideoBuffer *)pOutputBuf; @@ -311,7 +316,7 @@ OMX_BOOL Exynos_CSC_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA pSlpOutBuf->handle.dmabuf_fd[2]); ret = OMX_TRUE; -#else +#else //TIZEN_FEATURE_E3250 pSrcBuf[0] = dstOutputData->buffer.multiPlaneBuffer.dataBuffer[0]; pSrcBuf[1] = dstOutputData->buffer.multiPlaneBuffer.dataBuffer[1]; @@ -321,14 +326,15 @@ OMX_BOOL Exynos_CSC_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA pYUVBuf[1] = (unsigned char *)pOutputBuf + imageSize; pYUVBuf[2] = (unsigned char *)pOutputBuf + imageSize + imageSize / 4; - csc_get_method(pVideoDec->csc_handle, &csc_method); #ifdef USE_DMA_BUF + CSC_METHOD csc_method = CSC_METHOD_SW; + csc_get_method(pVideoDec->csc_handle, &csc_method); if (csc_method == CSC_METHOD_HW) { pSrcBuf[0] = (unsigned char *)(&dstOutputData->buffer.multiPlaneBuffer.fd[0]); pSrcBuf[1] = (unsigned char *)(&dstOutputData->buffer.multiPlaneBuffer.fd[1]); pSrcBuf[2] = (unsigned char *)(&dstOutputData->buffer.multiPlaneBuffer.fd[2]); } -#endif +#endif //USE_DMA_BUF #ifdef USE_PB if (exynosOutputPort->bIsPBEnabled == OMX_TRUE) { @@ -347,9 +353,9 @@ OMX_BOOL Exynos_CSC_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA pYUVBuf[1] = (unsigned char *)planes[1].fd; pYUVBuf[2] = (unsigned char *)planes[2].fd; } -#endif +#endif //USE_DMA_BUF } -#endif +#endif //USE_PB #ifdef USE_DMA_BUF if ((exynosOutputPort->bIsPBEnabled == OMX_FALSE) && (csc_method == CSC_METHOD_HW)) { @@ -357,8 +363,9 @@ OMX_BOOL Exynos_CSC_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA pYUVBuf[1] = NULL; pYUVBuf[2] = NULL; } -#endif +#endif //USE_DMA_BUF + unsigned int cacheable = 1; if (pVideoDec->csc_set_format == OMX_FALSE) { csc_set_src_format( pVideoDec->csc_handle, /* handle */ @@ -399,18 +406,18 @@ OMX_BOOL Exynos_CSC_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA ret = OMX_FALSE; else ret = OMX_TRUE; -#endif +#endif //TIZEN_FEATURE_E3250 #ifdef USE_PB if (exynosOutputPort->bIsPBEnabled == OMX_TRUE) { #ifdef TIZEN_FEATURE_E3250 Exynos_OSAL_UnlockPB(pOutputBuf, dstOutputData, exynosOutputPort, exynosInputPort); -#else +#else //TIZEN_FEATURE_E3250 Exynos_OSAL_UnlockPB(pOutputBuf, dstOutputData); -#endif +#endif //TIZEN_FEATURE_E3250 } -#endif +#endif //USE_PB -EXIT: +//EXIT: FunctionOut(); return ret; @@ -524,7 +531,7 @@ OMX_BOOL Exynos_Postprocess_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_ OMX_BOOL ret = OMX_FALSE; EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; EXYNOS_OMX_BASEPORT *exynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; - EXYNOS_OMX_BASEPORT *exynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; + EXYNOS_OMX_BASEPORT *exynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; EXYNOS_OMX_DATABUFFER *outputUseBuffer = &exynosOutputPort->way.port2WayDataBuffer.outputDataBuffer; OMX_U32 copySize = 0; @@ -565,7 +572,7 @@ OMX_BOOL Exynos_Postprocess_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_ pExynosComponent->checkTimeStamp.nStartFlags = 0x0; pExynosComponent->checkTimeStamp.needSetStartTimeStamp = OMX_FALSE; pExynosComponent->checkTimeStamp.needCheckStartTimeStamp = OMX_FALSE; - pExynosComponent->checkTimeStamp.bImmediateDisplay = OMX_FALSE; + pExynosComponent->checkTimeStamp.bImmediateDisplay = OMX_FALSE; } else { Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "drop frame after seeking", pExynosComponent); if (exynosOutputPort->bufferProcessType & BUFFER_SHARE) diff --git a/openmax/component/video/dec/Exynos_OMX_VdecControl.c b/openmax/component/video/dec/Exynos_OMX_VdecControl.c index 3a23044..130bf11 100755 --- a/openmax/component/video/dec/Exynos_OMX_VdecControl.c +++ b/openmax/component/video/dec/Exynos_OMX_VdecControl.c @@ -1103,7 +1103,7 @@ OMX_ERRORTYPE Exynos_OMX_VideoDecodeGetParameter( goto EXIT; } - switch (nParamIndex) { + switch ((int)nParamIndex) { case OMX_IndexParamVideoInit: { OMX_PORT_PARAM_TYPE *portParam = (OMX_PORT_PARAM_TYPE *)ComponentParameterStructure; @@ -1244,7 +1244,7 @@ OMX_ERRORTYPE Exynos_OMX_VideoDecodeSetParameter( goto EXIT; } - switch (nIndex) { + switch ((int)nIndex) { case OMX_IndexParamVideoPortFormat: { OMX_VIDEO_PARAM_PORTFORMATTYPE *portFormat = (OMX_VIDEO_PARAM_PORTFORMATTYPE *)ComponentParameterStructure; @@ -1384,7 +1384,7 @@ OMX_ERRORTYPE Exynos_OMX_VideoDecodeSetConfig( goto EXIT; } - switch (nIndex) { + switch ((EXYNOS_OMX_INDEXTYPE)nIndex) { case OMX_IndexVendorThumbnailMode: { EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle; diff --git a/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c b/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c index dd203ab..bf88e02 100755 --- a/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c +++ b/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c @@ -610,7 +610,7 @@ OMX_ERRORTYPE H264CodecSrcInit(OMX_COMPONENTTYPE *pOMXComponent) /* IL Client assigns FD value in pBuffer */ plane.addr = pExynosInputPort->extendBufferHeader[i].OMXBufferHeader->pBuffer; #else - plane.addr = Exynos_OSAL_SharedMemory_IONToVirt(pVideoDec->hSharedMemory, pExynosInputPort->extendBufferHeader[i].OMXBufferHeader->pBuffer); + plane.addr = Exynos_OSAL_SharedMemory_IONToVirt(pVideoDec->hSharedMemory, (int)pExynosInputPort->extendBufferHeader[i].OMXBufferHeader->pBuffer); #endif #if 0 } else { @@ -1592,7 +1592,7 @@ OMX_ERRORTYPE Exynos_H264Dec_SetParameter( pExynosOutputPort->portDefinition.format.video.nStride = width; pExynosOutputPort->portDefinition.format.video.nSliceHeight = height; - switch (pExynosOutputPort->portDefinition.format.video.eColorFormat) { + switch ((int)pExynosOutputPort->portDefinition.format.video.eColorFormat) { case OMX_COLOR_FormatYUV420Planar: case OMX_COLOR_FormatYUV420SemiPlanar: pExynosOutputPort->portDefinition.nBufferSize = (width * height * 3) / 2; diff --git a/openmax/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c b/openmax/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c index e5ecb8c..4e7acf7 100755 --- a/openmax/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c +++ b/openmax/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c @@ -1031,7 +1031,7 @@ OMX_ERRORTYPE Exynos_Mpeg2Dec_SetParameter( pExynosOutputPort->portDefinition.format.video.nStride = width; pExynosOutputPort->portDefinition.format.video.nSliceHeight = height; - switch (pExynosOutputPort->portDefinition.format.video.eColorFormat) { + switch ((int)pExynosOutputPort->portDefinition.format.video.eColorFormat) { case OMX_COLOR_FormatYUV420Planar: case OMX_COLOR_FormatYUV420SemiPlanar: // case OMX_SEC_COLOR_FormatNV12TPhysicalAddress: diff --git a/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c b/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c index acb4037..15bb2e8 100755 --- a/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c +++ b/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c @@ -1713,7 +1713,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_SetParameter( pExynosOutputPort->portDefinition.format.video.nStride = width; pExynosOutputPort->portDefinition.format.video.nSliceHeight = height; - switch (pExynosOutputPort->portDefinition.format.video.eColorFormat) { + switch ((int)pExynosOutputPort->portDefinition.format.video.eColorFormat) { case OMX_COLOR_FormatYUV420Planar: case OMX_COLOR_FormatYUV420SemiPlanar: pExynosOutputPort->portDefinition.nBufferSize = (width * height * 3) / 2; diff --git a/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c b/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c index b809ed9..57c82f1 100755 --- a/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c +++ b/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c @@ -379,7 +379,7 @@ OMX_ERRORTYPE Process_Wmv_CodecConfigData(OMX_COMPONENTTYPE *pOMXComponent, void EXYNOS_WMVDEC_HANDLE *pWmvDec = (EXYNOS_WMVDEC_HANDLE *)pVideoDec->hCodecHandle; #ifdef TIZEN_FEATURE_E3250 - EXYNOS_OMX_DATABUFFER *pSrcInputData = (EXYNOS_OMX_DATA *)pConfig; + EXYNOS_OMX_DATABUFFER *pSrcInputData = (EXYNOS_OMX_DATABUFFER*)pConfig; OMX_U8 *pInputStream = pSrcInputData->bufferHeader->pBuffer; #endif @@ -1641,7 +1641,7 @@ OMX_ERRORTYPE Exynos_WmvDec_SetParameter( pExynosOutputPort->portDefinition.format.video.nStride = width; pExynosOutputPort->portDefinition.format.video.nSliceHeight = height; - switch (pExynosOutputPort->portDefinition.format.video.eColorFormat) { + switch ((int)pExynosOutputPort->portDefinition.format.video.eColorFormat) { case OMX_COLOR_FormatYUV420Planar: case OMX_COLOR_FormatYUV420SemiPlanar: pExynosOutputPort->portDefinition.nBufferSize = (width * height * 3) / 2; diff --git a/openmax/component/video/enc/Exynos_OMX_Venc.c b/openmax/component/video/enc/Exynos_OMX_Venc.c index 1b1b0ed..266448b 100644 --- a/openmax/component/video/enc/Exynos_OMX_Venc.c +++ b/openmax/component/video/enc/Exynos_OMX_Venc.c @@ -233,13 +233,13 @@ OMX_BOOL Exynos_CSC_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA { #ifdef USE_DMA_BUF if (csc_method == CSC_METHOD_HW) { - pSrcBuf[0] = Exynos_OSAL_SharedMemory_VirtToION(pVideoEnc->hSharedMemory, checkInputStream); + pSrcBuf[0] = (unsigned char *)Exynos_OSAL_SharedMemory_VirtToION(pVideoEnc->hSharedMemory, checkInputStream); pSrcBuf[1] = NULL; pSrcBuf[2] = NULL; } #endif - switch (eColorFormat) { + switch ((int)eColorFormat) { case OMX_COLOR_FormatYUV420Planar: /* YUV420Planar converted to YUV420Semiplanar (interleaved UV plane) as per MFC spec.*/ csc_src_color_format = omx_2_hal_pixel_format((unsigned int)OMX_COLOR_FormatYUV420Planar); diff --git a/openmax/component/video/enc/h264/Exynos_OMX_H264enc.c b/openmax/component/video/enc/h264/Exynos_OMX_H264enc.c index 974bc0c..e3eb799 100755 --- a/openmax/component/video/enc/h264/Exynos_OMX_H264enc.c +++ b/openmax/component/video/enc/h264/Exynos_OMX_H264enc.c @@ -252,7 +252,7 @@ static void Set_H264Enc_Param(EXYNOS_OMX_BASECOMPONENT *pExynosComponent) pCommonParam->CbPadVal = 0; pCommonParam->CrPadVal = 0; - switch ((EXYNOS_OMX_COLOR_FORMATTYPE)pExynosInputPort->portDefinition.format.video.eColorFormat) { + switch ((int)pExynosInputPort->portDefinition.format.video.eColorFormat) { case OMX_COLOR_FormatYUV420SemiPlanar: case OMX_COLOR_FormatYUV420Planar: /* Converted to NV12 in Exynos_Preprocessor_InputData */ case OMX_SEC_COLOR_FormatNV12L_DmaBuf_Fd: @@ -1275,7 +1275,7 @@ OMX_ERRORTYPE Exynos_H264Enc_SetParameter( goto EXIT; } - switch (nIndex) { + switch ((int)nIndex) { case OMX_IndexParamVideoAvc: { OMX_VIDEO_PARAM_AVCTYPE *pDstAVCComponent = NULL; @@ -1505,7 +1505,7 @@ OMX_ERRORTYPE Exynos_H264Enc_SetConfig( pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle; pH264Enc = (EXYNOS_H264ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; - switch (nIndex) { + switch ((int)nIndex) { case OMX_IndexConfigVideoIntraPeriod: { OMX_U32 nPFrames = (*((OMX_U32 *)pComponentConfigStructure)) - 1; diff --git a/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c b/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c index 9b2f920..d775ad4 100755 --- a/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c +++ b/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c @@ -243,7 +243,7 @@ static void Set_Mpeg4Enc_Param(EXYNOS_OMX_BASECOMPONENT *pExynosComponent) pCommonParam->CbPadVal = 0; pCommonParam->CrPadVal = 0; - switch ((EXYNOS_OMX_COLOR_FORMATTYPE)pExynosInputPort->portDefinition.format.video.eColorFormat) { + switch ((int)pExynosInputPort->portDefinition.format.video.eColorFormat) { case OMX_COLOR_FormatYUV420SemiPlanar: case OMX_COLOR_FormatYUV420Planar: /* Converted to NV12 in Exynos_Preprocessor_InputData */ #ifdef TIZEN_FEATURE_E3250 @@ -343,7 +343,7 @@ static void Set_H263Enc_Param(EXYNOS_OMX_BASECOMPONENT *pExynosComponent) pCommonParam->CbPadVal = 0; pCommonParam->CrPadVal = 0; - switch ((EXYNOS_OMX_COLOR_FORMATTYPE)pExynosInputPort->portDefinition.format.video.eColorFormat) { + switch ((int)pExynosInputPort->portDefinition.format.video.eColorFormat) { case OMX_COLOR_FormatYUV420SemiPlanar: case OMX_COLOR_FormatYUV420Planar: /* Converted to NV12 in Exynos_Preprocessor_InputData */ #ifdef TIZEN_FEATURE_E3250 diff --git a/openmax/osal/Exynos_OSAL_Log.h b/openmax/osal/Exynos_OSAL_Log.h index 66657cb..32d90aa 100755 --- a/openmax/osal/Exynos_OSAL_Log.h +++ b/openmax/osal/Exynos_OSAL_Log.h @@ -81,10 +81,15 @@ typedef enum _LOG_LEVEL #define OMX_DEBUG_LEVEL 2 /* EXYNOS_LOG_INFO */ +#undef ALOGV #define ALOGV(...) Exynos_OSAL_Log(EXYNOS_LOG_VERVOSE, __VA_ARGS__) +#undef ALOGD #define ALOGD(...) Exynos_OSAL_Log(EXYNOS_LOG_TRACE, __VA_ARGS__) +#undef ALOGI #define ALOGI(...) Exynos_OSAL_Log(EXYNOS_LOG_INFO, __VA_ARGS__) +#undef ALOGW #define ALOGW(...) Exynos_OSAL_Log(EXYNOS_LOG_WARNING, __VA_ARGS__) +#undef ALOGE #define ALOGE(...) Exynos_OSAL_Log(EXYNOS_LOG_ERROR, __VA_ARGS__) #ifndef EXYNOS_LOG_TAG diff --git a/openmax/osal/Exynos_OSAL_Platform_Specific.c b/openmax/osal/Exynos_OSAL_Platform_Specific.c index 9ae846c..796b145 100755 --- a/openmax/osal/Exynos_OSAL_Platform_Specific.c +++ b/openmax/osal/Exynos_OSAL_Platform_Specific.c @@ -170,7 +170,7 @@ OMX_ERRORTYPE Exynos_OSAL_LockPB( vplanes[1].addr = buffer->data[1]; //vaddr[1]; vplanes[2].addr = NULL; //vaddr[2]; - Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "Exynos_OSAL_LockPB:fd[0](%d) fd[1](%d) a[0](%p) a[1](%p)", + Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "Exynos_OSAL_LockPB:fd[0](%d) fd[1](%d) a[0](%p) a[1](%p)", buffer->handle.dmabuf_fd[0], buffer->handle.dmabuf_fd[1], buffer->data[0], buffer->data[1]); #else android_native_buffer_t *pANB = (android_native_buffer_t *) pBuffer; @@ -492,7 +492,7 @@ OMX_ERRORTYPE Exynos_OSAL_SetPBParameter( goto EXIT; } - switch (nIndex) { + switch ((int)nIndex) { #ifdef TIZEN_FEATURE_E3250 case OMX_IndexParamEnablePlatformSpecificBuffers: #else diff --git a/openmax/osal/Exynos_OSAL_SharedMemory.c b/openmax/osal/Exynos_OSAL_SharedMemory.c index dff3cfa..0514f9a 100755 --- a/openmax/osal/Exynos_OSAL_SharedMemory.c +++ b/openmax/osal/Exynos_OSAL_SharedMemory.c @@ -76,7 +76,7 @@ OMX_HANDLETYPE Exynos_OSAL_SharedMemory_Open() if (pHandle == NULL) goto EXIT; - IONClient = (OMX_HANDLETYPE)ion_client_create(); + IONClient = ion_client_create(); if (IONClient <= 0) { Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "ion_client_create Error: %d", IONClient); Exynos_OSAL_Free((void *)pHandle); @@ -84,7 +84,7 @@ OMX_HANDLETYPE Exynos_OSAL_SharedMemory_Open() goto EXIT; } - pHandle->hIONHandle = IONClient; + pHandle->hIONHandle = (OMX_HANDLETYPE)IONClient; Exynos_OSAL_MutexCreate(&pHandle->hSMMutex); @@ -301,7 +301,7 @@ OMX_PTR Exynos_OSAL_SharedMemory_Map(OMX_HANDLETYPE handle, OMX_U32 size, unsign pElement = (EXYNOS_SHAREDMEM_LIST *)Exynos_OSAL_Malloc(sizeof(EXYNOS_SHAREDMEM_LIST)); Exynos_OSAL_Memset(pElement, 0, sizeof(EXYNOS_SHAREDMEM_LIST)); - IONBuffer = (OMX_PTR)ionfd; + IONBuffer = (ion_buffer)ionfd; if (IONBuffer <= 0) { Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "ion_alloc Error: %d", IONBuffer); -- 2.7.4 From e24ed63bd8d172b6b34a0745e647ef46bde30483 Mon Sep 17 00:00:00 2001 From: Sejun Park Date: Wed, 11 Oct 2017 19:04:34 +0900 Subject: [PATCH 13/16] fixed coverity issues Change-Id: I2a8485411a27782ecc1f54920ff5b22e082416bd --- openmax/component/video/dec/h264/Exynos_OMX_H264dec.c | 10 ---------- openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c | 10 ---------- 2 files changed, 20 deletions(-) diff --git a/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c b/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c index bf88e02..c104712 100755 --- a/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c +++ b/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c @@ -592,11 +592,6 @@ OMX_ERRORTYPE H264CodecSrcInit(OMX_COMPONENTTYPE *pOMXComponent) Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "@pVideoDec->pMFCDecInputBuffer[%d]->pVirAddr[%d]: 0x%x", i, plane, pVideoDec->pMFCDecInputBuffer[i]->pVirAddr[plane]); } -#ifdef TIZEN_FEATURE_E3250 - if (pExynosInputPort == NULL || pExynosOutputPort == NULL || pOMXComponent == NULL) { - Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "invalid param: pExynosInputPort= %p pExynosOutputPort= %p pOMXComponent= %p", pExynosInputPort, pExynosOutputPort, pOMXComponent); - } -#endif Exynos_CodecBufferEnQueue(pExynosComponent, INPUT_PORT_INDEX, pVideoDec->pMFCDecInputBuffer[i]); } } else if (pExynosInputPort->bufferProcessType & BUFFER_SHARE) { @@ -1947,11 +1942,6 @@ OMX_ERRORTYPE Exynos_H264Dec_Init(OMX_COMPONENTTYPE *pOMXComponent) Exynos_CodecBufferEnQueue(pExynosComponent, INPUT_PORT_INDEX, pVideoDec->pMFCDecInputBuffer[i]); } } else { -#ifdef TIZEN_FEATURE_E3250 - if (pOMXComponent == NULL) { - Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "%s : %d: invalid parm: pOMXComponent = %p", __FUNCTION__, __LINE__, pOMXComponent); - } -#endif ret = H264CodecSrcInit(pOMXComponent); if (ret != OMX_ErrorNone) goto EXIT; diff --git a/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c b/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c index 15bb2e8..e5018bf 100755 --- a/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c +++ b/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c @@ -728,11 +728,6 @@ OMX_ERRORTYPE Mpeg4CodecSrcInit(OMX_COMPONENTTYPE *pOMXComponent) Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "@pVideoDec->pMFCDecInputBuffer[%d]->pVirAddr[%d]: 0x%x", i, plane, pVideoDec->pMFCDecInputBuffer[i]->pVirAddr[plane]); } -#ifdef TIZEN_FEATURE_E3250 - if (pExynosInputPort == NULL || pExynosOutputPort == NULL || pOMXComponent == NULL) { - Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "invalid param: pExynosInputPort= %p pExynosOutputPort= %p pOMXComponent= %p", pExynosInputPort, pExynosOutputPort, pOMXComponent); - } -#endif Exynos_CodecBufferEnQueue(pExynosComponent, INPUT_PORT_INDEX, pVideoDec->pMFCDecInputBuffer[i]); } } else if (pExynosInputPort->bufferProcessType & BUFFER_SHARE) { @@ -2048,11 +2043,6 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_Init(OMX_COMPONENTTYPE *pOMXComponent) Exynos_CodecBufferEnQueue(pExynosComponent, INPUT_PORT_INDEX, pVideoDec->pMFCDecInputBuffer[i]); } } else { -#ifdef TIZEN_FEATURE_E3250 - if (pOMXComponent == NULL) { - Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "%s : %d: invalid parm: pOMXComponent = %p", __FUNCTION__, __LINE__, pOMXComponent); - } -#endif ret = Mpeg4CodecSrcInit(pOMXComponent); if (ret != OMX_ErrorNone) goto EXIT; -- 2.7.4 From 7d80129d957f6bddd01732a94e60408e30f4bb1b Mon Sep 17 00:00:00 2001 From: Sejun Park Date: Wed, 7 Mar 2018 14:26:57 +0900 Subject: [PATCH 14/16] fixed svace issue Change-Id: Ic5ee617ff7a40927f0361c878f48832ce92df310 --- exynos/libcsc/csc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/exynos/libcsc/csc.c b/exynos/libcsc/csc.c index a55a011..39c0e0e 100644 --- a/exynos/libcsc/csc.c +++ b/exynos/libcsc/csc.c @@ -439,6 +439,7 @@ static CSC_ERRORCODE csc_init_hw( ALOGE("%s:: CSC_METHOD_HW can't open HW", __func__); free(csc_handle); csc_handle = NULL; + return CSC_ErrorNotInit; } } @@ -804,7 +805,10 @@ CSC_ERRORCODE csc_convert( if ((csc_handle->csc_method == CSC_METHOD_HW) && (csc_handle->csc_hw_handle == NULL)) - csc_init_hw(handle); + ret = csc_init_hw(handle); + + if (ret != CSC_ErrorNone) + return ret; csc_set_format(csc_handle); csc_set_buffer(csc_handle); -- 2.7.4 From 22cb54da9d3132dac7215f2ad296b99a7a7c08ff Mon Sep 17 00:00:00 2001 From: Sejun Park Date: Tue, 20 Mar 2018 18:50:09 +0900 Subject: [PATCH 15/16] Fix issues that can not be rendered in waylandsink Change-Id: I66e5a837c57746141fb8bfef7c8f1731aaf05a15 --- openmax/osal/Exynos_OSAL_Platform_Specific.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openmax/osal/Exynos_OSAL_Platform_Specific.c b/openmax/osal/Exynos_OSAL_Platform_Specific.c index 796b145..889343b 100755 --- a/openmax/osal/Exynos_OSAL_Platform_Specific.c +++ b/openmax/osal/Exynos_OSAL_Platform_Specific.c @@ -267,6 +267,8 @@ OMX_ERRORTYPE Exynos_OSAL_UnlockPB(OMX_IN OMX_PTR pBuffer, EXYNOS_OMX_DATA *pDat pSlpOutBuf->type = MM_VIDEO_BUFFER_TYPE_TBM_BO; /* use bo mode */ + pSlpOutBuf->handle_num = 2; + pSlpOutBuf->plane_num = 2; Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "fd (%d, %d, %d) received from MFC", pSlpOutBuf->handle.dmabuf_fd[0], pSlpOutBuf->handle.dmabuf_fd[1], pSlpOutBuf->handle.dmabuf_fd[2]); #else -- 2.7.4 From 5cbf74bc0c94a50da2d981e72216593ed7bba41c Mon Sep 17 00:00:00 2001 From: Sejun Park Date: Thu, 22 Mar 2018 12:47:20 +0900 Subject: [PATCH 16/16] fixed svace issues Change-Id: I6d836dc0a0ec8e58645144b4f41ff2d4e45608fb --- exynos4/libcodec/video/v4l2/dec/ExynosVideoDecoder.c | 16 ++++++---------- exynos4/libcodec/video/v4l2/enc/ExynosVideoEncoder.c | 16 ++++++---------- openmax/component/video/enc/h264/Exynos_OMX_H264enc.c | 5 +++++ openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c | 5 +++++ 4 files changed, 22 insertions(+), 20 deletions(-) diff --git a/exynos4/libcodec/video/v4l2/dec/ExynosVideoDecoder.c b/exynos4/libcodec/video/v4l2/dec/ExynosVideoDecoder.c index 24be448..8adb7be 100755 --- a/exynos4/libcodec/video/v4l2/dec/ExynosVideoDecoder.c +++ b/exynos4/libcodec/video/v4l2/dec/ExynosVideoDecoder.c @@ -151,27 +151,23 @@ static void *MFC_Decoder_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; diff --git a/exynos4/libcodec/video/v4l2/enc/ExynosVideoEncoder.c b/exynos4/libcodec/video/v4l2/enc/ExynosVideoEncoder.c index 2851560..0469587 100755 --- a/exynos4/libcodec/video/v4l2/enc/ExynosVideoEncoder.c +++ b/exynos4/libcodec/video/v4l2/enc/ExynosVideoEncoder.c @@ -161,27 +161,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; diff --git a/openmax/component/video/enc/h264/Exynos_OMX_H264enc.c b/openmax/component/video/enc/h264/Exynos_OMX_H264enc.c index e3eb799..41cd3f2 100755 --- a/openmax/component/video/enc/h264/Exynos_OMX_H264enc.c +++ b/openmax/component/video/enc/h264/Exynos_OMX_H264enc.c @@ -1023,6 +1023,11 @@ OMX_ERRORTYPE H264CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) pVideoEnc->pMFCEncOutputBuffer[i] = (CODEC_ENC_BUFFER *)Exynos_OSAL_Malloc(sizeof(CODEC_ENC_BUFFER)); + if (!pVideoEnc->pMFCEncOutputBuffer[i]) { + ret = OMX_ErrorInsufficientResources; + goto ALLOC_FAILED; + } + if (pOutbufOps->Get_Buffer) { if (pOutbufOps->Get_Buffer(pH264Enc->hMFCH264Handle.hMFCHandle, i, &pBuffer) != VIDEO_ERROR_NONE) { Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to get Output buffer info"); diff --git a/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c b/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c index d775ad4..1ecfe21 100755 --- a/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c +++ b/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c @@ -1157,6 +1157,11 @@ OMX_ERRORTYPE Mpeg4CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) pVideoEnc->pMFCEncOutputBuffer[i] = (CODEC_ENC_BUFFER *)Exynos_OSAL_Malloc(sizeof(CODEC_ENC_BUFFER)); + if (!pVideoEnc->pMFCEncOutputBuffer[i]) { + ret = OMX_ErrorInsufficientResources; + goto ALLOC_FAILED; + } + if (pOutbufOps->Get_Buffer) { if (pOutbufOps->Get_Buffer(pMpeg4Enc->hMFCMpeg4Handle.hMFCHandle, i, &pBuffer) != VIDEO_ERROR_NONE) { Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to get Output buffer info"); -- 2.7.4