aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2019-03-19 15:11:32 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2019-03-29 16:09:07 +0100
commitd5fb741cb5f09301582c8f52d7c29454eed8c978 (patch)
treea4db50b8e471c7e6649692ef31817008cea05944
parenta705fe95361a40c70b0867c3cc4fb6f276ca989b (diff)
v4l2-compliance: check if en/decoder commands are present
The stateful codecs require the encoder or decoder command ioctls. Check this. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--utils/v4l2-compliance/v4l2-test-codecs.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/utils/v4l2-compliance/v4l2-test-codecs.cpp b/utils/v4l2-compliance/v4l2-test-codecs.cpp
index 5057d0ff..9cd530e3 100644
--- a/utils/v4l2-compliance/v4l2-test-codecs.cpp
+++ b/utils/v4l2-compliance/v4l2-test-codecs.cpp
@@ -40,8 +40,11 @@ int testEncoder(struct node *node)
memset(&cmd, 0xff, sizeof(cmd));
memset(&cmd.raw, 0, sizeof(cmd.raw));
ret = doioctl(node, VIDIOC_ENCODER_CMD, &cmd);
- if (ret == ENOTTY)
+ if (ret == ENOTTY) {
+ fail_on_test(node->codec_mask & STATEFUL_ENCODER);
return ret;
+ }
+ fail_on_test(node->codec_mask & STATEFUL_DECODER);
fail_on_test(ret != EINVAL);
ret = doioctl(node, VIDIOC_TRY_ENCODER_CMD, &cmd);
fail_on_test(ret == ENOTTY);
@@ -86,8 +89,11 @@ int testDecoder(struct node *node)
memset(&cmd, 0xff, sizeof(cmd));
memset(&cmd.raw, 0, sizeof(cmd.raw));
ret = doioctl(node, VIDIOC_DECODER_CMD, &cmd);
- if (ret == ENOTTY)
+ if (ret == ENOTTY) {
+ fail_on_test(node->codec_mask & STATEFUL_DECODER);
return ret;
+ }
+ fail_on_test(node->codec_mask & STATEFUL_ENCODER);
fail_on_test(ret != EINVAL);
ret = doioctl(node, VIDIOC_TRY_DECODER_CMD, &cmd);
fail_on_test(ret == ENOTTY);

Privacy Policy