[libcamera-devel,RFC,0/5] RFC:Add UVC Metadata buffer timestamp support
mbox series

Message ID 20230814112849.176943-1-gabbymg94@gmail.com
Headers show
Series
  • RFC:Add UVC Metadata buffer timestamp support
Related show

Message

Gabrielle George Aug. 14, 2023, 11:28 a.m. UTC
This series proposes to increase the accuracy of reported uvc
timestamps by using timestamps recorded in UVC's header data, rather
than the default timestamps libcamera samples from the kernel. When
metadata device nodes are not available, the default timestamp is
used.

Metadata headers are exposed through a v4l2 device node.  This device
node can largely be handled the same way as for video streaming
nodes. The uvcvideo pipeline handler manages this metadata node
alongside the video stream's V4L2VideoDevice. The metadata stream's
initialization, buffer allocation, conversion of the device's
timestamp into kernel clock time, and cleanup are all done within the
uvcvideo pipeline handler and not exposed to the user.

Known issues: When device framerate drops, the metadata stream will
cease and the pipeline will not finish correctly.

There will be another patch for calculating accurate timestamp based
on the metadata contents.

Gabby George (5):
  libcamera: pipeline: uvcvideo: Add UVC metadata node
  libcamera: MappedFrameBuffer: Use stored plane offset
  libcamera: v4l2 device: Store buffer info in planes
  libcamera: pipeline: uvcvideo: Allocate metadata buffers
  libcamera: pipeline: uvcvideo: Handle metadata stream

 .../libcamera/internal/mapped_framebuffer.h   |   2 +-
 src/libcamera/mapped_framebuffer.cpp          |  16 +-
 src/libcamera/pipeline/uvcvideo/uvcvideo.cpp  | 286 +++++++++++++++++-
 src/libcamera/v4l2_videodevice.cpp            |  32 +-
 4 files changed, 314 insertions(+), 22 deletions(-)