linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH zbar 1/1] v4l2: add fallback for systems without V4L2_CTRL_WHICH_CUR_VAL
@ 2019-01-16  5:23 james.hilliard1
  2019-01-16 14:24 ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 5+ messages in thread
From: james.hilliard1 @ 2019-01-16  5:23 UTC (permalink / raw)
  To: mchehab+samsung; +Cc: linux-media, James Hilliard

From: James Hilliard <james.hilliard1@gmail.com>

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

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-01-16 21:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-16  5:23 [PATCH zbar 1/1] v4l2: add fallback for systems without V4L2_CTRL_WHICH_CUR_VAL james.hilliard1
2019-01-16 14:24 ` Mauro Carvalho Chehab
2019-01-16 20:34   ` James Hilliard
2019-01-16 21:08     ` Mauro Carvalho Chehab
2019-01-16 21:42       ` James Hilliard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).