From cae415b84125ffc14bfdb121394a60b74d506f48 Mon Sep 17 00:00:00 2001 From: Yanli Date: Mon, 8 Oct 2012 17:19:02 +0800 Subject: omx-components: fix CTS MediaCodecListTest failure issue BZ: 54024 Implement interface for GetParam with OMX_IndexParamVideoProfileLevelQuerySupported correctly for openmax encode component. Change-Id: If53ca95e57b950e50b29c6efbc431d85b0839210 Signed-off-by: Zhang Yanli Reviewed-on: http://android.intel.com:8080/69235 Reviewed-by: Shi, PingX Tested-by: Shi, PingX Reviewed-by: buildbot Tested-by: buildbot --- videocodec/OMXVideoEncoderAVC.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'videocodec/OMXVideoEncoderAVC.cpp') diff --git a/videocodec/OMXVideoEncoderAVC.cpp b/videocodec/OMXVideoEncoderAVC.cpp index 9a39570..9a59485 100644 --- a/videocodec/OMXVideoEncoderAVC.cpp +++ b/videocodec/OMXVideoEncoderAVC.cpp @@ -466,9 +466,37 @@ OMX_ERRORTYPE OMXVideoEncoderAVC::BuildHandlerList(void) { AddHandler((OMX_INDEXTYPE)OMX_IndexConfigIntelSliceNumbers, GetConfigIntelSliceNumbers, SetConfigIntelSliceNumbers); AddHandler((OMX_INDEXTYPE)OMX_IndexParamIntelAVCVUI, GetParamIntelAVCVUI, SetParamIntelAVCVUI); AddHandler((OMX_INDEXTYPE)OMX_IndexParamVideoBytestream, GetParamVideoBytestream, SetParamVideoBytestream); + AddHandler((OMX_INDEXTYPE)OMX_IndexParamVideoProfileLevelQuerySupported, GetParamVideoProfileLevelQuerySupported, SetParamVideoProfileLevelQuerySupported); return OMX_ErrorNone; } +OMX_ERRORTYPE OMXVideoEncoderAVC::GetParamVideoProfileLevelQuerySupported(OMX_PTR pStructure) { + OMX_ERRORTYPE ret; + OMX_VIDEO_PARAM_PROFILELEVELTYPE *p = (OMX_VIDEO_PARAM_PROFILELEVELTYPE *)pStructure; + CHECK_TYPE_HEADER(p); + CHECK_PORT_INDEX(p, OUTPORT_INDEX); + + struct ProfileLevelTable { + OMX_U32 profile; + OMX_U32 level; + } plTable[] = { + {OMX_VIDEO_AVCProfileBaseline, OMX_VIDEO_AVCLevel41}, + }; + + OMX_U32 count = sizeof(plTable)/sizeof(ProfileLevelTable); + CHECK_ENUMERATION_RANGE(p->nProfileIndex,count); + + p->eProfile = plTable[p->nProfileIndex].profile; + p->eLevel = plTable[p->nProfileIndex].level; + + return OMX_ErrorNone; +} + +OMX_ERRORTYPE OMXVideoEncoderAVC::SetParamVideoProfileLevelQuerySupported(OMX_PTR pStructure) { + LOGW("SetParamVideoAVCProfileLevel is not supported."); + return OMX_ErrorUnsupportedSetting; +} + OMX_ERRORTYPE OMXVideoEncoderAVC::GetParamVideoAvc(OMX_PTR pStructure) { OMX_ERRORTYPE ret; OMX_VIDEO_PARAM_AVCTYPE *p = (OMX_VIDEO_PARAM_AVCTYPE *)pStructure; -- cgit v1.2.3