Commit 002c22bd authored by Dikshita Agarwal's avatar Dikshita Agarwal Committed by Mauro Carvalho Chehab

media: venus: venc: set inband mode property to FW.

Set HFI_PROPERTY_CONFIG_VENC_SYNC_FRAME_SEQUENCE_HEADER to FW
to support inband sequence header mode.
Reviewed-by: default avatarFritz Koenig <frkoenig@chromium.org>
Signed-off-by: default avatarDikshita Agarwal <dikshita@codeaurora.org>
Signed-off-by: default avatarStanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 01e869e7
...@@ -545,6 +545,7 @@ static int venc_set_properties(struct venus_inst *inst) ...@@ -545,6 +545,7 @@ static int venc_set_properties(struct venus_inst *inst)
struct hfi_idr_period idrp; struct hfi_idr_period idrp;
struct hfi_quantization quant; struct hfi_quantization quant;
struct hfi_quantization_range quant_range; struct hfi_quantization_range quant_range;
struct hfi_enable en;
u32 ptype, rate_control, bitrate; u32 ptype, rate_control, bitrate;
u32 profile, level; u32 profile, level;
int ret; int ret;
...@@ -664,6 +665,19 @@ static int venc_set_properties(struct venus_inst *inst) ...@@ -664,6 +665,19 @@ static int venc_set_properties(struct venus_inst *inst)
if (ret) if (ret)
return ret; return ret;
if (inst->fmt_cap->pixfmt == V4L2_PIX_FMT_H264 ||
inst->fmt_cap->pixfmt == V4L2_PIX_FMT_HEVC) {
ptype = HFI_PROPERTY_CONFIG_VENC_SYNC_FRAME_SEQUENCE_HEADER;
if (ctr->header_mode == V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE)
en.enable = 0;
else
en.enable = 1;
ret = hfi_session_set_property(inst, ptype, &en);
if (ret)
return ret;
}
if (!ctr->bitrate_peak) if (!ctr->bitrate_peak)
bitrate *= 2; bitrate *= 2;
else else
......
...@@ -209,6 +209,20 @@ static int venc_op_s_ctrl(struct v4l2_ctrl *ctrl) ...@@ -209,6 +209,20 @@ static int venc_op_s_ctrl(struct v4l2_ctrl *ctrl)
break; break;
case V4L2_CID_MPEG_VIDEO_HEADER_MODE: case V4L2_CID_MPEG_VIDEO_HEADER_MODE:
ctr->header_mode = ctrl->val; ctr->header_mode = ctrl->val;
mutex_lock(&inst->lock);
if (inst->streamon_out && inst->streamon_cap) {
if (ctrl->val == V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE)
en.enable = 0;
else
en.enable = 1;
ptype = HFI_PROPERTY_CONFIG_VENC_SYNC_FRAME_SEQUENCE_HEADER;
ret = hfi_session_set_property(inst, ptype, &en);
if (ret) {
mutex_unlock(&inst->lock);
return ret;
}
}
mutex_unlock(&inst->lock);
break; break;
case V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB: case V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB:
break; break;
...@@ -343,7 +357,8 @@ int venc_ctrl_init(struct venus_inst *inst) ...@@ -343,7 +357,8 @@ int venc_ctrl_init(struct venus_inst *inst)
v4l2_ctrl_new_std_menu(&inst->ctrl_handler, &venc_ctrl_ops, v4l2_ctrl_new_std_menu(&inst->ctrl_handler, &venc_ctrl_ops,
V4L2_CID_MPEG_VIDEO_HEADER_MODE, V4L2_CID_MPEG_VIDEO_HEADER_MODE,
V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME, V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME,
1 << V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME, ~((1 << V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE) |
(1 << V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME)),
V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE); V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE);
v4l2_ctrl_new_std_menu(&inst->ctrl_handler, &venc_ctrl_ops, v4l2_ctrl_new_std_menu(&inst->ctrl_handler, &venc_ctrl_ops,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment