V4L-2 support in FreeBSD

Hans Petter Selasky hselasky at c2i.net
Mon Sep 29 07:50:19 UTC 2008

On Monday 29 September 2008, Fritz Katz wrote:
> --- On Tue, 9/23/08, Hans Petter Selasky <hselasky(at)c2i(dot)net> wrote:
> > Hi,
> >
> > Maybe you will find the following file useful:
> > http://perforce.freebsd.org/fileLogView.cgi?FSPC=//depot/projects/usb/src
> >/sys/sys/videodev.h
>   Thanks!, Yes, very useful.
>   Can you point me at any drivers or user applications
>   that include and use this file?

Hi Fritz,

There is an example USB webcam driver in my SVN repository that uses this 
file. Just search for webcam: find . -name "*webcam*"

>   Are there any plans to check it into the
>   tree for FreeBSD-8?

No, not yet.

>   Some nits:
>    1) V4L2 has divided the info contained in this file
>       into two: videodev.h which contains the obsolete V4L1
>       definitions & videodev2.h
>       when I attempt to link a V4L2 application using it,
>       I get compiler errors and am forced to edit the source
>       files to get them to compile.
>       Without V4L-1 structs and ioctl definitions, many
>       older applications won't compile.

The V4L-1 part has been stripped away. It is a pure V4L-2 library. I have 
compiled with ekiga and was able to use my webcam, although some work remains 
like moving the decoding of the JPEG frames from a kernel thread to a 
userland thread.

>    2) The "#define V4L2_STD_PAL_NC" is "#define V4L2_STD_PAL_Nc"
>       in V4L2. (Just because Penguins do something silly like
>       putting a lower case letter in a define doesn't mean we
>       should do it too -- but it *IS* their standard).

Just send me a patch.

> > Regarding porting, there is not much you need to do. Simply
> > make sure that you handle the IOCTLs directly in the video driver.
> >
> > --HPS
>   Yes, "piece of cake!" :-)


More information about the freebsd-multimedia mailing list