0a18b9dff2b8d398fd4c57bacf7fc46a59616677
[openwrt/staging/blogic.git] /
1 From 7e8e61a7103c53c54cbd1b81c4fb6289141be7c5 Mon Sep 17 00:00:00 2001
2 From: John Cox <jc@kynesim.co.uk>
3 Date: Fri, 6 Aug 2021 10:53:50 +0100
4 Subject: [PATCH] media: v4l2: Add HEVC_SCALING_MATRIX attribute to
5 v4l2-ctrl-*
6
7 Add code to support V4L2_CID_MPEG_VIDEO_HEVC_SCALING_MATRIX to
8 v4l2-ctrl-*. This change was in the unsplit v4l2-ctrl.c but failed
9 to make it through the split.
10
11 Signed-off-by: John Cox <jc@kynesim.co.uk>
12 ---
13 drivers/media/v4l2-core/v4l2-ctrls-core.c | 6 ++++++
14 drivers/media/v4l2-core/v4l2-ctrls-defs.c | 4 ++++
15 2 files changed, 10 insertions(+)
16
17 --- a/drivers/media/v4l2-core/v4l2-ctrls-core.c
18 +++ b/drivers/media/v4l2-core/v4l2-ctrls-core.c
19 @@ -627,6 +627,9 @@ static int std_validate_compound(const s
20 zero_padding(*p_hevc_pps);
21 break;
22
23 + case V4L2_CTRL_TYPE_HEVC_SCALING_MATRIX:
24 + break;
25 +
26 case V4L2_CTRL_TYPE_HEVC_DECODE_PARAMS:
27 p_hevc_decode_params = p;
28
29 @@ -1250,6 +1253,9 @@ static struct v4l2_ctrl *v4l2_ctrl_new(s
30 case V4L2_CTRL_TYPE_HEVC_SLICE_PARAMS:
31 elem_size = sizeof(struct v4l2_ctrl_hevc_slice_params);
32 break;
33 + case V4L2_CTRL_TYPE_HEVC_SCALING_MATRIX:
34 + elem_size = sizeof(struct v4l2_ctrl_hevc_scaling_matrix);
35 + break;
36 case V4L2_CTRL_TYPE_HEVC_DECODE_PARAMS:
37 elem_size = sizeof(struct v4l2_ctrl_hevc_decode_params);
38 break;
39 --- a/drivers/media/v4l2-core/v4l2-ctrls-defs.c
40 +++ b/drivers/media/v4l2-core/v4l2-ctrls-defs.c
41 @@ -997,6 +997,7 @@ const char *v4l2_ctrl_get_name(u32 id)
42 case V4L2_CID_MPEG_VIDEO_HEVC_SPS: return "HEVC Sequence Parameter Set";
43 case V4L2_CID_MPEG_VIDEO_HEVC_PPS: return "HEVC Picture Parameter Set";
44 case V4L2_CID_MPEG_VIDEO_HEVC_SLICE_PARAMS: return "HEVC Slice Parameters";
45 + case V4L2_CID_MPEG_VIDEO_HEVC_SCALING_MATRIX: return "HEVC Scaling Matrix";
46 case V4L2_CID_MPEG_VIDEO_HEVC_DECODE_PARAMS: return "HEVC Decode Parameters";
47 case V4L2_CID_MPEG_VIDEO_HEVC_DECODE_MODE: return "HEVC Decode Mode";
48 case V4L2_CID_MPEG_VIDEO_HEVC_START_CODE: return "HEVC Start Code";
49 @@ -1490,6 +1491,9 @@ void v4l2_ctrl_fill(u32 id, const char *
50 case V4L2_CID_MPEG_VIDEO_HEVC_SLICE_PARAMS:
51 *type = V4L2_CTRL_TYPE_HEVC_SLICE_PARAMS;
52 break;
53 + case V4L2_CID_MPEG_VIDEO_HEVC_SCALING_MATRIX:
54 + *type = V4L2_CTRL_TYPE_HEVC_SCALING_MATRIX;
55 + break;
56 case V4L2_CID_MPEG_VIDEO_HEVC_DECODE_PARAMS:
57 *type = V4L2_CTRL_TYPE_HEVC_DECODE_PARAMS;
58 break;