aboutsummaryrefslogtreecommitdiffstats
path: root/utils/common/media-info.cpp
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2018-07-01 14:17:04 +0200
committerHans Verkuil <hans.verkuil@cisco.com>2018-07-01 14:17:04 +0200
commit9110b47d6b4155a9d5658ab886b6bcc076105cc5 (patch)
treecdbb0d4f5080defaddeb772311742168d7f89e1f /utils/common/media-info.cpp
parentd69134b18dcc0462431bc1a7404f1701e4ef1d91 (diff)
v4l2-compliance: improve the output of unknown legacy types
Instead of text like this: Entity: 0x00000003 (Name: 'vicodec-enc-proc', Type: Unknown legacy device node type (0001ffff)) just print this: Entity: 0x00000003 (Name: 'vicodec-enc-proc', Type: Unknown Device Node) Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Diffstat (limited to 'utils/common/media-info.cpp')
-rw-r--r--utils/common/media-info.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/utils/common/media-info.cpp b/utils/common/media-info.cpp
index 429804e5..4981685a 100644
--- a/utils/common/media-info.cpp
+++ b/utils/common/media-info.cpp
@@ -277,7 +277,7 @@ std::string ifacetype2s(__u32 type)
static const flag_def entity_functions_def[] = {
{ MEDIA_ENT_F_UNKNOWN, "FAIL: Uninitialized Function" },
{ MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN, "FAIL: Unknown V4L2 Sub-Device" },
- { MEDIA_ENT_T_DEVNODE_UNKNOWN, "FAIL: Unknown Device Node Type" },
+ { MEDIA_ENT_T_DEVNODE_UNKNOWN, "FAIL: Unknown Device Node" },
{ MEDIA_ENT_F_DTV_DEMOD, "Digital TV Demodulator" },
{ MEDIA_ENT_F_TS_DEMUX, "Transport Stream Demuxer" },
@@ -314,17 +314,19 @@ std::string entfunction2s(__u32 function, bool *is_invalid)
{
std::string s;
- if ((function & MEDIA_ENT_TYPE_MASK) == MEDIA_ENT_F_OLD_BASE &&
+ if (function != MEDIA_ENT_T_DEVNODE_UNKNOWN &&
+ (function & MEDIA_ENT_TYPE_MASK) == MEDIA_ENT_F_OLD_BASE &&
function > MEDIA_ENT_T_DEVNODE_DVB) {
- s = "Unknown legacy device node type (" + num2s(function) + ")";
+ s = "Unknown device node (" + num2s(function) + ")";
if (!is_invalid)
return s;
*is_invalid = true;
return "FAIL: " + s;
}
- if ((function & MEDIA_ENT_TYPE_MASK) == MEDIA_ENT_F_OLD_SUBDEV_BASE &&
+ if (function != MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN &&
+ (function & MEDIA_ENT_TYPE_MASK) == MEDIA_ENT_F_OLD_SUBDEV_BASE &&
function > MEDIA_ENT_F_TUNER) {
- s = "Unknown legacy sub-device type (" + num2s(function) + ")";
+ s = "Unknown sub-device (" + num2s(function) + ")";
if (!is_invalid)
return s;
*is_invalid = true;

Privacy Policy