[{"id":32593,"web_url":"https://patchwork.libcamera.org/comment/32593/","msgid":"<173349975583.312267.10185427741612182090@ping.linuxembedded.co.uk>","date":"2024-12-06T15:42:35","subject":"Re: [PATCH 5/5] pipeline: rpi: vc4: Add wallclock timestamp support","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting David Plowman (2024-12-06 14:27:42)\n> Wallclocks are enabled for the unicam output, and the values returned\n> in frame metadata are made available to the base pipeline handler\n> class.\n> \n> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n> ---\n>  src/libcamera/pipeline/rpi/vc4/vc4.cpp | 4 ++++\n>  1 file changed, 4 insertions(+)\n> \n> diff --git a/src/libcamera/pipeline/rpi/vc4/vc4.cpp b/src/libcamera/pipeline/rpi/vc4/vc4.cpp\n> index fd8d84b1..eb98c56e 100644\n> --- a/src/libcamera/pipeline/rpi/vc4/vc4.cpp\n> +++ b/src/libcamera/pipeline/rpi/vc4/vc4.cpp\n> @@ -398,6 +398,9 @@ int PipelineHandlerVc4::platformRegister(std::unique_ptr<RPi::CameraData> &camer\n>                 Camera::create(std::move(cameraData), id, streams);\n>         PipelineHandler::registerCamera(std::move(camera));\n>  \n> +       /* Enable wall clock timestamps for the unicam output. */\n> +       data->unicam_[Unicam::Image].dev()->enableWallClock(&wallClockRecoery_);\n> +\n>         LOG(RPI, Info) << \"Registered camera \" << id\n>                        << \" to Unicam device \" << unicam->deviceNode()\n>                        << \" and ISP device \" << isp->deviceNode();\n> @@ -784,6 +787,7 @@ void Vc4CameraData::unicamBufferDequeue(FrameBuffer *buffer)\n>                  * as it does not receive the FrameBuffer object.\n>                  */\n>                 ctrl.set(controls::SensorTimestamp, buffer->metadata().timestamp);\n> +               ctrl.set(controls::FrameWallClock, buffer->metadata().wallClock);\n\nI think the only reason to have &wallClockRecovery_ object\nsupplied/instantiated by the Pipeline handler was so that at this line -\ninstead of accessing buffer->metadata().wallclock - it would use\n\n\tctrl.set(controls::FrameWallClock,\n\t\t wallClockRecovery_.getOutput(buffer->metadata().timestamp));\n\ninstead.\n\nBut (Have I said this yet?) Personally I would keep this as\n\n\n\t\tctrl.set(controls::FrameWallClock, buffer->metadata().wallClock);\n\nand have the wallClockRecovery_ as a 'feature' provided by the\nV4L2VideoDevice in a purely common way. It's not going to do anything\ndifferent on other pipeline handlers that would require customisation as\nfar as I can tell.\n\n--\nKieran\n\n\n>                 bayerQueue_.push({ buffer, std::move(ctrl), delayContext });\n>         } else {\n>                 embeddedQueue_.push(buffer);\n> -- \n> 2.39.5\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 730E5BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  6 Dec 2024 15:42:40 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AF86567E12;\n\tFri,  6 Dec 2024 16:42:39 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BD41F618B3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  6 Dec 2024 16:42:38 +0100 (CET)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3384374C;\n\tFri,  6 Dec 2024 16:42:09 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"qwvhlQAn\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1733499729;\n\tbh=GRsOeHoIpaivNERUaURkYFfgBpJAiKioQChSebKOFYs=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=qwvhlQAnJrpZ0W7qnMMQG7qtlcGlzmsmCQQI3MLuqUvQaW+U0HXgPnd4ENTW9tF0D\n\t0Vd5DlkHD/8Fo+QnL9WpMvYzbvKkbjnG5GVGAi0emg1VwGovJWhsEXCGNyY74c2Wdo\n\t/SUna2zKnHettzwsMJJtZn/xn3WFQye2U1jI3n/4=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20241206142742.7931-6-david.plowman@raspberrypi.com>","References":"<20241206142742.7931-1-david.plowman@raspberrypi.com>\n\t<20241206142742.7931-6-david.plowman@raspberrypi.com>","Subject":"Re: [PATCH 5/5] pipeline: rpi: vc4: Add wallclock timestamp support","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"David Plowman <david.plowman@raspberrypi.com>","To":"David Plowman <david.plowman@raspberrypi.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Fri, 06 Dec 2024 15:42:35 +0000","Message-ID":"<173349975583.312267.10185427741612182090@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]