aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2018-09-07 18:09:03 +0200
committerHans Verkuil <hans.verkuil@cisco.com>2018-09-07 18:09:03 +0200
commitd26e4941419b05fcb2b6708ee32aef367c2ec4af (patch)
tree2c8193a13646c91a42a1acc6b2f7ff2435d5da68
parent388f43c8cfb3e98c951c2e792b1d9b2eb608530f (diff)
v4l2-compliance: allow both regular and mplane variants for crop API
According to the spec both regular and mplane variants should be supported for the crop API (just as happens with the selection API). Test this. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
-rw-r--r--utils/v4l2-compliance/v4l2-test-formats.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/utils/v4l2-compliance/v4l2-test-formats.cpp b/utils/v4l2-compliance/v4l2-test-formats.cpp
index 0a00097a..4524dfd9 100644
--- a/utils/v4l2-compliance/v4l2-test-formats.cpp
+++ b/utils/v4l2-compliance/v4l2-test-formats.cpp
@@ -1386,12 +1386,22 @@ static int testLegacyCrop(struct node *node)
if (!doioctl(node, VIDIOC_CROPCAP, &cap)) {
fail_on_test(doioctl(node, VIDIOC_G_SELECTION, &sel));
- // Checks for invalid types
- if (cap.type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
+ // Checks for mplane types
+ switch (cap.type) {
+ case V4L2_BUF_TYPE_VIDEO_CAPTURE:
cap.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
- else
+ break;
+ case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
+ cap.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ break;
+ case V4L2_BUF_TYPE_VIDEO_OUTPUT:
cap.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
- fail_on_test(doioctl(node, VIDIOC_CROPCAP, &cap) != EINVAL);
+ break;
+ case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
+ cap.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
+ break;
+ }
+ fail_on_test(doioctl(node, VIDIOC_CROPCAP, &cap));
cap.type = 0xff;
fail_on_test(doioctl(node, VIDIOC_CROPCAP, &cap) != EINVAL);
} else {

Privacy Policy