[libcamera-devel] [RFC PATCH v2 0/5] Add UVC Metadata buffer timestamp support

Gabby George gabbymg94 at gmail.com
Mon Aug 21 15:10:34 CEST 2023

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

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   |   3 +-
 src/libcamera/mapped_framebuffer.cpp          |  20 +-
 src/libcamera/pipeline/uvcvideo/uvcvideo.cpp  | 306 +++++++++++++++++-
 src/libcamera/v4l2_videodevice.cpp            |  31 +-
 4 files changed, 336 insertions(+), 24 deletions(-)


More information about the libcamera-devel mailing list