diff options
author | Praneeth Paladugu <ppaladug@codeaurora.org> | 2016-01-15 10:48:15 -0800 |
---|---|---|
committer | Praneeth Paladugu <ppaladug@codeaurora.org> | 2016-01-29 16:40:59 -0800 |
commit | 48fa270814e1a4b9701515dc12a4939eb67890cf (patch) | |
tree | 5a6ff3e925f6d44713c74594c6486bd7eed4cc5e | |
parent | db7937a2bfb4ddd1e1306f34f1955dcb5b69c760 (diff) | |
download | android_hardware_qcom_media-48fa270814e1a4b9701515dc12a4939eb67890cf.tar.gz android_hardware_qcom_media-48fa270814e1a4b9701515dc12a4939eb67890cf.tar.bz2 android_hardware_qcom_media-48fa270814e1a4b9701515dc12a4939eb67890cf.zip |
mm-video-v4l2: vidc: venc: Fix profile and level setting issue
Profile and Level validation is not valid when VQZIP is enabled.
Fix the condition to reflect the same.
CRs-Fixed: 951349
Change-Id: I2ae1bff8c2dd0ee3b46fcad545d168f1c9bf8fa9
4 files changed, 28 insertions, 5 deletions
diff --git a/mm-video-v4l2/vidc/venc/inc/omx_video_base.h b/mm-video-v4l2/vidc/venc/inc/omx_video_base.h index eb403090..883c18c7 100644 --- a/mm-video-v4l2/vidc/venc/inc/omx_video_base.h +++ b/mm-video-v4l2/vidc/venc/inc/omx_video_base.h @@ -631,6 +631,7 @@ class omx_video: public qc_omx_component OMX_SKYPE_VIDEO_PARAM_DRIVERVER m_sDriverVer; OMX_SKYPE_VIDEO_CONFIG_QP m_sConfigQP; QOMX_EXTNINDEX_VIDEO_VENC_SAR m_sSar; + QOMX_VIDEO_H264ENTROPYCODINGTYPE m_sParamEntropy; PrependSPSPPSToIDRFramesParams m_sPrependSPSPPS; OMX_U32 m_sExtraData; OMX_U32 m_input_msg_id; diff --git a/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp b/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp index fc189127..e7e3845c 100644 --- a/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp +++ b/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp @@ -1682,6 +1682,13 @@ OMX_ERRORTYPE omx_video::get_parameter(OMX_IN OMX_HANDLETYPE hComp, memcpy(pParam, &m_sParamProfileLevel, sizeof(m_sParamProfileLevel)); break; } + case OMX_QcomIndexConfigH264EntropyCodingCabac: + { + QOMX_VIDEO_H264ENTROPYCODINGTYPE * pParam = (QOMX_VIDEO_H264ENTROPYCODINGTYPE*)paramData; + DEBUG_PRINT_LOW("get_parameter: OMX_QcomIndexConfigH264EntropyCodingCabac"); + memcpy(pParam, &m_sParamEntropy, sizeof(m_sParamEntropy)); + break; + } /*Component should support this port definition*/ case OMX_IndexParamAudioInit: { diff --git a/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp b/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp index 3868326c..ea7c8e70 100644 --- a/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp +++ b/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp @@ -355,6 +355,9 @@ OMX_ERRORTYPE omx_venc::component_init(OMX_STRING role) m_sParamProfileLevel.eLevel = (OMX_U32) OMX_VIDEO_HEVCMainTierLevel1; } + OMX_INIT_STRUCT(&m_sParamEntropy, QOMX_VIDEO_H264ENTROPYCODINGTYPE); + m_sParamEntropy.bCabac = OMX_FALSE; + // Initialize the video parameters for input port OMX_INIT_STRUCT(&m_sInPortDef, OMX_PARAM_PORTDEFINITIONTYPE); m_sInPortDef.nPortIndex= (OMX_U32) PORT_INDEX_IN; diff --git a/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp b/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp index 4f58521f..532172da 100644 --- a/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp +++ b/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp @@ -3965,11 +3965,6 @@ bool venc_dev::venc_set_profile_level(OMX_U32 eProfile,OMX_U32 eLevel) return true; } - if (vqzip_sei_info.enabled) { - DEBUG_PRINT_HIGH("VQZIP is enabled. Profile and Level set by client. Skipping validation"); - return true; - } - DEBUG_PRINT_LOW("Validating Profile/Level from table"); if (!venc_validate_profile_level(&eProfile, &eLevel)) { @@ -4798,6 +4793,12 @@ bool venc_dev::venc_set_target_bitrate(OMX_U32 nTargetBitrate, OMX_U32 config) (unsigned int)nTargetBitrate); struct v4l2_control control; int rc = 0; + + if (vqzip_sei_info.enabled) { + DEBUG_PRINT_HIGH("For VQZIP 1.0, Bitrate setting is not supported"); + return true; + } + control.id = V4L2_CID_MPEG_VIDEO_BITRATE; control.value = nTargetBitrate; @@ -4836,6 +4837,12 @@ bool venc_dev::venc_set_encode_framerate(OMX_U32 encode_framerate, OMX_U32 confi parm.parm.output.timeperframe.numerator = frame_rate_cfg.fps_denominator; parm.parm.output.timeperframe.denominator = frame_rate_cfg.fps_numerator; + if (vqzip_sei_info.enabled) { + DEBUG_PRINT_HIGH("For VQZIP 1.0, Framerate setting is not supported"); + return true; + } + + if (frame_rate_cfg.fps_numerator > 0) rc = ioctl(m_nDriver_fd, VIDIOC_S_PARM, &parm); @@ -6106,6 +6113,11 @@ bool venc_dev::venc_validate_profile_level(OMX_U32 *eProfile, OMX_U32 *eLevel) OMX_U32 mb_per_frame, mb_per_sec; bool profile_level_found = false; + if (vqzip_sei_info.enabled) { + DEBUG_PRINT_HIGH("VQZIP is enabled. Profile and Level set by client. Skipping validation"); + return true; + } + DEBUG_PRINT_LOW("Init profile table for respective codec"); //validate the ht,width,fps,bitrate and set the appropriate profile and level |