msm_vidc: venc: configure max-B-frames only if B is enabled
If B frames are initially enabled and disabled at the time of configuration, max-B-frames will retain the non-zero value set at the time of enablement. Explicitly reset max-B-frames when B frames is set to zero, otherwise this setting may interfere with other exclusive features (like temporal layers) Change-Id: Iefa9b5b2becd0c0f4756fa81a396e3af0c45022a Signed-off-by: Praveen Chavan <pchavan@codeaurora.org>
This commit is contained in:
parent
2e45ea7281
commit
8329f19d9f
1 changed files with 11 additions and 12 deletions
|
@ -2198,6 +2198,7 @@ static int try_set_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
|
||||||
case V4L2_CID_MPEG_VIDC_VIDEO_NUM_P_FRAMES:
|
case V4L2_CID_MPEG_VIDC_VIDEO_NUM_P_FRAMES:
|
||||||
{
|
{
|
||||||
int num_p, num_b;
|
int num_p, num_b;
|
||||||
|
u32 max_num_b_frames;
|
||||||
|
|
||||||
temp_ctrl = TRY_GET_CTRL(V4L2_CID_MPEG_VIDC_VIDEO_NUM_B_FRAMES);
|
temp_ctrl = TRY_GET_CTRL(V4L2_CID_MPEG_VIDC_VIDEO_NUM_B_FRAMES);
|
||||||
num_b = temp_ctrl->val;
|
num_b = temp_ctrl->val;
|
||||||
|
@ -2210,8 +2211,7 @@ static int try_set_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
|
||||||
else if (ctrl->id == V4L2_CID_MPEG_VIDC_VIDEO_NUM_B_FRAMES)
|
else if (ctrl->id == V4L2_CID_MPEG_VIDC_VIDEO_NUM_B_FRAMES)
|
||||||
num_b = ctrl->val;
|
num_b = ctrl->val;
|
||||||
|
|
||||||
if (num_b) {
|
max_num_b_frames = num_b ? MAX_NUM_B_FRAMES : 0;
|
||||||
u32 max_num_b_frames = MAX_NUM_B_FRAMES;
|
|
||||||
property_id = HAL_PARAM_VENC_MAX_NUM_B_FRAMES;
|
property_id = HAL_PARAM_VENC_MAX_NUM_B_FRAMES;
|
||||||
pdata = &max_num_b_frames;
|
pdata = &max_num_b_frames;
|
||||||
rc = call_hfi_op(hdev, session_set_property,
|
rc = call_hfi_op(hdev, session_set_property,
|
||||||
|
@ -2222,7 +2222,6 @@ static int try_set_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
|
||||||
rc);
|
rc);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
property_id = HAL_CONFIG_VENC_INTRA_PERIOD;
|
property_id = HAL_CONFIG_VENC_INTRA_PERIOD;
|
||||||
intra_period.pframes = num_p;
|
intra_period.pframes = num_p;
|
||||||
|
|
Loading…
Add table
Reference in a new issue