aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2020-02-04 19:01:37 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2020-02-04 19:01:37 +0100
commit67962f1277b483060a16b80cbe79fac56d4e2cc6 (patch)
tree7830e4b7d4f5c004f1113935e479ef5a8e080016
parent8968ed851605ba914c1dd6457363f4ea9d2c8413 (diff)
v4l2-compliance: check source and sink pad types of a link
There was no check whether the source pad is actually a source, and whether the sink pad is actually a sink. Also, when printing the link it didn't include the pad indices. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--utils/v4l2-compliance/v4l2-test-media.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/utils/v4l2-compliance/v4l2-test-media.cpp b/utils/v4l2-compliance/v4l2-test-media.cpp
index 2d0c7086..6ac71400 100644
--- a/utils/v4l2-compliance/v4l2-test-media.cpp
+++ b/utils/v4l2-compliance/v4l2-test-media.cpp
@@ -293,11 +293,15 @@ int testMediaTopology(struct node *node)
fail_on_test(v2_pads_set.find(link.source_id) == v2_pads_set.end());
fail_on_test(v2_pads_set.find(link.sink_id) == v2_pads_set.end());
fail_on_test(link.source_id == link.sink_id);
+ fail_on_test(!(v2_pad_map[link.source_id]->flags & MEDIA_PAD_FL_SOURCE));
+ fail_on_test(!(v2_pad_map[link.sink_id]->flags & MEDIA_PAD_FL_SINK));
num_data_links++;
if (show_info)
- printf("\t\tLink: 0x%08x (%s -> %s, %s)\n", link.id,
+ printf("\t\tLink: 0x%08x (%s:%u -> %s:%u, %s)\n", link.id,
v2_entity_map[v2_pad_map[link.source_id]->entity_id]->name,
+ v2_pad_map[link.source_id]->index,
v2_entity_map[v2_pad_map[link.sink_id]->entity_id]->name,
+ v2_pad_map[link.sink_id]->index,
mi_linkflags2s(link.flags).c_str());
}
}

Privacy Policy