[vlc-commits] v4l2: force normal capture mode

Rémi Denis-Courmont git at videolan.org
Sat Apr 7 18:25:59 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Apr  7 19:24:42 2012 +0300| [31bbe4eb359a5e52d0b000047587bbb06a338aa5] | committer: Rémi Denis-Courmont

v4l2: force normal capture mode

This disables driver-specific modes that VLC would not know about.
This also disables high quality (i.e. still camera) mode since we want
video, as well as other any other future abnormal modes.

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

 modules/access/v4l2/video.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/modules/access/v4l2/video.c b/modules/access/v4l2/video.c
index f3f38f3..96698b4 100644
--- a/modules/access/v4l2/video.c
+++ b/modules/access/v4l2/video.c
@@ -852,13 +852,16 @@ int SetupFormat (vlc_object_t *obj, int fd, uint32_t fourcc,
         msg_Err (obj, "cannot get default format: %m");
         return -1;
     }
-    fmt->fmt.pix.pixelformat = fourcc;
     if (v4l2_ioctl (fd, VIDIOC_G_PARM, parm) < 0)
     {
         msg_Err (obj, "cannot get streaming parameters: %m");
         return -1;
     }
 
+    fmt->fmt.pix.pixelformat = fourcc;
+    parm->parm.capture.capturemode = 0; /* normal video mode */
+    parm->parm.capture.extendedmode = 0;
+
     struct v4l2_frmsizeenum fse = {
         .pixel_format = fourcc,
     };



More information about the vlc-commits mailing list