[ playerstage-Patches-3496741 ] libv4l2 webcam driver for Player

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[ playerstage-Patches-3496741 ] libv4l2 webcam driver for Player

Patches item #3496741, was opened at 2012-03-04 01:23
Message generated for change (Tracker Item Submitted) made by newchief
You can respond by visiting:

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Player
Group: Release-3.0
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Paul Osmialowski (newchief)
Assigned to: Rich Mattes (jpgr87)
Summary: libv4l2 webcam driver for Player

Initial Comment:
This patch adds new camera driver to Player. This new driver allows to use variety of USB webcams with recent (3.2.x) Linux kernels. Things have changed there and now other Player drivers (camerav4l, camera v4l2, camerauvc, cvcam) cannot work with USB webcams properly. I was able to obtain stable live image using gstreamer driver, unfortunately, it didn't survive few hours of working. Since part of gstreamer responsible for that (gst-plugins-v4l2) depends on libv4l2 internally, I decided to prepare new Player driver that calls libv4l2 functions driectly. It was a good choice - whole thing can survive few days of working.
I used wrapper mode of libv4l2 library API. This driver always produces 24-bit RGB bitmaps - libv4l2convert that comes together with libv4l2 library is used for image conversions.
One of two work modes (mmap/read) can be set in Player configuration file: mmap mode is used by default, read mode can be selected by setting read_mode 1.


- Shall new driver replace any of older drivers? NO! All other camera drivers are still good where they work; libv4l2 driver adds dependency on external libraries that may not be available everywhere; also, v4l/v4l2 standard is used not only on Linux, good old camerav4l driver works for me on Solaris. New driver is rather for USB devices while camerav4l2 can fully support PCI framegrabbers (camerav4l2 can grab from selected channels while libv4l2 can only capture image from channel 0 - this is a limitation that came from underlying library's API)
- I can't find libv4l2 on my distro - where to find it? Well, there's a naming problem here. libv4l2 library and libv4lconvert that comes with it are part of v4l-utils - you can try to find it on this name (with -dev or -devel suffix added - we need headers and pkgconfig spec files: libv4l2.pc and libv4lconvert.pc); some distros split v4l-utils into utils and libraries, for example, on Gentoo Linux libv4l2 and libv4lconvert are shipped as libv4l (not libv4l2!) package while utils (for example, Qt frontend) are in v4l-utils package.
- What about limitations? This driver uses libv4lconvert (that comes with libv4l2)  which is known to be not thread safe - therefore driver constructor code does not allow to create more than one instance of this driver in one Player process - if you need to deal with more than one USB camera, start few Player processes for them

The cmake specfile for this driver is designed to detect dependencies automaticly using pkgconfig infrastructure.


You can respond by visiting:

Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
Playerstage-developers mailing list
[hidden email]