v4l2-compliance: only discrete framesizes are not allowed for output
authorHans Verkuil <hans.verkuil@cisco.com>
Sun, 13 Jul 2014 00:15:45 +0000 (02:15 +0200)
committerHans Verkuil <hans.verkuil@cisco.com>
Sun, 13 Jul 2014 00:15:45 +0000 (02:15 +0200)
Stepwise/continuous framesizes can be valid for output as well, so
relax this test.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
utils/v4l2-compliance/v4l2-test-formats.cpp

index 9bb6b3e..166495d 100644 (file)
@@ -165,6 +165,8 @@ static int testEnumFrameSizes(struct node *node, __u32 pixfmt)
                                        frmsize.discrete.width + 1, frmsize.discrete.height, 0);
                        if (ret && ret != ENOTTY)
                                return ret;
+                       if (ret == 0 && !(node->caps & (V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_CAPTURE_MPLANE)))
+                               return fail("found discrete framesizes when no video capture is supported\n");
                        break;
                case V4L2_FRMSIZE_TYPE_CONTINUOUS:
                        if (frmsize.stepwise.step_width != 1 || frmsize.stepwise.step_height != 1)
@@ -248,8 +250,6 @@ static int testEnumFormatsType(struct node *node, unsigned type)
                ret = testEnumFrameSizes(node, fmtdesc.pixelformat);
                if (ret && ret != ENOTTY)
                        return ret;
-               if (ret == 0 && !(node->caps & (V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_CAPTURE_MPLANE)))
-                       return fail("found framesizes when no video capture is supported\n");
                f++;
                if (type == V4L2_BUF_TYPE_PRIVATE)
                        continue;