* video4linux 1 compatibilty wrapper for video4linux 2 devices
@ 2008-06-05 22:07 Hans de Goede
0 siblings, 0 replies; only message in thread
From: Hans de Goede @ 2008-06-05 22:07 UTC (permalink / raw)
To: video4linux-list, spca50x-devs
[-- Attachment #1: Type: text/plain, Size: 2482 bytes --]
Hi All,
As some of you know using v4l1 apps with v4l2 drivers doesn't work very well,
most v4l2 drivers don't implement the VIDIOCGMBUF ioctl at all, and those that
do, often only deliver pixelformats which v4l1 applications don't expect /
can't handle.
In order to fix this at the kernel level we would need to put conversion from
formats like jpeg and bayer to bgr24 or yuv420 in to the kernel, but one of the
points of v4l2 is to drop all that conversion code from the kernel and do it in
userspace where it belongs.
Trying to not do conversion in the kernel, but still make apps think its done
in the kernel. leads to IMHO overly complex solutions like this:
http://www.linuxtv.org/v4lwiki/index.php/V4L2UserspaceLibrary
Thus inspired by similar solutions for using applications which want to output
sound to oss with arts, I've created a c-library wrapper which intercepts the
following calls to video4linux2 devices:
open
close
read
ioctl
mmap
And emulates v4l1, including doing format conversions where necessary. I've
tested this with my pac207 v4l2 driver and the uvc driver.
Using ekiga and spcaview in both mmap and read modus. And read modus even works
on the uvc driver (which doesn't support read), as the wrapper emulates it
using mmap
To give this a try:
tar xvfz v4l1-compat-0.1.tar.gz
cd v4l1-compat
make
export LD_PRELOAD=`pwd`/v4l1-compat.so
<run v4l1 application>
---
Future plans:
1) bugfix where necessary
2) maybe add v4l2 -> v4l2 emulating more supported formats (iow do conversion)
so that for example xawtv which wants rgb or yuv, can work with bayer /
jpg webcams too.
But the biggest future plan is splitting the current wrapper into a real libray
called v4l-lib and a wrapper using it. The lib would offer v4l_open, v4l_ioctl,
etc which will behave exactly as the real ones, except that it will do things
like conversion where necessary. The idea here is that applications can very
easily be ported to this new lib (just replace open with v4l_open, etc) and
then we have one central place to things like decoding of certain pixformats,
but also (in a far future) certain image enhancement algorithm's
Applications which don't want this can keep using the plain open, ioctl, etc.
But for applications who do want things like conversion done for them, they can
now gain that with little effort.
This would for example make it possible to use camorama with v4l2 cams with
very little effort.
Regards,
Hans
[-- Attachment #2: v4l1-compat-0.1.tar.gz --]
[-- Type: application/x-gzip, Size: 27119 bytes --]
[-- Attachment #3: Type: text/plain, Size: 164 bytes --]
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-06-05 22:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-05 22:07 video4linux 1 compatibilty wrapper for video4linux 2 devices Hans de Goede
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox