[FFmpeg-cvslog] r15660 - trunk/libavdevice/v4l2.c

lucabe subversion
Tue Oct 21 09:59:42 CEST 2008


Author: lucabe
Date: Tue Oct 21 09:59:41 2008
New Revision: 15660

Log:
The v4l2 driver can silently change the pixel format in the
VIDIOC_S_FMT ioctl(). In this case, device_init() should fail so that
a different pixel format is tried.
Patch by Jens Rosenboom (jens DOT rosenboom AT eu DOT panasonic DOT com)


Modified:
   trunk/libavdevice/v4l2.c

Modified: trunk/libavdevice/v4l2.c
==============================================================================
--- trunk/libavdevice/v4l2.c	(original)
+++ trunk/libavdevice/v4l2.c	Tue Oct 21 09:59:41 2008
@@ -193,6 +193,11 @@ static int device_init(AVFormatContext *
         *height = fmt.fmt.pix.height;
     }
 
+    if (pix_fmt != fmt.fmt.pix.pixelformat) {
+        av_log(ctx, AV_LOG_DEBUG, "The V4L2 driver changed the pixel format from 0x%08X to 0x%08X\n", pix_fmt, fmt.fmt.pix.pixelformat);
+        res = -1;
+    }
+
     return res;
 }
 




More information about the ffmpeg-cvslog mailing list