aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2021-01-19 10:31:44 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2021-01-19 10:31:44 +0100
commit8301bcf83aae42482531ca0402d97b4bc2f3957a (patch)
tree2c1d9fe4de50d5287fb8ca9cacbb992e2fec32aa
parent6f73812725efb2ce5f3bad33de93d7ad8f900356 (diff)
v4l2-compliance: improve VIDIOC_(TRY_)EN/DECODER_CMD tests
Check that encoder_cmd ioctls return ENOTTY for decoders and vice versa. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--utils/v4l2-compliance/v4l2-test-codecs.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/utils/v4l2-compliance/v4l2-test-codecs.cpp b/utils/v4l2-compliance/v4l2-test-codecs.cpp
index 9fb11e02..e218f65f 100644
--- a/utils/v4l2-compliance/v4l2-test-codecs.cpp
+++ b/utils/v4l2-compliance/v4l2-test-codecs.cpp
@@ -28,7 +28,7 @@
int testEncoder(struct node *node)
{
struct v4l2_encoder_cmd cmd;
- bool is_encoder = node->codec_mask & STATEFUL_ENCODER;
+ bool is_encoder = node->codec_mask & (STATEFUL_ENCODER | JPEG_ENCODER);
int ret;
memset(&cmd, 0xff, sizeof(cmd));
@@ -39,7 +39,7 @@ int testEncoder(struct node *node)
fail_on_test(doioctl(node, VIDIOC_TRY_ENCODER_CMD, &cmd) != ENOTTY);
return ret;
}
- fail_on_test(node->codec_mask & STATEFUL_DECODER);
+ fail_on_test(IS_DECODER(node));
fail_on_test(ret != EINVAL);
ret = doioctl(node, VIDIOC_TRY_ENCODER_CMD, &cmd);
fail_on_test(ret == ENOTTY);
@@ -95,7 +95,7 @@ int testEncIndex(struct node *node)
int testDecoder(struct node *node)
{
struct v4l2_decoder_cmd cmd;
- bool is_decoder = node->codec_mask & STATEFUL_DECODER;
+ bool is_decoder = node->codec_mask & (STATEFUL_DECODER | JPEG_DECODER);
int ret;
memset(&cmd, 0xff, sizeof(cmd));
@@ -106,7 +106,7 @@ int testDecoder(struct node *node)
fail_on_test(doioctl(node, VIDIOC_TRY_DECODER_CMD, &cmd) != ENOTTY);
return ret;
}
- fail_on_test(node->codec_mask & STATEFUL_ENCODER);
+ fail_on_test(IS_ENCODER(node));
fail_on_test(ret != EINVAL);
ret = doioctl(node, VIDIOC_TRY_DECODER_CMD, &cmd);
fail_on_test(ret == ENOTTY);

Privacy Policy