From: SeungBeom Kim Date: Tue, 20 Nov 2012 03:33:33 +0000 (+0900) Subject: exynos_omx: multi_thread: Add OMX_IndexConfigVideoIntraVOPRefresh support. X-Git-Tag: cm-10.1.0^2~3 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a7fc593060b63bdeb9c3c5295157b04944d2a524;p=GitHub%2FLineageOS%2Fandroid_hardware_samsung_slsi_exynos5.git exynos_omx: multi_thread: Add OMX_IndexConfigVideoIntraVOPRefresh support. Add config dynamic change of "encode component". Bug: 7546690 Change-Id: I82b043d51aa8295929201ce26c2b1afd5bcdb0e8 Signed-off-by: SeungBeom Kim --- diff --git a/exynos_omx/openmax/exynos_omx/component/video/enc/h264/Exynos_OMX_H264enc.c b/exynos_omx/openmax/exynos_omx/component/video/enc/h264/Exynos_OMX_H264enc.c index d17a934..0f8a275 100644 --- a/exynos_omx/openmax/exynos_omx/component/video/enc/h264/Exynos_OMX_H264enc.c +++ b/exynos_omx/openmax/exynos_omx/component/video/enc/h264/Exynos_OMX_H264enc.c @@ -362,7 +362,7 @@ static void Change_H264Enc_Param(EXYNOS_OMX_BASECOMPONENT *pExynosComponent) setParam = pExynosOutputPort->portDefinition.format.video.nBitrate; pEncOps->Set_BitRate(pH264Enc->hMFCH264Handle.hMFCHandle, setParam); } - if (pH264Param->FrameRate != (int)((pExynosOutputPort->portDefinition.format.video.xFramerate) >> 16)) { + if (pH264Param->FrameRate != (int)((pExynosInputPort->portDefinition.format.video.xFramerate) >> 16)) { setParam = (pExynosInputPort->portDefinition.format.video.xFramerate) >> 16; pEncOps->Set_FrameRate(pH264Enc->hMFCH264Handle.hMFCHandle, setParam); } @@ -1745,6 +1745,10 @@ OMX_ERRORTYPE Exynos_H264Enc_SrcIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_ ret = H264CodecDstSetup(pOMXComponent); } + if (pVideoEnc->configChange == OMX_TRUE) { + Change_H264Enc_Param(pExynosComponent); + pVideoEnc->configChange = OMX_FALSE; + } if ((pSrcInputData->dataLen >= 0) || ((pSrcInputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS)) { OMX_U32 nAllocLen[MFC_INPUT_BUFFER_PLANE] = {0, 0}; diff --git a/exynos_omx/openmax/exynos_omx/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c b/exynos_omx/openmax/exynos_omx/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c index 3174dea..4884a81 100644 --- a/exynos_omx/openmax/exynos_omx/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c +++ b/exynos_omx/openmax/exynos_omx/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c @@ -437,7 +437,7 @@ static void Change_Mpeg4Enc_Param(EXYNOS_OMX_BASECOMPONENT *pExynosComponent) setParam = pExynosOutputPort->portDefinition.format.video.nBitrate; pEncOps->Set_BitRate(pMpeg4Enc->hMFCMpeg4Handle.hMFCHandle, setParam); } - if (pMpeg4Param->TimeIncreamentRes != (int)((pExynosOutputPort->portDefinition.format.video.xFramerate) >> 16)) { + if (pMpeg4Param->TimeIncreamentRes != (int)((pExynosInputPort->portDefinition.format.video.xFramerate) >> 16)) { setParam = (pExynosInputPort->portDefinition.format.video.xFramerate) >> 16; pEncOps->Set_FrameRate(pMpeg4Enc->hMFCMpeg4Handle.hMFCHandle, setParam); } @@ -484,7 +484,7 @@ static void Change_H263Enc_Param(EXYNOS_OMX_BASECOMPONENT *pExynosComponent) setParam = pExynosOutputPort->portDefinition.format.video.nBitrate; pEncOps->Set_BitRate(pMpeg4Enc->hMFCMpeg4Handle.hMFCHandle, setParam); } - if (pH263Param->FrameRate != (int)((pExynosOutputPort->portDefinition.format.video.xFramerate) >> 16)) { + if (pH263Param->FrameRate != (int)((pExynosInputPort->portDefinition.format.video.xFramerate) >> 16)) { setParam = (pExynosInputPort->portDefinition.format.video.xFramerate) >> 16; pEncOps->Set_FrameRate(pMpeg4Enc->hMFCMpeg4Handle.hMFCHandle, setParam); } @@ -1955,6 +1955,13 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_SrcIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX ret = Mpeg4CodecDstSetup(pOMXComponent); } + if (pVideoEnc->configChange == OMX_TRUE) { + if (pMpeg4Enc->hMFCMpeg4Handle.codecType == CODEC_TYPE_MPEG4) + Change_Mpeg4Enc_Param(pExynosComponent); + else + Change_H263Enc_Param(pExynosComponent); + pVideoEnc->configChange = OMX_FALSE; + } if ((pSrcInputData->dataLen >= 0) || ((pSrcInputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS)) { OMX_U32 nAllocLen[MFC_INPUT_BUFFER_PLANE] = {0, 0};