[vlc-devel] [PATCH 3/3] v4l2: only use VBI device is standard selected is NTSC

Devin Heitmueller dheitmueller at kernellabs.com
Wed Oct 24 19:30:52 CEST 2012

Hi, Rémi

On Wed, Oct 24, 2012 at 12:13 PM, Rémi Denis-Courmont <remi at remlab.net> wrote:
> Le dimanche 21 octobre 2012 23:01:02, Devin Heitmueller a écrit :
>> We don't currently support any VBI other than EIA-608 closed
>> caption parsing, so don't attempt to use the /dev/vbi device
>> unless the standard selected is NTSC.  This mitigates the risk
>> of causing problems with devices that use other standards (e.g.
>> PAL, SECAM, etc).
> What happens if the standard is unspecified and PAL is autodetected, or if the
> capture device does not have VBI at all (e.g. webcam)?

That's a tricky question to answer.  We do handle the case where the
standard is unspecified by the VLC user by doing a G_STD call and
getting the currently selected standard (this is one reason we do the
VBI setup *after* the video setup).  However if the driver reports
"all standards" because autodetection hasn't occurred yet, there's the
possibility of a race where we bind the VBI device first (using NTSC),
causing it not to negotiate to PAL.  This is mitigated by the fact
that almost no drivers actually support autodetection, combined with
the user knowing to "don't do that".  The main reason autodetection
tends not to be supported is because the caller won't know what
capture resolution to use (e.g. 720x576 versus 720x480), causing
him/her to need to tear down the session and restart.

For the webcam case, first off it's worth noting that a /dev/vbiX
device won't get created for the webcam.  However if you attempt to
select a VBI device for some unrelated tuner (i.e. pick /dev/video0
associated with your webcam and /dev/vbi0 associated with a separate
tuner), the code is written such that it won't attempt to bind the VBI
device because webcams do not support any particular video standard
(as opposed to NTSC or PAL, webcams have fixed resolutions and
framerates that aren't found in broadcast television).

All of this assumes that drivers conform to the V4L2 standard, which
is all the more reason why the user should have to explicitly specify
the VBI device (as opposed to it being enabled by default).


Devin J. Heitmueller - Kernel Labs

More information about the vlc-devel mailing list