aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2018-11-28 11:44:19 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2018-11-28 11:44:19 +0100
commitd5b2a43fcfa2d07b12d7e365dfd4a95a53c1589c (patch)
tree4d3130128b5829d7a4f1723504857bd71305f248
parent15de2e05ffa7e16f400fef5b6a7527b6b6534ef8 (diff)
v4l2-compliance: add inject_error helper method
This simplifies the error injection tests. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--utils/v4l2-compliance/v4l2-compliance.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/utils/v4l2-compliance/v4l2-compliance.h b/utils/v4l2-compliance/v4l2-compliance.h
index 1e7d7146..bb5508f3 100644
--- a/utils/v4l2-compliance/v4l2-compliance.h
+++ b/utils/v4l2-compliance/v4l2-compliance.h
@@ -127,6 +127,15 @@ struct node : public base_node, public cv4l_fd {
qctrl_map controls;
pixfmt_map buftype_pixfmts[V4L2_BUF_TYPE_LAST + 1];
+
+ bool inject_error(__u32 id)
+ {
+ v4l2_control ctrl = {
+ .id = id,
+ };
+
+ return is_vivid && !s_ctrl(ctrl);
+ }
};
#define info(fmt, args...) \

Privacy Policy