h264enc/osal: modified OMX_IndexParamPrependSPSPPSToIDR support
authorTaehwan Kim <t_h.kim@samsung.com>
Thu, 31 Jan 2013 10:04:06 +0000 (10:04 +0000)
committerTaehwan Kim <t_h.kim@samsung.com>
Thu, 31 Jan 2013 10:21:46 +0000 (10:21 +0000)
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 <t_h.kim@samsung.com>
component/video/enc/h264/Exynos_OMX_H264enc.c
osal/Exynos_OSAL_Android.cpp
osal/Exynos_OSAL_Android.h

index 3818e7352a523e6534a2d97e1d30fa2110167a83..84230aef7f078f77488e64b6bd6dd7868c6206e5 100644 (file)
@@ -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
index 985ba0aa2f5088c59d3f293c8f8a3443dc560323..4ee57aa026164f4956f7d5cd374c5149c75b4dd8 100644 (file)
@@ -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)
 {
index bac31e6e6ce216100b860b67e7fc7d3cc4c11e1a..a0c21fbd8d1b20e5f4b5e6d5562f428d3544fe5c 100644 (file)
@@ -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);