[PATCH zbar 1/1] v4l2: add fallback for systems without V4L2_CTRL_WHICH_CUR_VAL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: James Hilliard <james.hilliard1@xxxxxxxxx>

Some older systems don't seem to have V4L2_CTRL_WHICH_CUR_VAL so add a
fallback.

Signed-off-by: James Hilliard <james.hilliard1@xxxxxxxxx>
---
 zbar/video/v4l2.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/zbar/video/v4l2.c b/zbar/video/v4l2.c
index 0147cb1..b883ecc 100644
--- a/zbar/video/v4l2.c
+++ b/zbar/video/v4l2.c
@@ -866,7 +866,11 @@ static int v4l2_s_control(zbar_video_t *vdo,
 
     memset(&ctrls, 0, sizeof(ctrls));
     ctrls.count = 1;
+#ifdef V4L2_CTRL_WHICH_CUR_VAL
     ctrls.which = V4L2_CTRL_WHICH_CUR_VAL;
+#else
+    ctrls.ctrl_class = V4L2_CTRL_CLASS_USER;
+#endif
     ctrls.controls = &c;
 
     memset(&c, 0, sizeof(c));
@@ -914,7 +918,11 @@ static int v4l2_g_control(zbar_video_t *vdo,
 
     memset(&ctrls, 0, sizeof(ctrls));
     ctrls.count = 1;
+#ifdef V4L2_CTRL_WHICH_CUR_VAL
     ctrls.which = V4L2_CTRL_WHICH_CUR_VAL;
+#else
+    ctrls.ctrl_class = V4L2_CTRL_CLASS_USER;
+#endif
     ctrls.controls = &c;
 
     memset(&c, 0, sizeof(c));
-- 
2.7.4




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux