[SCM] libav/experimental: 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)

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:31:34 UTC 2013


The following commit has been merged in the experimental branch:
commit 3d0d9a5e3bbb7eb0e97b588afe1be73c1fbe9075
Author: Jens Rosenboom <jens.rosenboom at eu.panasonic.com>
Date:   Tue Oct 21 07:59:41 2008 +0000

    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)
    
    Originally committed as revision 15660 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index 699a982..d8d58f0 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -193,6 +193,11 @@ static int device_init(AVFormatContext *ctx, int *width, int *height, int pix_fm
         *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;
 }
 

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list