initial support for video devices and printer ports

Sjoerd Simons sjoerd at luon.net
Thu Sep 2 02:38:41 PDT 2004


I only have experience with v4l, so i can't comment on v4l2 stuff. butt...

On Wed, Sep 01, 2004 at 09:04:11PM +0200, David Zeuthen wrote:
> On Tue, 2004-08-31 at 21:01 +0200, Kay Sievers wrote:
> > Attached is a patch to add:
> > 
> > Support for v4l devices:
> >   http://vrfy.org/projects/hal/v4l.png
> >   o it supports v4l and v4l2
> >     (the v4l2 headers are missing on Fedora, so I copied the one struct in)
> >   o we need to define the capabilities ,it's just "video.FIXME" now
> 
> This looks good. Suggest to call it media.* though; 'video' sounds to me
> like it should be used for display adapter stuff. Btw, is it possible to
> distinguish between capture cards and webcams without using some kind of
> heuristic?

You can distinguish a tv card and a webcam card easily, because a webcam
doesn't have a tuner.. To detect capture cards you can check if it supports
mpeg or mjpeg {de,en}coding. Unfortunately to query this stuff you need to open
the device and do some ioctls, during which no other program can use the
device (and you can't query if something is already using it ofcourse).

> Aren't some of the v4l[12] devices also for audio or am I mistaken? If
> yes, we probably need to have media.video.* and media.audio.*. Should
> probably put tuner related stuff into media.tuner.*; this might include
> a link to the i2c device it will have as child (e.g. my Bt878 capture
> card is also a i2c-adapter).

A video4linux device can also be used for radio, raw
audio capture (from the tuned channel), provide vbi (teletext stuff) and a
teletext interface (don't know the difference with vbi). You also only query
this with an ioctl on the device itself.. 

> IIRC, talking to some GStreamer guys at GUADEC, there are some issues
> with the properties the v4l subsystem provides; does anyone know? (btw,
> if yes, this is another good reason for device information files).

I don't know what they talked. But what's extremely annoying imho about the
v4l1 api is that you can't find out which palettes are supported beforehand.
The only way to know is just to try and see if a certain palette it works. 

Also for the frame size a device can deliver, you can query maximum and minimum
sizes. But there is no guarantee that all sizes in between are supported (a lot
of webcams don't).

And ofcourse if your doing media stuff, don't forget about DVB :). Current cvs 
dvb kernel drivers have minimal sysfs support, so it should be possible to
detect them. If anyone implements it, i can test it on some boxes with multiple
card if needed (only budget cards though, thus no mpeg decoder).

  Sjoerd
-- 
If entropy is increasing, where is it coming from?
_______________________________________________
hal mailing list
hal at freedesktop.org
http://freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list