[libcamera-devel] [PATCH v3 06/16] libcamera: uvc: Report sensor timestamp

Jacopo Mondi jacopo at jmondi.org
Wed Apr 21 18:03:09 CEST 2021


Report the sensor's timestamp in the Request metadata using the
completed buffer timestamp.

The UVC driver reports timestamps of SOE event through metadata, for
which there is no support in the current pipeline implementation.

Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
---
 src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp
index b6c6ade5ebaf..faa8d6b05f46 100644
--- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp
+++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp
@@ -662,6 +662,10 @@ void UVCCameraData::bufferReady(FrameBuffer *buffer)
 {
 	Request *request = buffer->request();
 
+	/* \todo Use the UVC metadata to calculate a more precise timestamp */
+	request->metadata().set(controls::SensorTimestamp,
+				buffer->metadata().timestamp);
+
 	pipe_->completeBuffer(request, buffer);
 	pipe_->completeRequest(request);
 }
-- 
2.31.1



More information about the libcamera-devel mailing list