From 787c90027c4c9bcbe455030dff3f454f1999038e Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Sun, 18 Apr 2021 16:16:42 +0200 Subject: libcamera: vimc: Report sensor timestamp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Report the sensor's timestamp in the Request metadata using the completed buffer timestamp. The buffer's timestamp reports the video capture buffer processing time, and it does not theoretically matches the 'start of exposure' definition. VIMC being a testing platform and the test driver completes the buffers for each media entity connected in the pipeline one after the other, the current solution is acceptable for the pipeline. Reviewed-by: Hirokazu Honda Reviewed-by: Niklas Söderlund Reviewed-by: Laurent Pinchart Signed-off-by: Jacopo Mondi --- src/libcamera/pipeline/vimc/vimc.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/libcamera/pipeline') diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp index 8f5f4ba3..ce83dcaa 100644 --- a/src/libcamera/pipeline/vimc/vimc.cpp +++ b/src/libcamera/pipeline/vimc/vimc.cpp @@ -523,6 +523,10 @@ void VimcCameraData::bufferReady(FrameBuffer *buffer) { Request *request = buffer->request(); + /* Record the sensor's timestamp in the request metadata. */ + request->metadata().set(controls::SensorTimestamp, + buffer->metadata().timestamp); + pipe_->completeBuffer(request, buffer); pipe_->completeRequest(request); } -- cgit v1.2.1