Commit 08c06797 authored by Stanimir Varbanov's avatar Stanimir Varbanov Committed by Mauro Carvalho Chehab

media: venus: venc: Add support for AUD NALU control

Add support for Access Unit Delimiter control into encoder.
Signed-off-by: default avatarStanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent f2bf1bcb
...@@ -224,6 +224,7 @@ struct venc_controls { ...@@ -224,6 +224,7 @@ struct venc_controls {
u32 multi_slice_max_mb; u32 multi_slice_max_mb;
u32 header_mode; u32 header_mode;
bool aud_enable;
struct { struct {
u32 h264; u32 h264;
......
...@@ -754,6 +754,20 @@ static int venc_set_properties(struct venus_inst *inst) ...@@ -754,6 +754,20 @@ 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) {
struct hfi_enable en = {};
ptype = HFI_PROPERTY_PARAM_VENC_H264_GENERATE_AUDNAL;
if (ctr->aud_enable)
en.enable = 1;
ret = hfi_session_set_property(inst, ptype, &en);
if (ret)
return ret;
}
return 0; return 0;
} }
......
...@@ -276,6 +276,9 @@ static int venc_op_s_ctrl(struct v4l2_ctrl *ctrl) ...@@ -276,6 +276,9 @@ static int venc_op_s_ctrl(struct v4l2_ctrl *ctrl)
case V4L2_CID_MPEG_VIDEO_BASELAYER_PRIORITY_ID: case V4L2_CID_MPEG_VIDEO_BASELAYER_PRIORITY_ID:
ctr->base_priority_id = ctrl->val; ctr->base_priority_id = ctrl->val;
break; break;
case V4L2_CID_MPEG_VIDEO_AU_DELIMITER:
ctr->aud_enable = ctrl->val;
break;
default: default:
return -EINVAL; return -EINVAL;
} }
...@@ -291,7 +294,7 @@ int venc_ctrl_init(struct venus_inst *inst) ...@@ -291,7 +294,7 @@ int venc_ctrl_init(struct venus_inst *inst)
{ {
int ret; int ret;
ret = v4l2_ctrl_handler_init(&inst->ctrl_handler, 51); ret = v4l2_ctrl_handler_init(&inst->ctrl_handler, 52);
if (ret) if (ret)
return ret; return ret;
...@@ -498,6 +501,9 @@ int venc_ctrl_init(struct venus_inst *inst) ...@@ -498,6 +501,9 @@ int venc_ctrl_init(struct venus_inst *inst)
V4L2_CID_MPEG_VIDEO_BASELAYER_PRIORITY_ID, 0, V4L2_CID_MPEG_VIDEO_BASELAYER_PRIORITY_ID, 0,
6, 1, 0); 6, 1, 0);
v4l2_ctrl_new_std(&inst->ctrl_handler, &venc_ctrl_ops,
V4L2_CID_MPEG_VIDEO_AU_DELIMITER, 0, 1, 1, 0);
ret = inst->ctrl_handler.error; ret = inst->ctrl_handler.error;
if (ret) if (ret)
goto err; goto err;
......
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