[vlc-devel] commit: Support v4l2 drivers with JPEG type (Antoine Cellerier )

git version control git at videolan.org
Sat Sep 12 15:00:51 CEST 2009


vlc | branch: 1.0-bugfix | Antoine Cellerier <dionoea at videolan.org> | Sat Jul 18 23:13:05 2009 +0200| [614d478c3150d1487ebd55087b0386fa85bc3263] | committer: Antoine Cellerier 

Support v4l2 drivers with JPEG type

(and print some extra debug)

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

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

diff --git a/modules/access/v4l2.c b/modules/access/v4l2.c
index 31dae66..9238704 100644
--- a/modules/access/v4l2.c
+++ b/modules/access/v4l2.c
@@ -429,8 +429,8 @@ static const struct
 
     /* Compressed data types */
     { V4L2_PIX_FMT_MJPEG,   VLC_FOURCC('M','J','P','G'), 0, 0, 0 },
+    { V4L2_PIX_FMT_JPEG,    VLC_FOURCC('J','P','E','G'), 0, 0, 0 },
 #if 0
-    { V4L2_PIX_FMT_JPEG,    VLC_FOURCC('J','P','E','G') },
     { V4L2_PIX_FMT_DV,      VLC_FOURCC('?','?','?','?') },
     { V4L2_PIX_FMT_MPEG,    VLC_FOURCC('?','?','?','?') },
 #endif
@@ -446,7 +446,7 @@ static const struct
 static const __u32 p_chroma_fallbacks[] =
 { V4L2_PIX_FMT_YUV420, V4L2_PIX_FMT_YVU420, V4L2_PIX_FMT_YUV422P,
   V4L2_PIX_FMT_YUYV, V4L2_PIX_FMT_UYVY, V4L2_PIX_FMT_BGR24,
-  V4L2_PIX_FMT_BGR32, V4L2_PIX_FMT_MJPEG };
+  V4L2_PIX_FMT_BGR32, V4L2_PIX_FMT_MJPEG, V4L2_PIX_FMT_JPEG };
 
 static const struct
 {
@@ -2010,8 +2010,10 @@ static int OpenVideoDev( vlc_object_t *p_obj, demux_sys_t *p_sys, bool b_demux )
     p_sys->i_width = fmt.fmt.pix.width;
     p_sys->i_height = fmt.fmt.pix.height;
 
-    /* Check interlacing */
     if( v4l2_ioctl( i_fd, VIDIOC_G_FMT, &fmt ) < 0 ) {;}
+    /* Print extra info */
+    msg_Dbg( p_demux, "Driver requires at most %d bytes to store a complete image", fmt.fmt.pix.sizeimage );
+    /* Check interlacing */
     switch( fmt.fmt.pix.field )
     {
         case V4L2_FIELD_NONE:




More information about the vlc-devel mailing list