[PATCH 5/5] pipeline: rpi: vc4: Add wallclock timestamp support
Kieran Bingham
kieran.bingham at ideasonboard.com
Fri Dec 6 16:42:35 CET 2024
Quoting David Plowman (2024-12-06 14:27:42)
> Wallclocks are enabled for the unicam output, and the values returned
> in frame metadata are made available to the base pipeline handler
> class.
>
> Signed-off-by: David Plowman <david.plowman at raspberrypi.com>
> ---
> src/libcamera/pipeline/rpi/vc4/vc4.cpp | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/src/libcamera/pipeline/rpi/vc4/vc4.cpp b/src/libcamera/pipeline/rpi/vc4/vc4.cpp
> index fd8d84b1..eb98c56e 100644
> --- a/src/libcamera/pipeline/rpi/vc4/vc4.cpp
> +++ b/src/libcamera/pipeline/rpi/vc4/vc4.cpp
> @@ -398,6 +398,9 @@ int PipelineHandlerVc4::platformRegister(std::unique_ptr<RPi::CameraData> &camer
> Camera::create(std::move(cameraData), id, streams);
> PipelineHandler::registerCamera(std::move(camera));
>
> + /* Enable wall clock timestamps for the unicam output. */
> + data->unicam_[Unicam::Image].dev()->enableWallClock(&wallClockRecoery_);
> +
> LOG(RPI, Info) << "Registered camera " << id
> << " to Unicam device " << unicam->deviceNode()
> << " and ISP device " << isp->deviceNode();
> @@ -784,6 +787,7 @@ void Vc4CameraData::unicamBufferDequeue(FrameBuffer *buffer)
> * as it does not receive the FrameBuffer object.
> */
> ctrl.set(controls::SensorTimestamp, buffer->metadata().timestamp);
> + ctrl.set(controls::FrameWallClock, buffer->metadata().wallClock);
I think the only reason to have &wallClockRecovery_ object
supplied/instantiated by the Pipeline handler was so that at this line -
instead of accessing buffer->metadata().wallclock - it would use
ctrl.set(controls::FrameWallClock,
wallClockRecovery_.getOutput(buffer->metadata().timestamp));
instead.
But (Have I said this yet?) Personally I would keep this as
ctrl.set(controls::FrameWallClock, buffer->metadata().wallClock);
and have the wallClockRecovery_ as a 'feature' provided by the
V4L2VideoDevice in a purely common way. It's not going to do anything
different on other pipeline handlers that would require customisation as
far as I can tell.
--
Kieran
> bayerQueue_.push({ buffer, std::move(ctrl), delayContext });
> } else {
> embeddedQueue_.push(buffer);
> --
> 2.39.5
>
More information about the libcamera-devel
mailing list