MPEG4Dec_ParamAndConfig::MPEG4Dec_ParamAndConfig(VFM_Component *component):VFM_ParamAndConfig(component) { OstTraceInt0(TRACE_API, "=> MPEG4Dec_ParamAndConfig::MPEG4Dec_ParamAndConfig() constructor"); // initialization of attributes of VFM_ParamAndConfig setProfileLevel(0, 0); mMpeg4Param.nSize = sizeof(OMX_VIDEO_PARAM_MPEG4TYPE); //mMpeg4Param.nVersion = (OMX_VERSIONTYPE)0; mMpeg4Param.nPortIndex = 0;; mMpeg4Param.nSliceHeaderSpacing = 0; mMpeg4Param.bSVH = OMX_FALSE; mMpeg4Param.bGov =OMX_FALSE; mMpeg4Param.nPFrames=0; mMpeg4Param.nBFrames=0; mMpeg4Param.nIDCVLCThreshold=0; mMpeg4Param.bACPred=OMX_FALSE; mMpeg4Param.nMaxPacketSize=0; mMpeg4Param.nTimeIncRes=0; mMpeg4Param.eProfile=OMX_VIDEO_MPEG4ProfileSimple; mMpeg4Param.eLevel=OMX_VIDEO_MPEG4Level0; mMpeg4Param.nAllowedPictureTypes=0; mMpeg4Param.nHeaderExtension=0; mMpeg4Param.bReversibleVLC=OMX_FALSE; mMpeg4ProfileAndLevel.nSize = sizeof(OMX_VIDEO_PARAM_PROFILELEVELTYPE); //mMpeg4ProfileAndLevel.nVersion = (OMX_VERSIONTYPE)0; mMpeg4ProfileAndLevel.nPortIndex = 0; mMpeg4ProfileAndLevel.nProfileIndex = 0; mMpeg4ProfileAndLevel.eLevel = 0; mMpeg4ProfileAndLevel.eProfile = 0; CropWidth = 0; CropHeight = 0; OstTraceInt0(TRACE_API, "<= MPEG4Dec_ParamAndConfig::MPEG4Dec_ParamAndConfig() constructor"); }
void VideoFormats::enableResolutionUpto( ResolutionType type, size_t index, ProfileType profile, LevelType level) { size_t width, height, fps, score; bool interlaced; if (!GetConfiguration(type, index, &width, &height, &fps, &interlaced)) { ALOGE("Maximum resolution not found!"); return; } score = width * height * fps * (!interlaced + 1); for (size_t i = 0; i < kNumResolutionTypes; ++i) { for (size_t j = 0; j < 32; j++) { if (GetConfiguration((ResolutionType)i, j, &width, &height, &fps, &interlaced) && score >= width * height * fps * (!interlaced + 1)) { setResolutionEnabled((ResolutionType)i, j); setProfileLevel((ResolutionType)i, j, profile, level); } } } }