[FFmpeg-devel] [PATCH 6/6] Implement v4l2 input size autodetection.

Stefano Sabatini stefano.sabatini-lala
Sun Apr 25 23:07:31 CEST 2010


On date Sunday 2010-04-25 11:30:34 +0200, Luca Abeni encoded:
> Hi,
> 
> On Sat, 2010-04-24 at 20:53 +0200, Stefano Sabatini wrote:
> > Move checks on size after the device is opened, and perform a
> > VIDIOC_G_FMT ioctl() on the device if WxH is set to 0x0.
> > ---
> >  libavdevice/v4l2.c |   30 +++++++++++++++++++-----------
> 
> [...]
> > +    if (!ap->width && !ap->height) {
> 
> This should be "||"

Not sure about what we should consider as "unspecified", I assume this
only corresponds to the case 0x0, it seems to me that if at least one
value is set to != 0 then the size should not be considered
unspecified (BTW: we need a section of the documentation where to
document all these assumptions, e.g. man ffmpeg devices).

> > +        struct v4l2_format fmt;
> > +
> > +        av_log(s1, AV_LOG_INFO, "Size value unspecified, querying the device\n");
> 
> This message is confusing (it does not specify what the device is being
> queried for: a supported video size? The latest used video size?).
> What the code really does is to use the current device's settings (if a
> generic frame size supported by the device is enough, this whole part of
> code can be removed, because device_init() can take care of getting a
> supported frame size).

Yes, I updated the messages.

> BTW, since you are changing this code, I am wondering if
> avcodec_check_dimensions() should be moved after device_try_init().

Makes sense.

Regards.
-- 
FFmpeg = Fiendish Freak Moronic Portable Emblematic Governor



More information about the ffmpeg-devel mailing list