aboutsummaryrefslogtreecommitdiffstats
path: root/utils/v4l2-compliance
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2022-02-18 09:09:26 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2022-02-18 17:11:32 +0100
commit40a51ea5538182d7c3856ece1c75c7ebca967a84 (patch)
treec67fb6b61c482c44c36c4bb5bb44a76a474ef3fb /utils/v4l2-compliance
parent19460651657a617b906f7f1559b3c99bf1c04be6 (diff)
v4l2-compliance: only check function if an MC is present
The codec tests checked if the function of the device as reported by the media controller is that of an de/encoder. But that test was also done for codecs without a MC, and then it fails. So only do this test if an MC was found. Also test that stateless codecs always have a MC since it is required for such codecs. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Tested-by: NĂ­colas F. R. A. Prado <nfraprado@collabora.com>
Diffstat (limited to 'utils/v4l2-compliance')
-rw-r--r--utils/v4l2-compliance/v4l2-compliance.cpp1
-rw-r--r--utils/v4l2-compliance/v4l2-compliance.h1
-rw-r--r--utils/v4l2-compliance/v4l2-test-codecs.cpp6
3 files changed, 6 insertions, 2 deletions
diff --git a/utils/v4l2-compliance/v4l2-compliance.cpp b/utils/v4l2-compliance/v4l2-compliance.cpp
index c53a55ba..8d0e94e9 100644
--- a/utils/v4l2-compliance/v4l2-compliance.cpp
+++ b/utils/v4l2-compliance/v4l2-compliance.cpp
@@ -998,6 +998,7 @@ void testNode(struct node &node, struct node &node_m2m_cap, struct node &expbuf_
if (!node.is_v4l2())
driver = mdinfo.driver;
node.media_bus_info = mdinfo.bus_info;
+ node.has_media = true;
}
}
diff --git a/utils/v4l2-compliance/v4l2-compliance.h b/utils/v4l2-compliance/v4l2-compliance.h
index 7255161f..507187eb 100644
--- a/utils/v4l2-compliance/v4l2-compliance.h
+++ b/utils/v4l2-compliance/v4l2-compliance.h
@@ -120,6 +120,7 @@ struct base_node {
struct node *node2; /* second open filehandle */
bool has_outputs;
bool has_inputs;
+ bool has_media;
unsigned tuners;
unsigned modulators;
unsigned inputs;
diff --git a/utils/v4l2-compliance/v4l2-test-codecs.cpp b/utils/v4l2-compliance/v4l2-test-codecs.cpp
index 22175eef..1d76a17c 100644
--- a/utils/v4l2-compliance/v4l2-test-codecs.cpp
+++ b/utils/v4l2-compliance/v4l2-test-codecs.cpp
@@ -31,7 +31,8 @@ int testEncoder(struct node *node)
bool is_encoder = node->codec_mask & (STATEFUL_ENCODER | JPEG_ENCODER);
int ret;
- if (IS_ENCODER(node))
+ fail_on_test((node->codec_mask & STATELESS_ENCODER) && !node->has_media);
+ if (IS_ENCODER(node) && node->has_media)
fail_on_test(node->function != MEDIA_ENT_F_PROC_VIDEO_ENCODER);
memset(&cmd, 0xff, sizeof(cmd));
memset(&cmd.raw, 0, sizeof(cmd.raw));
@@ -100,7 +101,8 @@ int testDecoder(struct node *node)
bool is_decoder = node->codec_mask & (STATEFUL_DECODER | JPEG_DECODER);
int ret;
- if (IS_DECODER(node))
+ fail_on_test((node->codec_mask & STATELESS_DECODER) && !node->has_media);
+ if (IS_DECODER(node) && node->has_media)
fail_on_test(node->function != MEDIA_ENT_F_PROC_VIDEO_DECODER);
memset(&cmd, 0xff, sizeof(cmd));
memset(&cmd.raw, 0, sizeof(cmd.raw));

Privacy Policy