[libcamera-devel,0/2] libcamera: Initial v4l2device object

Message ID 20181221123724.27290-1-kieran.bingham@ideasonboard.com
Headers show
Series
  • libcamera: Initial v4l2device object
Related show

Message

Kieran Bingham Dec. 21, 2018, 12:37 p.m. UTC
Provide an initial object to handle opening and querying a v4l2device
object.

A test-suite is added to support multiple tests for the object (not all
provided in this series) and an associated update to the test base class
provides a helper to determine if an external test resource is
available.

The v4l2device test base class expects /dev/video0 to be a valid video
capture device node. This will not always be the case and instead
(later) it should iterate all video device nodes and identify a suitable
device to utilise in testing.

There are further patches on top of this - but they're not yet ready,
and sending this out gives us the opportunity to incorporate a
v4l2device object for consumption by other developers, while the API
grows.


Kieran Bingham (2):
  test: libtest: Add path_exists helper
  lib: Add V4L2 Device object

 src/libcamera/include/v4l2_device.h   |  36 +++++++
 src/libcamera/meson.build             |   2 +
 src/libcamera/v4l2_device.cpp         | 137 ++++++++++++++++++++++++++
 test/libtest/test.cpp                 |  11 +++
 test/libtest/test.h                   |   2 +
 test/meson.build                      |   2 +
 test/v4l2_device/double_open.cpp      |  32 ++++++
 test/v4l2_device/meson.build          |  12 +++
 test/v4l2_device/v4l2_device_test.cpp |  36 +++++++
 test/v4l2_device/v4l2_device_test.h   |  31 ++++++
 10 files changed, 301 insertions(+)
 create mode 100644 src/libcamera/include/v4l2_device.h
 create mode 100644 src/libcamera/v4l2_device.cpp
 create mode 100644 test/v4l2_device/double_open.cpp
 create mode 100644 test/v4l2_device/meson.build
 create mode 100644 test/v4l2_device/v4l2_device_test.cpp
 create mode 100644 test/v4l2_device/v4l2_device_test.h