summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2021-04-18 16:16:42 +0200
committerJacopo Mondi <jacopo@jmondi.org>2021-05-06 15:09:18 +0200
commit787c90027c4c9bcbe455030dff3f454f1999038e (patch)
tree6b5538fc54d447e28aead567dcaf6176c6416e61
parent922833f774f69b9c7b378379bfa6770ff0380a1a (diff)
libcamera: vimc: Report sensor timestamp
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 <hiroh@chromium.org> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
-rw-r--r--src/libcamera/pipeline/vimc/vimc.cpp4
1 files changed, 4 insertions, 0 deletions
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);
}