aboutsummaryrefslogtreecommitdiffstats
path: root/utils/v4l2-compliance/v4l2-test-formats.cpp
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2018-09-14 10:00:35 +0200
committerHans Verkuil <hans.verkuil@cisco.com>2018-09-14 10:00:35 +0200
commitd62f02f96f8d509566c24bcaadeee35d4a018e3b (patch)
treeb067374627a6e7c39a3fbd9c7bb800bb6cd9b5a0 /utils/v4l2-compliance/v4l2-test-formats.cpp
parent72e6d7e7064c756baa1c53f1c80e50712c1f7af5 (diff)
v4l2-compliance: improve S_PARM test
Check for framerates 0/1 and 1/0 as well, not just 0/0. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Diffstat (limited to 'utils/v4l2-compliance/v4l2-test-formats.cpp')
-rw-r--r--utils/v4l2-compliance/v4l2-test-formats.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/utils/v4l2-compliance/v4l2-test-formats.cpp b/utils/v4l2-compliance/v4l2-test-formats.cpp
index 4524dfd9..02c2ce9e 100644
--- a/utils/v4l2-compliance/v4l2-test-formats.cpp
+++ b/utils/v4l2-compliance/v4l2-test-formats.cpp
@@ -1236,6 +1236,28 @@ static int testParmType(struct node *node, unsigned type)
fail_on_test(parm.type != type);
if (!(parm.parm.capture.capability & V4L2_CAP_TIMEPERFRAME))
warn("S_PARM is supported but doesn't report V4L2_CAP_TIMEPERFRAME\n");
+ ret = testParmStruct(node, parm);
+ if (ret)
+ return ret;
+ if (V4L2_TYPE_IS_OUTPUT(type)) {
+ parm.parm.output.timeperframe.numerator = 0;
+ parm.parm.output.timeperframe.denominator = 1;
+ } else {
+ parm.parm.capture.timeperframe.numerator = 0;
+ parm.parm.capture.timeperframe.denominator = 1;
+ }
+ fail_on_test(doioctl(node, VIDIOC_S_PARM, &parm));
+ ret = testParmStruct(node, parm);
+ if (ret)
+ return ret;
+ if (V4L2_TYPE_IS_OUTPUT(type)) {
+ parm.parm.output.timeperframe.numerator = 1;
+ parm.parm.output.timeperframe.denominator = 0;
+ } else {
+ parm.parm.capture.timeperframe.numerator = 1;
+ parm.parm.capture.timeperframe.denominator = 0;
+ }
+ fail_on_test(doioctl(node, VIDIOC_S_PARM, &parm));
return testParmStruct(node, parm);
}

Privacy Policy