summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline/uvcvideo
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2021-04-16 11:25:32 +0200
committerJacopo Mondi <jacopo@jmondi.org>2021-05-06 15:08:56 +0200
commitae342991dc6ac4a68893024686da30f93d12ed9e (patch)
treebe119dcf27df7bd954abbd42125e14f5428536e4 /src/libcamera/pipeline/uvcvideo
parentd9a68af06d7952089c8d00f6b3dc834c678fc16a (diff)
libcamera: uvc: Report sensor timestamp
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: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/libcamera/pipeline/uvcvideo')
-rw-r--r--src/libcamera/pipeline/uvcvideo/uvcvideo.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp
index b6c6ade5..faa8d6b0 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);
}