aboutsummaryrefslogtreecommitdiffstats
path: root/utils/common/media-info.cpp
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2018-02-07 18:16:32 +0100
committerHans Verkuil <hans.verkuil@cisco.com>2018-02-07 18:16:32 +0100
commitb5a169e8cb2dc6bbfee136047e3db06d7e696ccb (patch)
treee78ebb55062746a39b05483b024ac113c2e7781b /utils/common/media-info.cpp
parentb94471bd60294d532a662a08e3b3877acbfe0d86 (diff)
v4l2-compliance: more stringent type/function tests
Make sure the old legacy bases are not used for any new functions. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Diffstat (limited to 'utils/common/media-info.cpp')
-rw-r--r--utils/common/media-info.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/utils/common/media-info.cpp b/utils/common/media-info.cpp
index 63df2e25..8be7a62d 100644
--- a/utils/common/media-info.cpp
+++ b/utils/common/media-info.cpp
@@ -261,6 +261,19 @@ static const flag_def entity_functions_def[] = {
std::string entfunction2s(__u32 function, bool *is_invalid)
{
+ if ((function & MEDIA_ENT_TYPE_MASK) == MEDIA_ENT_F_OLD_BASE &&
+ function > MEDIA_ENT_T_DEVNODE_DVB) {
+ if (is_invalid)
+ *is_invalid = true;
+ return "FAIL: Unknown legacy device node type (" + num2s(function) + ")";
+ }
+ if ((function & MEDIA_ENT_TYPE_MASK) == MEDIA_ENT_F_OLD_SUBDEV_BASE &&
+ function > MEDIA_ENT_F_TUNER) {
+ if (is_invalid)
+ *is_invalid = true;
+ return "FAIL: Unknown legacy sub-device type (" + num2s(function) + ")";
+ }
+
for (unsigned i = 0; entity_functions_def[i].str; i++)
if (function == entity_functions_def[i].flag) {
if (is_invalid)

Privacy Policy