media: hantro: Support H264 profile control
authorHirokazu Honda <hiroh@chromium.org>
Fri, 22 Nov 2019 05:16:08 +0000 (06:16 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 24 Feb 2020 15:03:46 +0000 (16:03 +0100)
The Hantro G1 decoder supports H.264 profiles from Baseline to High, with
the exception of the Extended profile.

Expose the V4L2_CID_MPEG_VIDEO_H264_PROFILE control, so that the
applications can query the driver for the list of supported profiles.

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/staging/media/hantro/hantro_drv.c

index c988353261352ef22126a22bf8cae0f2bed335c9..ca8b133e2e46e357628bf722ac03416a495a001d 100644 (file)
@@ -361,6 +361,16 @@ static const struct hantro_ctrl controls[] = {
                        .def = V4L2_MPEG_VIDEO_H264_START_CODE_ANNEX_B,
                        .max = V4L2_MPEG_VIDEO_H264_START_CODE_ANNEX_B,
                },
+       }, {
+               .codec = HANTRO_H264_DECODER,
+               .cfg = {
+                       .id = V4L2_CID_MPEG_VIDEO_H264_PROFILE,
+                       .min = V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE,
+                       .max = V4L2_MPEG_VIDEO_H264_PROFILE_HIGH,
+                       .menu_skip_mask =
+                       BIT(V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED),
+                       .def = V4L2_MPEG_VIDEO_H264_PROFILE_MAIN,
+               }
        }, {
        },
 };