[libcamera-devel] [PATCH] pipeline: imx8-isi: Set SensorTimestamp metadata
Kieran Bingham
kieran.bingham at ideasonboard.com
Mon Nov 21 14:10:32 CET 2022
Quoting Laurent Pinchart via libcamera-devel (2022-11-20 17:20:30)
> Report the sensor timestamp in metadata. Use the timestamp from the
> first buffer. Accuracy could be improved by using the frame start event
> from the CSI-2 receiver, but the kernel driver doesn't support it yet.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> ---
> src/libcamera/pipeline/imx8-isi/imx8-isi.cpp | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp b/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp
> index a3dfd3fc529c..e51457ebc345 100644
> --- a/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp
> +++ b/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp
> @@ -994,6 +994,12 @@ void PipelineHandlerISI::bufferReady(FrameBuffer *buffer)
> {
> Request *request = buffer->request();
>
> + /* Record the sensor's timestamp in the request metadata. */
> + ControlList &metadata = request->metadata();
> + if (!metadata.contains(controls::SensorTimestamp.id()))
> + metadata.set(controls::SensorTimestamp,
> + buffer->metadata().timestamp);
> +
> completeBuffer(request, buffer);
> if (request->hasPendingBuffers())
> return;
> --
> Regards,
>
> Laurent Pinchart
>
More information about the libcamera-devel
mailing list