I�aki Garc�a Etxebarria wrote:
> Hi,
>
> Tom Rogie wrote:
> > As I never did hardware related programming, I would like to know if
> > there is some good documenation on the web or in some books about
> > programming with the V4L API? It may be a general document about API
> > programming, so not V4L specific.
> The API document in the V4L site is a good starting point. I think the
> URL is
>
> http://roadrunner.swansea.uk.linux.org/v4l.shtml.
>
> I learnt from there. You have the option of using V4L2 instead, the URL
> is
>
> http://millennium.diads.com/bdirks/v4l2.htm
>
> And finally, a shameless plug. For my application, i have developed a C
> layer that, imho, wraps very nicely both of them (V4l and v4l2). If you
> aren't interested in the intrinsics, but you want it just to work, tell
> me and i will send the API to you (maybe you like it). With a few lines
> of code you will have a working capture device (and i need some testers
> anyway).
>
> I hope that helps,
> I�aki
>
> --
> To unsubscribe: mail [EMAIL PROTECTED] with
> "unsubscribe" as the Subject.
I found the API document to be pretty minimal: lot's of things left out
that you really need to know. Reading the xawtv source code is one way to
figure out V4l. Reading the actual Video4Linux source code, or one of its
drivers (e.g. bttv / bt848 or whatever it was) is also a good way to learn
what it does. There are some undocumented features. For example, instead
of clipping rectangles you can specify a clipping bitmap. At least in the
bt848 driver, it always turns rectangles into a bitmap anyway, and then
scans the bitmap (it really does!) so a clipping bitmap is more efficient.
To set a clip bitmap:
struct video_window win;
win.x = win.y = <whatever>;
win.width = width;
win.height = height;
win.clipcount = VIDEO_CLIP_BITMAP;
win.clips = (struct video_clip *)pBitmap;
ioctl (fd, VIDIOCSWIN, &win);
where "pBitmap" points to a bitmap (bit/pixel) of size 1024 by 625. Those
numbers are hardwired in the bt* driver.
I realize that this is an undocumented feature, and that other cards and
even future releases may not support it, but it does work for me on my
Bt848 card/driver. I like the feature, so please don't remove it if you
can help it!
The real point: you have to read some source to figure out v4l.
Peter Kaczowka
--
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject.