[libcamera-devel,0/5] libcamera: Buffer Sharing
mbox series

Message ID 20190207212119.30299-1-kieran.bingham@ideasonboard.com
Headers show
Series
  • libcamera: Buffer Sharing
Related show

Message

Kieran Bingham Feb. 7, 2019, 9:21 p.m. UTC
Extend the V4L2Device to support buffers provided by other V4L2Devices and
externally provided BufferPools.

To facilitate testing of the importBuffers, the media_device is extended with a
helper to simplify finding the default entity. This makes identifying the
default video node clearer.

The test to validate the buffer sharing is currently incredibly specific,
requiring a Logitech BRIO uvcvideo web camera, for the simple reason that it
was convenient for me. I expect that this shall be updated to identify a
virtual device for testing, however I do not currently have the facility to
load VIMC (easily) on my laptop.

This update has highlighted that the exportBuffers function was being passed
the bufferCount redundantly as we expect the BufferPool to provide this sizing
information for us, and so it was simplified.

And finally, now that we have multiple V4L2Devices running in parallel,
identifying which LOG output belongs to which device is impossible, thus a
V4L2DEVICE_LOG(severity) helper is added which prepends the V4L2 VideoNode for
each message.

Kieran Bingham (5):
  libcamera: media_device: Provide the default entity
  libcamera: v4l2_device: importBuffers support
  test: v4l2_device: Provide buffer sharing test
  libcamera: v4l2_device: Simplify exportBuffers()
  libcamera: v4l2_device: Provide V4L2 Log helper

 src/libcamera/include/media_device.h  |   1 +
 src/libcamera/include/v4l2_device.h   |   3 +-
 src/libcamera/media_device.cpp        |  15 +++
 src/libcamera/pipeline/ipu3/ipu3.cpp  |   3 +-
 src/libcamera/pipeline/uvcvideo.cpp   |  12 +-
 src/libcamera/pipeline/vimc.cpp       |   2 +-
 src/libcamera/v4l2_device.cpp         | 104 ++++++++++-----
 test/v4l2_device/buffer_sharing.cpp   | 178 ++++++++++++++++++++++++++
 test/v4l2_device/capture_async.cpp    |   4 +-
 test/v4l2_device/meson.build          |   1 +
 test/v4l2_device/request_buffers.cpp  |   4 +-
 test/v4l2_device/stream_on_off.cpp    |   4 +-
 test/v4l2_device/v4l2_device_test.cpp |  12 +-
 test/v4l2_device/v4l2_device_test.h   |   2 -
 14 files changed, 289 insertions(+), 56 deletions(-)
 create mode 100644 test/v4l2_device/buffer_sharing.cpp