msm: vidc: Send appropriate picture_type while turning off PIC TYPE DECODE

For V4L2_CID_MPEG_VIDC_VIDEO_PICTYPE_DEC_MODE ioctl the valid
ctrl values are V4L2_MPEG_VIDC_VIDEO_PICTYPE_DECODE_ON and
V4L2_MPEG_VIDC_VIDEO_PICTYPE_DECODE_OFF. But for
V4L2_MPEG_VIDC_VIDEO_PICTYPE_DECODE_OFF case
we are sending wrong enable_picture.picture_type value. We are
also oring HAL_PICTURE_IDR, whereas only
HAL_PICTURE_I | HAL_PICTURE_P | HAL_PICTURE_B should be sent.

Change-Id: I96103d068b3e6e5f23da07d9a4c20e92ed55557c
Signed-off-by: Praveen Kumar Dwivedi <pkd@codeaurora.org>
This commit is contained in:
Praveen Kumar Dwivedi 2017-05-23 17:27:31 -07:00 committed by Gerrit - the friendly Code Review server
parent 959abd171b
commit f79da1babe

View file

@ -2235,6 +2235,7 @@ static int try_set_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
struct hal_enable_picture enable_picture;
struct hal_enable hal_property;
enum hal_property property_id = 0;
enum hal_video_codec codec;
u32 property_val = 0;
void *pdata = NULL;
struct hfi_device *hdev;
@ -2289,12 +2290,23 @@ static int try_set_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
case V4L2_CID_MPEG_VIDC_VIDEO_PICTYPE_DEC_MODE:
property_id = HAL_PARAM_VDEC_PICTURE_TYPE_DECODE;
if (ctrl->val ==
V4L2_MPEG_VIDC_VIDEO_PICTYPE_DECODE_ON)
V4L2_MPEG_VIDC_VIDEO_PICTYPE_DECODE_ON) {
enable_picture.picture_type = HAL_PICTURE_I;
else
enable_picture.picture_type = HAL_PICTURE_I |
HAL_PICTURE_P | HAL_PICTURE_B |
HAL_PICTURE_IDR;
} else {
codec = get_hal_codec(inst->fmts[OUTPUT_PORT].fourcc);
if (codec == HAL_VIDEO_CODEC_H264) {
enable_picture.picture_type = HAL_PICTURE_I |
HAL_PICTURE_P | HAL_PICTURE_B |
HAL_PICTURE_IDR;
} else if (codec == HAL_VIDEO_CODEC_HEVC) {
enable_picture.picture_type = HAL_PICTURE_I |
HAL_PICTURE_P | HAL_PICTURE_B |
HAL_PICTURE_IDR | HAL_PICTURE_CRA;
} else {
enable_picture.picture_type = HAL_PICTURE_I |
HAL_PICTURE_P | HAL_PICTURE_B;
}
}
pdata = &enable_picture;
break;
case V4L2_CID_MPEG_VIDC_VIDEO_KEEP_ASPECT_RATIO: