{"id":23779,"url":"https://patchwork.libcamera.org/api/1.1/patches/23779/?format=json","web_url":"https://patchwork.libcamera.org/patch/23779/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20250710144316.601640-1-barnabas.pocze@ideasonboard.com>","date":"2025-07-10T14:43:16","name":"[v1] libcamera: pipeline: rpi: Do not set timestamps to 0 if unavailable","commit_ref":"1ef8981c3931f1df00e478b25d535306be1a2f6a","pull_url":null,"state":"accepted","archived":false,"hash":"3cbc9939caf5c084db89cb7e124b8df54e78ed7d","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/1.1/people/216/?format=json","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/23779/mbox/","series":[{"id":5280,"url":"https://patchwork.libcamera.org/api/1.1/series/5280/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5280","date":"2025-07-10T14:43:16","name":"[v1] libcamera: pipeline: rpi: Do not set timestamps to 0 if unavailable","version":1,"mbox":"https://patchwork.libcamera.org/series/5280/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/23779/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/23779/checks/","tags":{},"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 8144CC3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 10 Jul 2025 14:43:23 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8E25668F03;\n\tThu, 10 Jul 2025 16:43:22 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id F26DD68EE7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 10 Jul 2025 16:43:20 +0200 (CEST)","from pb-laptop.local (185.221.140.39.nat.pool.zt.hu\n\t[185.221.140.39])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C4C57B2B;\n\tThu, 10 Jul 2025 16:42:51 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"HXMfEfBz\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1752158571;\n\tbh=zvg3mBHVucwtnoiNfmswx4MMnJ38zAXw8ZF+CYjqll4=;\n\th=From:To:Subject:Date:From;\n\tb=HXMfEfBzWmUrZRYv8YbHHIZv8hOAlm41YF+5cJytZ0LMPuTDHMEAQOoWOSnu1ADM7\n\teU79XKC21fv+zrjrMW860kX5+32HLTDhPRzGYWxTHRfFPxRYKsy4R29UNxKu3wWXPU\n\tgjc6gtvgVK97LRVYcSw3oGArneX00EtXXcUIuKPo=","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org,\n\tDavid Plowman <david.plowman@raspberrypi.com>,\n\tNaushir Patuck <naush@raspberrypi.com>","Subject":"[PATCH v1] libcamera: pipeline: rpi: Do not set timestamps to 0 if\n\tunavailable","Date":"Thu, 10 Jul 2025 16:43:16 +0200","Message-ID":"<20250710144316.601640-1-barnabas.pocze@ideasonboard.com>","X-Mailer":"git-send-email 2.50.0","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","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>"},"content":"`SensorTimestamp` and `FrameWallClock` should always be available. However,\nif that ever changes or they are not available for some unforeseen reason,\nsetting them to 0 is not ideal. That makes it more complicated for the\napplication to detect these cases (since they have to check the existence\neither way), and if an application blindly assumes e.g. that `SensorTimestamp`\nis monotonically increasing, then receiving a timestamp of 0 will likely\ncause issues.\n\nSo simply omit them from the request metadata if they are not available.\n\nSigned-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n---\n src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\nindex eafe94427..563df198e 100644\n--- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n+++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n@@ -1487,10 +1487,10 @@ void CameraData::checkRequestCompleted()\n \n void CameraData::fillRequestMetadata(const ControlList &bufferControls, Request *request)\n {\n-\trequest->metadata().set(controls::SensorTimestamp,\n-\t\t\t\tbufferControls.get(controls::SensorTimestamp).value_or(0));\n-\trequest->metadata().set(controls::FrameWallClock,\n-\t\t\t\tbufferControls.get(controls::FrameWallClock).value_or(0));\n+\tif (auto x = bufferControls.get(controls::SensorTimestamp))\n+\t\trequest->metadata().set(controls::SensorTimestamp, *x);\n+\tif (auto x = bufferControls.get(controls::FrameWallClock))\n+\t\trequest->metadata().set(controls::FrameWallClock, *x);\n \n \tif (cropParams_.size()) {\n \t\tstd::vector<Rectangle> crops;\n","prefixes":["v1"]}