From 7e42e4107e77c41d93b586cd9ee287eb4ac7f920 Mon Sep 17 00:00:00 2001 From: Taehwan Kim Date: Thu, 31 Jan 2013 10:04:06 +0000 Subject: [PATCH] h264enc/osal: modified OMX_IndexParamPrependSPSPPSToIDR support in case of "OMX.google.android.index.prependSPSPPSToIDRFrames", android uses the PrependSPSPPSToIDRFramesParams structure. PrependSPSPPSToIDR support is decided by bEnable value. struct PrependSPSPPSToIDRFramesParams { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_BOOL bEnable; }; Change-Id: I7c65cd8510d2446061f2f18402f2288c274c6a53 Signed-off-by: Taehwan Kim --- component/video/enc/h264/Exynos_OMX_H264enc.c | 5 ++--- osal/Exynos_OSAL_Android.cpp | 18 ++++++++++++++++++ osal/Exynos_OSAL_Android.h | 3 +++ 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/component/video/enc/h264/Exynos_OMX_H264enc.c b/component/video/enc/h264/Exynos_OMX_H264enc.c index 3818e73..84230ae 100644 --- a/component/video/enc/h264/Exynos_OMX_H264enc.c +++ b/component/video/enc/h264/Exynos_OMX_H264enc.c @@ -1303,10 +1303,9 @@ OMX_ERRORTYPE Exynos_H264Enc_SetParameter( #ifdef USE_H264_PREPEND_SPS_PPS case OMX_IndexParamPrependSPSPPSToIDR: { - EXYNOS_H264ENC_HANDLE *pH264Enc = NULL; + EXYNOS_H264ENC_HANDLE *pH264Enc = (EXYNOS_H264ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; - pH264Enc = (EXYNOS_H264ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; - pH264Enc->hMFCH264Handle.bPrependSpsPpsToIdr = OMX_TRUE; + ret = Exynos_OSAL_SetPrependSPSPPSToIDR(pComponentParameterStructure, &(pH264Enc->hMFCH264Handle.bPrependSpsPpsToIdr)); } break; #endif diff --git a/osal/Exynos_OSAL_Android.cpp b/osal/Exynos_OSAL_Android.cpp index 985ba0a..4ee57aa 100644 --- a/osal/Exynos_OSAL_Android.cpp +++ b/osal/Exynos_OSAL_Android.cpp @@ -623,6 +623,24 @@ EXIT: return ret; } +OMX_ERRORTYPE Exynos_OSAL_SetPrependSPSPPSToIDR( + OMX_PTR pComponentParameterStructure, + OMX_PTR pbPrependSpsPpsToIdr) +{ + OMX_ERRORTYPE ret = OMX_ErrorNone; + PrependSPSPPSToIDRFramesParams *pANBParams = (PrependSPSPPSToIDRFramesParams *)pComponentParameterStructure; + ret = Exynos_OMX_Check_SizeVersion(pANBParams, sizeof(PrependSPSPPSToIDRFramesParams)); + if (ret != OMX_ErrorNone) { + Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "%s: Exynos_OMX_Check_SizeVersion(PrependSPSPPSToIDRFramesParams) is failed", __func__); + goto EXIT; + } + + (*((OMX_BOOL *)pbPrependSpsPpsToIdr)) = pANBParams->bEnable; + +EXIT: + return ret; +} + OMX_COLOR_FORMATTYPE Exynos_OSAL_Hal2OMXPixelFormat( unsigned int hal_format) { diff --git a/osal/Exynos_OSAL_Android.h b/osal/Exynos_OSAL_Android.h index bac31e6..a0c21fb 100644 --- a/osal/Exynos_OSAL_Android.h +++ b/osal/Exynos_OSAL_Android.h @@ -70,6 +70,9 @@ OMX_ERRORTYPE Exynos_OSAL_GetInfoFromMetaData(OMX_IN OMX_BYTE pBuffer, OMX_ERRORTYPE Exynos_OSAL_CheckANB(OMX_IN EXYNOS_OMX_DATA *pBuffer, OMX_OUT OMX_BOOL *bIsANBEnabled); +OMX_ERRORTYPE Exynos_OSAL_SetPrependSPSPPSToIDR(OMX_PTR pComponentParameterStructure, + OMX_PTR pbPrependSpsPpsToIdr); + OMX_COLOR_FORMATTYPE Exynos_OSAL_Hal2OMXPixelFormat(unsigned int hal_format); unsigned int Exynos_OSAL_OMX2HalPixelFormat(OMX_COLOR_FORMATTYPE omx_format); -- 2.20.1