From d26e4941419b05fcb2b6708ee32aef367c2ec4af Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Fri, 7 Sep 2018 18:09:03 +0200 Subject: 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 --- utils/v4l2-compliance/v4l2-test-formats.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'utils') 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 { -- cgit v1.2.1