diff options
author | Jens Rosenboom <jens.rosenboom@eu.panasonic.com> | 2008-10-21 07:59:41 +0000 |
---|---|---|
committer | Luca Abeni <lucabe72@email.it> | 2008-10-21 07:59:41 +0000 |
commit | 3d0d9a5e3bbb7eb0e97b588afe1be73c1fbe9075 (patch) | |
tree | f2043b5f1c375623afa1e2e347d23dc5a94d040e | |
parent | 0223bd6f525cdbca92b59ccde1c867a2fd6b658b (diff) | |
download | ffmpeg-3d0d9a5e3bbb7eb0e97b588afe1be73c1fbe9075.tar.gz |
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
-rw-r--r-- | libavdevice/v4l2.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c index 699a982ac2..d8d58f06bd 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; } |