Hi,
On 09/05/2011 01:06 AM, Kevin Kofler wrote:
Dominik 'Rathann' Mierzejewski wrote:
> Apart from this patch, kino needs to be ported to v4l2 API as well,
> as the v4l1 API is already gone from F16+ kernels. One can make it
> build (as I did) by using the backwards-compatibility header from
> libv4l (libv4l1-videodev.h), but haven't tested if the built binary
> actually works.
Apps should be using libv4l rather than v4l2 directly. (Otherwise, they
won't work with many webcams out there, because v4l2 doesn't decode weird
formats in the kernel.)
Using the v4l1 compat header from libv4l is good enough until upstream gets
native libv4l support. Please post the patch you used.
The compat header will just make things compile, it replaces linux/videodev.h,
but does not do anything magic to make the app actually work with v4l2
devices all of a sudden, iow the app will still try to talk the v4l1 API to
any /dev/video nodes.
To use the v4l1 compat layer libv4l comes with, you need to:
1) #include <libv4l1.h>
2) replace open("/dev/video0", ...) with v4l1_open("/dev/video0",
...)
3) replace ioctl(video_fd, ...) with v4l1_ioctl(video_fd, ...)
4) idem for read / mmap / munmap (on a ptr coming from v4l1_mmap) & close
5) Add -lv4l1 to LD_FLAGS
Or start the binary with LD_PRELOAD=/usr/lib/libv4l/v4l1_compat.so, but the
above is highly preferred. The LD_PRELOAD shim is really only there for
proprietary software (yes skype I'm looking at you).
This will make libv4l1 translate the v4l1 calls to v4l2 calls, and then
pass them through libv4l2, so that you also get the often needed format
conversion.
Regards,
Hans