summaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorEzequiel Garcia <ezequiel@collabora.com>2020-11-26 10:36:11 +0100
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-12-03 12:27:33 +0100
commitb32e48503df05bd1ca95dc1a07824afc2c7c9c4e (patch)
tree22eea38c7fc79f5db84afbf5850f179b83f7020c /include/media
parentmedia: Clean stateless control includes (diff)
downloadlinux-b32e48503df05bd1ca95dc1a07824afc2c7c9c4e.tar.xz
linux-b32e48503df05bd1ca95dc1a07824afc2c7c9c4e.zip
media: controls: Validate H264 stateless controls
Check that all the fields that correspond or are related to a H264 specification syntax element have legal values. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Tested-by: Jernej Skrabec <jernej.skrabec@siol.net> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/h264-ctrls.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/media/h264-ctrls.h b/include/media/h264-ctrls.h
index f86345b8efd1..083899c3ea19 100644
--- a/include/media/h264-ctrls.h
+++ b/include/media/h264-ctrls.h
@@ -98,6 +98,15 @@ enum v4l2_mpeg_video_h264_start_code {
#define V4L2_H264_SPS_FLAG_MB_ADAPTIVE_FRAME_FIELD 0x20
#define V4L2_H264_SPS_FLAG_DIRECT_8X8_INFERENCE 0x40
+#define V4L2_H264_SPS_HAS_CHROMA_FORMAT(sps) \
+ ((sps)->profile_idc == 100 || (sps)->profile_idc == 110 || \
+ (sps)->profile_idc == 122 || (sps)->profile_idc == 244 || \
+ (sps)->profile_idc == 44 || (sps)->profile_idc == 83 || \
+ (sps)->profile_idc == 86 || (sps)->profile_idc == 118 || \
+ (sps)->profile_idc == 128 || (sps)->profile_idc == 138 || \
+ (sps)->profile_idc == 139 || (sps)->profile_idc == 134 || \
+ (sps)->profile_idc == 135)
+
/**
* struct v4l2_ctrl_h264_sps - H264 sequence parameter set
*