[vlc-commits] Retrieve current value of V4L2 64-bits control

Rémi Denis-Courmont git at videolan.org
Sun Oct 2 13:07:22 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Oct  2 13:55:32 2011 +0300| [bc40d784e47045eae1530090e07c007503ce2e4b] | committer: Rémi Denis-Courmont

Retrieve current value of V4L2 64-bits control

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bc40d784e47045eae1530090e07c007503ce2e4b
---

 modules/access/v4l2/controls.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/modules/access/v4l2/controls.c b/modules/access/v4l2/controls.c
index 49db111..6c56e9a 100644
--- a/modules/access/v4l2/controls.c
+++ b/modules/access/v4l2/controls.c
@@ -494,6 +494,22 @@ static vlc_v4l2_ctrl_t *ControlAddInteger64 (vlc_object_t *obj, int fd,
         return NULL;
     }
 
+    struct v4l2_ext_control ext_ctrl = { .id = c->id, .size = 0, };
+    struct v4l2_ext_controls ext_ctrls = {
+        .ctrl_class = V4L2_CTRL_ID2CLASS(c->id),
+        .count = 1,
+        .error_idx = 0,
+        .controls = &ext_ctrl,
+    };
+
+    if (v4l2_ioctl (c->fd, VIDIOC_G_EXT_CTRLS, &ext_ctrls) >= 0)
+    {
+        vlc_value_t val = { .i_int = ext_ctrl.value64 };
+
+        msg_Dbg (obj, "  current: %"PRId64, val.i_int);
+        var_Change (obj, c->name, VLC_VAR_SETVALUE, &val, NULL);
+    }
+
     return c;
 }
 



More information about the vlc-commits mailing list