aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2022-09-29 11:27:11 +0200
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2022-09-29 11:27:11 +0200
commitfd544473800d02e90bc289434cc44e5aa8fadd0f (patch)
treea03f4f00d534f4e4bcb5f9a579806506a113b619 /utils
parent60e1c6ad1e3fe2d404fa55413a7690a0c2f35e4e (diff)
v4l2-compliance: support INTEGER and INTEGER64 control arraysHEADmaster
The control tests didn't take support for such controls into account. Fix the tests. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'utils')
-rw-r--r--utils/v4l2-compliance/v4l2-test-controls.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/utils/v4l2-compliance/v4l2-test-controls.cpp b/utils/v4l2-compliance/v4l2-test-controls.cpp
index 999dbcd7..1b07f7dc 100644
--- a/utils/v4l2-compliance/v4l2-test-controls.cpp
+++ b/utils/v4l2-compliance/v4l2-test-controls.cpp
@@ -220,7 +220,8 @@ int testQueryExtControls(struct node *node)
}
if (which == V4L2_CTRL_CLASS_USER &&
- (qctrl.type < V4L2_CTRL_COMPOUND_TYPES) &&
+ qctrl.type < V4L2_CTRL_COMPOUND_TYPES &&
+ !qctrl.nr_of_dims &&
qctrl.type != V4L2_CTRL_TYPE_INTEGER64 &&
qctrl.type != V4L2_CTRL_TYPE_STRING &&
qctrl.type != V4L2_CTRL_TYPE_CTRL_CLASS) {
@@ -363,7 +364,8 @@ int testQueryControls(struct node *node)
break;
id = qctrl.id;
fail_on_test(node->controls.find(qctrl.id) == node->controls.end());
- fail_on_test(qctrl.step || qctrl.minimum || qctrl.maximum || qctrl.default_value);
+ if (qctrl.type >= V4L2_CTRL_COMPOUND_TYPES)
+ fail_on_test(qctrl.step || qctrl.minimum || qctrl.maximum || qctrl.default_value);
compound_controls++;
}
fail_on_test(compound_controls != num_compound_ctrls);
@@ -439,7 +441,7 @@ int testSimpleControls(struct node *node)
for (iter = node->controls.begin(); iter != node->controls.end(); ++iter) {
test_query_ext_ctrl &qctrl = iter->second;
- if (qctrl.type >= V4L2_CTRL_COMPOUND_TYPES)
+ if (qctrl.type >= V4L2_CTRL_COMPOUND_TYPES || qctrl.nr_of_dims)
continue;
if (is_vivid && V4L2_CTRL_ID2WHICH(qctrl.id) == V4L2_CTRL_CLASS_VIVID)
continue;
@@ -593,6 +595,16 @@ static int checkExtendedCtrl(const struct v4l2_ext_control &ctrl, const struct t
if (ctrl.id != qctrl.id)
return fail("control id mismatch\n");
+
+ if (qctrl.flags & V4L2_CTRL_FLAG_DYNAMIC_ARRAY) {
+ fail_on_test(qctrl.nr_of_dims != 1);
+ unsigned tot_elems = qctrl.dims[0];
+ fail_on_test(qctrl.elems > tot_elems);
+ fail_on_test(!qctrl.elems);
+ }
+ if (qctrl.nr_of_dims)
+ return 0;
+
switch (qctrl.type) {
case V4L2_CTRL_TYPE_INTEGER:
case V4L2_CTRL_TYPE_INTEGER64:
@@ -627,12 +639,6 @@ static int checkExtendedCtrl(const struct v4l2_ext_control &ctrl, const struct t
default:
break;
}
- if (qctrl.flags & V4L2_CTRL_FLAG_DYNAMIC_ARRAY) {
- fail_on_test(qctrl.nr_of_dims != 1);
- unsigned tot_elems = qctrl.dims[0];
- fail_on_test(qctrl.elems > tot_elems);
- fail_on_test(!qctrl.elems);
- }
return 0;
}

Privacy Policy