venc: added to support the dynamic configuration
authorTaehwan Kim <t_h.kim@samsung.com>
Tue, 20 Nov 2012 06:53:17 +0000 (06:53 +0000)
committerTaehwan Kim <t_h.kim@samsung.com>
Thu, 22 Nov 2012 09:05:32 +0000 (09:05 +0000)
added to support the dynamic configuration
in order to support OMX_IndexConfigVideoIntraVOPRefresh.

Change-Id: Ia8a23f3efec960af4b92fd40e9938dcd20f9037d
Signed-off-by: Taehwan Kim <t_h.kim@samsung.com>
component/video/enc/h264/Exynos_OMX_H264enc.c
component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c

index 9f2605eb4fc64cdbba39feb0afb40f2653f62592..1c141b679c69c5a14f7fe6841125f981a7e67cae 100644 (file)
@@ -361,7 +361,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);
     }
@@ -1751,6 +1751,11 @@ 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};
index 2d37e21eb46e20592a132d4d014b25c5b03da8ed..ddf0c4d6bd609d533ba9f3983b28697d30ef0278 100644 (file)
@@ -436,7 +436,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);
     }
@@ -483,7 +483,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);
     }
@@ -1961,6 +1961,15 @@ 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};