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

Benoit Fouet benoit.fouet
Tue Apr 27 14:16:39 CEST 2010


Hi,

On Tue, 27 Apr 2010 00:07:15 +0200 (CEST) stefano wrote:
> Author: stefano
> Date: Tue Apr 27 00:07:15 2010
> New Revision: 22971
> 
> Log:
> Implement v4l2 input size autodetection in v4l2_read_header().
> 
> Move check on frame size after the device is opened and after
> device_try_init() is attempted. If the provided size value is 0x0,
> perform a VIDIOC_G_FMT ioctl() on the device, which sets size to the
> current settings.
> 
> Modified:
>    trunk/libavdevice/v4l2.c
> 
> Modified: trunk/libavdevice/v4l2.c
> ==============================================================================
> --- trunk/libavdevice/v4l2.c	Tue Apr 27 00:00:57 2010	(r22970)
> +++ trunk/libavdevice/v4l2.c	Tue Apr 27 00:07:15 2010	(r22971)
> @@ -610,7 +602,25 @@ static int v4l2_read_header(AVFormatCont
>      }
>      av_log(s1, AV_LOG_INFO, "[%d]Capabilities: %x\n", s->fd, capabilities);
>  
> +    if (!s->width && !s->height) {
> +        struct v4l2_format fmt;
> +
> +        av_log(s1, AV_LOG_INFO, "Size value (%dx%d) unspecified, querying the device for the current settings\n",
> +               s->width, s->height);

why don't you write 0x0 instead ?

Ben



More information about the ffmpeg-cvslog mailing list