[libcamera-devel] [PATCH v3 0/6] V4L2 compatibility layer

Paul Elder paul.elder at ideasonboard.com
Mon Dec 23 08:26:14 CET 2019


Implement the initial version of the V4L2 compatibility layer.

In v3 we newly retrieve libcamera Cameras based on the device number of
the V4L2 device that the applications open()s. This device number to
Camera mapping is optionally determined by the device enumerator. If the
mapping is not assigned, then there is simply no V4L2 device node that
can be opened that will map to a libcamera Camera. Patches 2/6, 3/6, and
4/6 prepare the infrastructure in the pipeline handler, the uvcvideo
pipeline handler, and the camera manager for this to work.

The other major change in v3 is the addition of the FrameMetadata class
that extracts the necessary information from a Buffer to expose a
v4l2_buffer, as well as a new mechanism using this FrameMetadata to
cache the state of all completed buffers in the V4L2CameraProxy to
reduce the number of cross-thread calls. Patche 5/6 is the main
implementation, and patch 6/6 contains the new buffer state component.

Paul Elder (6):
  libcamera: v4l2_device, v4l2_videodevice: call open system call
    directly
  libcamera: pipeline_handler: Add map from devnum to cameras
  libcamera: pipeline_handler: uvcvideo: register all Cameras along with
    a devnum
  libcamera: camera_manager: allow retrieving cameras by devnum
  v4l2: v4l2_compat: Add V4L2 compatibility layer
  v4l2: v4l2-compat: add buffer state tracking to V4L2CameraProxy

 include/libcamera/camera_manager.h       |   3 +
 meson_options.txt                        |   5 +
 src/libcamera/camera_manager.cpp         |  24 ++
 src/libcamera/include/pipeline_handler.h |   6 +
 src/libcamera/pipeline/uvcvideo.cpp      |   7 +-
 src/libcamera/pipeline_handler.cpp       |  30 ++
 src/libcamera/v4l2_device.cpp            |   3 +-
 src/libcamera/v4l2_videodevice.cpp       |   3 +-
 src/meson.build                          |   4 +
 src/v4l2/meson.build                     |  31 ++
 src/v4l2/v4l2_camera.cpp                 | 240 +++++++++++
 src/v4l2/v4l2_camera.h                   |  83 ++++
 src/v4l2/v4l2_camera_proxy.cpp           | 528 +++++++++++++++++++++++
 src/v4l2/v4l2_camera_proxy.h             |  73 ++++
 src/v4l2/v4l2_compat.cpp                 |  78 ++++
 src/v4l2/v4l2_compat_manager.cpp         | 379 ++++++++++++++++
 src/v4l2/v4l2_compat_manager.h           |  86 ++++
 17 files changed, 1579 insertions(+), 4 deletions(-)
 create mode 100644 src/v4l2/meson.build
 create mode 100644 src/v4l2/v4l2_camera.cpp
 create mode 100644 src/v4l2/v4l2_camera.h
 create mode 100644 src/v4l2/v4l2_camera_proxy.cpp
 create mode 100644 src/v4l2/v4l2_camera_proxy.h
 create mode 100644 src/v4l2/v4l2_compat.cpp
 create mode 100644 src/v4l2/v4l2_compat_manager.cpp
 create mode 100644 src/v4l2/v4l2_compat_manager.h

-- 
2.23.0



More information about the libcamera-devel mailing list