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

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
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -224,6 +224,7 @@ struct venc_controls {
	u32 multi_slice_max_mb;

	u32 header_mode;
	bool aud_enable;

	struct {
		u32 h264;
+14 −0
Original line number Diff line number Diff line
@@ -754,6 +754,20 @@ static int venc_set_properties(struct venus_inst *inst)
	if (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;
}

+7 −1
Original line number Diff line number Diff line
@@ -276,6 +276,9 @@ static int venc_op_s_ctrl(struct v4l2_ctrl *ctrl)
	case V4L2_CID_MPEG_VIDEO_BASELAYER_PRIORITY_ID:
		ctr->base_priority_id = ctrl->val;
		break;
	case V4L2_CID_MPEG_VIDEO_AU_DELIMITER:
		ctr->aud_enable = ctrl->val;
		break;
	default:
		return -EINVAL;
	}
@@ -291,7 +294,7 @@ int venc_ctrl_init(struct venus_inst *inst)
{
	int ret;

	ret = v4l2_ctrl_handler_init(&inst->ctrl_handler, 51);
	ret = v4l2_ctrl_handler_init(&inst->ctrl_handler, 52);
	if (ret)
		return ret;

@@ -498,6 +501,9 @@ int venc_ctrl_init(struct venus_inst *inst)
			  V4L2_CID_MPEG_VIDEO_BASELAYER_PRIORITY_ID, 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;
	if (ret)
		goto err;