[libcamera-devel] [PATCH v4 0/4] V4L2 compatibility layer

Paul Elder paul.elder at ideasonboard.com
Tue Dec 31 06:33:10 CET 2019


Implement the initial version of the V4L2 compatibility layer.

In v3 we retrieved 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 pipeline handler. 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.

In v4 the infrastructure between the camera manager and the pipeline
handler to assign and retrieve, respectively, this mapping is
simplified. This is 2/4. 3/4 implements the mapping assignment for the
uvcvideo pipeline handler.

In v3 we also saw the addition of the FrameMetadata class
that extracted 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.

In v4 this buffer tracking mechanism is squashed into the main V4L2
compatibility layer patch, 4/4. There are really no other major changes
on this scale, aside from minor fixes and cosmetic changes.

Paul Elder (4):
  libcamera: v4l2_device, v4l2_videodevice: call open system call
    directly
  libcamera: camera_manager, pipeline_handler: allow retrieving cameras
    by device numbers
  libcamera: pipeline_handler: uvcvideo: register all Cameras along with
    a devnum
  v4l2: v4l2_compat: Add V4L2 compatibility layer

 include/libcamera/camera_manager.h       |   5 +-
 meson_options.txt                        |   5 +
 src/libcamera/camera_manager.cpp         |  37 +-
 src/libcamera/include/pipeline_handler.h |   3 +-
 src/libcamera/pipeline/uvcvideo.cpp      |   7 +-
 src/libcamera/pipeline_handler.cpp       |  13 +-
 src/libcamera/v4l2_device.cpp            |   3 +-
 src/libcamera/v4l2_videodevice.cpp       |   4 +-
 src/meson.build                          |   4 +
 src/v4l2/meson.build                     |  31 ++
 src/v4l2/v4l2_camera.cpp                 | 233 ++++++++
 src/v4l2/v4l2_camera.h                   |  83 +++
 src/v4l2/v4l2_camera_proxy.cpp           | 649 +++++++++++++++++++++++
 src/v4l2/v4l2_camera_proxy.h             |  82 +++
 src/v4l2/v4l2_compat.cpp                 |  80 +++
 src/v4l2/v4l2_compat_manager.cpp         | 255 +++++++++
 src/v4l2/v4l2_compat_manager.h           |  77 +++
 17 files changed, 1562 insertions(+), 9 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