From patchwork Fri Jul 3 22:48:16 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Allen X-Patchwork-Id: 27198 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 389A8C330A for ; Fri, 3 Jul 2026 22:50:01 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 79FF465FC1; Sat, 4 Jul 2026 00:49:59 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=googlemail.com header.i=@googlemail.com header.b="PZOIs5XA"; dkim-atps=neutral Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 03A5A65FC1 for ; Sat, 4 Jul 2026 00:49:57 +0200 (CEST) Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-493b1710405so5912585e9.2 for ; Fri, 03 Jul 2026 15:49:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20251104; t=1783118996; x=1783723796; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dJS2lyOWBfoBNbBgM2SdI4CsiTkDw7Ch+iLzxHa5S2U=; b=PZOIs5XAhjW7Y+MZMrIftByZhOJfMGqdFbFZ06dtkqK3dLXFMD6VTiZfA05e1h3ylx juADF0l4RMxKyEFWB+Arat1/YD4Btoej+bJFF/8AmvrSGy5k2wONTVBub3dI02JK9kyM 5q6bedblNq6Sk83m0ndfx4rIXQtKFYvKObIjkVfPLde4y6nwchoruunVaf5LU0ruxtxY tgeygSJsA74iCGv/qYca/HTzSTnu+njYFoake37hgVF0SNnCiilAMK/vBQAW2OgwdcRO L6BcGTqMC5McAZDiDEwAbLsyPAtJwfTCxLAJ1QSIC/YgqJ9nN8ibCjaJb8AL0fRb460n PSRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783118996; x=1783723796; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=dJS2lyOWBfoBNbBgM2SdI4CsiTkDw7Ch+iLzxHa5S2U=; b=Vobl3bPiREpTaIXTlFKJF8n1kIudj2T7MWOPwYasbI4VIGyQN6oPKn41KzJJZLPACd X/gU0BGMjx5Wsk0mpy3ZLo30r79oA48w8GZj6P2HAFIQbHkLJbV3QFhFuXEPS0bt4No2 qbPM0SXbgJIsNwtCG/qCwcI2Z4QGUF43sTE9Or7Ekg+ZqHkQ1vWyPAUoa2pHMvnhpHgh Q0Ged9NW7M/SGT0db3LR6hk9We6X9khsZCjZ8sZeM+CCrg67OK4aKytdDqCBt9Ku/JAV PpCjfrha+9dtO8v9Pdvuo3edyq5PPceNCiwG1gMlZTCLyh3LfWu16Uigblb0Xgsw6hr6 xdfw== X-Gm-Message-State: AOJu0YxtY4xALHflDIcQ2DAz3PzQ14IQ+7WIwCgOCfoYjto3HWuyQKdn 2F5x52PuvGEUbEK3IXuY6RSgwNClCyphBFyZEfvFk0SL7/0vuhSM1WWg/vHjUrO2 X-Gm-Gg: AfdE7cnfCzCEwqNghWZTCVdsodw4Ma86uF4LDpyMPl80n6xFRtMo1Y8Yrlm/NnOWzsQ DlKi89yfm7QiArJXV21keZwhWnulHNS+X0ULtZcIzerYmIAeAd7nFsrcGyWZqGXNe8JHMPAadZf 0yQZxiQeu5/k+Jm38WuMTxEL2wIt9bRVc1XyMPifB5sEz1alozIxmkReolT0LJOcEluZSfzyoU/ LCuS7ukGR1SkAcUMBeIWPu/hqdYx4bmx/FuEc9o0nRQsGs/kpYCXolQR5py9JgVf25O5+3HbD7y lS8SBwa2a49RaLDXffjwDaKb6mrvfce8rv1JgzA9Unho0qkx9uJ7TUlJIyX7zxDznvqoM8PigJI ZbsjQwSoHrlVSQtfNVfPRQpJSoX6Uoa1qMgnA0OXA60RcNSjzah/ayUnOdOHPitD2YKhphsW+se gtvIjx0ys7TitL/SR7SgcqWOE6EtTx+tXON/KzJ1MAY4PHMO5mMi0dyJ/rBsxsoie8uDDBX68Mp d1J3wBCNTM= X-Received: by 2002:a05:600c:6287:b0:490:e5c1:b8b9 with SMTP id 5b1f17b1804b1-493d1188014mr11954295e9.0.1783118996318; Fri, 03 Jul 2026 15:49:56 -0700 (PDT) Received: from localhost.localdomain (tmo-121-138.customers.d1-online.com. [80.187.121.138]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-493c63ba971sm255611285e9.13.2026.07.03.15.49.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jul 2026 15:49:55 -0700 (PDT) From: Bruce Allen To: libcamera-devel@lists.libcamera.org Cc: Bruce Allen Subject: [PATCH v2 1/2] libcamera: Add SensorSequence metadata control Date: Fri, 3 Jul 2026 23:48:16 +0100 Message-ID: <20260703224817.15650-2-ballen4705@googlemail.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260703224817.15650-1-ballen4705@googlemail.com> References: <20260626003712.26624-1-ballen4705@googlemail.com> <20260703224817.15650-1-ballen4705@googlemail.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add controls::SensorSequence (int64_t, out) to report the monotonic sequence number from the sensor-facing capture device in request metadata. Populate the control in all pipeline handlers that already report SensorTimestamp. Signed-off-by: Bruce Allen --- src/libcamera/control_ids_core.yaml | 18 ++++++++++++++++++ src/libcamera/pipeline/imx8-isi/imx8-isi.cpp | 3 +++ src/libcamera/pipeline/ipu3/ipu3.cpp | 2 ++ src/libcamera/pipeline/mali-c55/mali-c55.cpp | 2 ++ src/libcamera/pipeline/rkisp1/rkisp1.cpp | 2 ++ src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 2 ++ src/libcamera/pipeline/rpi/pisp/pisp.cpp | 2 ++ src/libcamera/pipeline/rpi/vc4/vc4.cpp | 2 ++ src/libcamera/pipeline/simple/simple.cpp | 5 ++++- src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 2 ++ src/libcamera/pipeline/vimc/vimc.cpp | 2 ++ 11 files changed, 41 insertions(+), 1 deletion(-) diff --git a/src/libcamera/control_ids_core.yaml b/src/libcamera/control_ids_core.yaml index 89991d0..d6bc114 100644 --- a/src/libcamera/control_ids_core.yaml +++ b/src/libcamera/control_ids_core.yaml @@ -792,6 +792,24 @@ controls: \todo Define how the sensor timestamp has to be used in the reprocessing use case. + - SensorSequence: + type: int64_t + direction: out + description: | + The monotonic sequence number from the sensor capture device. + + Pipeline handlers populate this metadata control with the sequence + number reported by the sensor-facing capture device (for example the + CSI-2 receiver or V4L2 video node). Any break in this sequence number + indicates that frames were dropped or not captured before the previous + request completed. + + While per-buffer FrameMetadata::sequence identifies frames in each + completed stream, SensorSequence reflects the sensor-side capture path + and is intended for diagnosing frame continuity. + + The SensorSequence control can only be returned in metadata. + - AfMode: type: int32_t direction: inout diff --git a/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp b/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp index c3d2695..d2175b9 100644 --- a/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp +++ b/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp @@ -1130,6 +1130,9 @@ void PipelineHandlerISI::bufferReady(FrameBuffer *buffer) if (!metadata.contains(controls::SensorTimestamp.id())) metadata.set(controls::SensorTimestamp, buffer->metadata().timestamp); + if (!metadata.contains(controls::SensorSequence.id())) + metadata.set(controls::SensorSequence, + static_cast(buffer->metadata().sequence)); if (completeBuffer(request, buffer)) completeRequest(request); diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 0f3e169..6494259 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -1317,6 +1317,8 @@ void IPU3CameraData::cio2BufferReady(FrameBuffer *buffer) */ request->_d()->metadata().set(controls::SensorTimestamp, buffer->metadata().timestamp); + request->_d()->metadata().set(controls::SensorSequence, + static_cast(buffer->metadata().sequence)); info->effectiveSensorControls = delayedCtrls_->get(buffer->metadata().sequence); diff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp index 599ff88..119b249 100644 --- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp +++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp @@ -1704,6 +1704,8 @@ void PipelineHandlerMaliC55::cruBufferReady(FrameBuffer *buffer) Request *request = info->request; request->_d()->metadata().set(controls::SensorTimestamp, buffer->metadata().timestamp); + request->_d()->metadata().set(controls::SensorSequence, + static_cast(buffer->metadata().sequence)); MaliC55CameraData *data = cameraData(request->_d()->camera()); data->ipa_->fillParams(request->sequence(), info->paramBuffer->cookie()); diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index 4f9c0aa..0c73f5a 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -1647,6 +1647,8 @@ void PipelineHandlerRkISP1::imageBufferReady(FrameBuffer *buffer) */ request->_d()->metadata().set(controls::SensorTimestamp, metadata.timestamp); + request->_d()->metadata().set(controls::SensorSequence, + static_cast(metadata.sequence)); if (isRaw_) { const ControlList &ctrls = diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp index 5a5acf6..dcf8e6a 100644 --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp @@ -1514,6 +1514,8 @@ void CameraData::fillRequestMetadata(const ControlList &bufferControls, Request { if (auto x = bufferControls.get(controls::SensorTimestamp)) request->_d()->metadata().set(controls::SensorTimestamp, *x); + if (auto x = bufferControls.get(controls::SensorSequence)) + request->_d()->metadata().set(controls::SensorSequence, *x); if (auto x = bufferControls.get(controls::FrameWallClock)) request->_d()->metadata().set(controls::FrameWallClock, *x); diff --git a/src/libcamera/pipeline/rpi/pisp/pisp.cpp b/src/libcamera/pipeline/rpi/pisp/pisp.cpp index b744c90..0832432 100644 --- a/src/libcamera/pipeline/rpi/pisp/pisp.cpp +++ b/src/libcamera/pipeline/rpi/pisp/pisp.cpp @@ -1766,6 +1766,8 @@ void PiSPCameraData::cfeBufferDequeue(FrameBuffer *buffer) ctrl.set(controls::SensorTimestamp, sensorTimestamp); ctrl.set(controls::FrameWallClock, wallClockTimestamp); + ctrl.set(controls::SensorSequence, + static_cast(buffer->metadata().sequence)); job.sensorControls = std::move(ctrl); job.delayContext = delayContext; } else if (stream == &cfe_[Cfe::Config]) { diff --git a/src/libcamera/pipeline/rpi/vc4/vc4.cpp b/src/libcamera/pipeline/rpi/vc4/vc4.cpp index 3e9a490..1e7b26a 100644 --- a/src/libcamera/pipeline/rpi/vc4/vc4.cpp +++ b/src/libcamera/pipeline/rpi/vc4/vc4.cpp @@ -787,6 +787,8 @@ void Vc4CameraData::unicamBufferDequeue(FrameBuffer *buffer) ctrl.set(controls::SensorTimestamp, sensorTimestamp); ctrl.set(controls::FrameWallClock, wallClockTimestamp); + ctrl.set(controls::SensorSequence, + static_cast(buffer->metadata().sequence)); bayerQueue_.push({ buffer, std::move(ctrl), delayContext }); } else { embeddedQueue_.push(buffer); diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp index e26f438..ce34bb2 100644 --- a/src/libcamera/pipeline/simple/simple.cpp +++ b/src/libcamera/pipeline/simple/simple.cpp @@ -939,9 +939,12 @@ void SimpleCameraData::imageBufferReady(FrameBuffer *buffer) } } - if (request) + if (request) { request->_d()->metadata().set(controls::SensorTimestamp, buffer->metadata().timestamp); + request->_d()->metadata().set(controls::SensorSequence, + static_cast(buffer->metadata().sequence)); + } /* * Queue the captured and the request buffer to the converter or Software diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp index 3435a76..e0b7dad 100644 --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp @@ -897,6 +897,8 @@ void UVCCameraData::imageBufferReady(FrameBuffer *buffer) /* \todo Use the UVC metadata to calculate a more precise timestamp */ request->_d()->metadata().set(controls::SensorTimestamp, buffer->metadata().timestamp); + request->_d()->metadata().set(controls::SensorSequence, + static_cast(buffer->metadata().sequence)); pipe()->completeBuffer(request, buffer); pipe()->completeRequest(request); diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp index 01d8fb2..ff809a1 100644 --- a/src/libcamera/pipeline/vimc/vimc.cpp +++ b/src/libcamera/pipeline/vimc/vimc.cpp @@ -617,6 +617,8 @@ void VimcCameraData::imageBufferReady(FrameBuffer *buffer) /* Record the sensor's timestamp in the request metadata. */ request->_d()->metadata().set(controls::SensorTimestamp, buffer->metadata().timestamp); + request->_d()->metadata().set(controls::SensorSequence, + static_cast(buffer->metadata().sequence)); pipe->completeBuffer(request, buffer); pipe->completeRequest(request); From patchwork Fri Jul 3 22:48:17 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Allen X-Patchwork-Id: 27199 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id DA6B3C3308 for ; Fri, 3 Jul 2026 22:50:02 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 32E0E65FE9; Sat, 4 Jul 2026 00:50:01 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=googlemail.com header.i=@googlemail.com header.b="i4YItvlC"; dkim-atps=neutral Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 277F065FB5 for ; Sat, 4 Jul 2026 00:49:58 +0200 (CEST) Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-493c7902f47so6486685e9.1 for ; Fri, 03 Jul 2026 15:49:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20251104; t=1783118997; x=1783723797; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=X5E9jgqo5PelCrftwdDhW9a7ZzIqhrOuJ9XfjBwJ+aw=; b=i4YItvlCXpuLUm39CIjeg/YAsCoHEsn6To2xadXyytVSMoDhDzyKrgkrDhKlACV7Br LEgOfpXVzjUJ3qBSySSWH9vpl3mgG84JF9EcFhfL8egi+pfo7Aq1HLf/+nCcHlRnP6Bn j6f/trvjibyCBWUkUglrgvMfzwYc7jDaYLDRfEIEbCT5GaNWaDXrE93DlEMh+ou5WVry Y65ZPaNERnNE+4Exi4bLZIUJL0ZC8ADQuUpUSJ2T0P1wK2Vo9Zg6/9NjPo2K8WujOCpE MPRcyPnwYMOwgxhfDfKNnswiX0fLxd/9Io8VyB+b3LKHgLCMAOYL/FBHZxfDLydzXaVP ZyUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783118997; x=1783723797; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=X5E9jgqo5PelCrftwdDhW9a7ZzIqhrOuJ9XfjBwJ+aw=; b=p+6TsaFtdZ6I1KdAiae5EfEJXg2h3UZyNQm3RRfktB4zvmf2R09CshQ95oeU375Ee8 LBk2nurhyv21Dmk1wdHB8dIb4s2hvmdgPNF4t9FBUNNUr2V2uzTgM6B/O8a+Vzysjayz Wi/hLAmDSTbGEhUtWv5/mj3mFEEf9Rc1o+AqXLFoY8avg8FlEnCxGr/LTlAP25f0ZCTH iw8Hi/DGu3AearGbpB74uWtZR/VAfpnHkk/egGTHRdHyBFARcCol23tJzpeFVxABQ3Pa ytoTXRqTc2lsASmYSobI2aXD8OBp7wzCagRxatjW6aXRUKBybx4lmth124yD7hHQ8jLm fgGA== X-Gm-Message-State: AOJu0YzPWSXQVHb99ZpHJFp2nErbqZroYQ3rQJ+9cV/wRrgJVwf7SE0M 69lR83PMRm8hsTrwPRTVWRWo0zK1CoXqfU4xLZLIScl28bNwTd0aibEch5YppLDk X-Gm-Gg: AfdE7cnR9xgTC27xrSHoaS7rAhEd2Bb28kmYchkqMsM6j2hFrnznc6LgS/jKIQj2yFI gbZkaSwiuj2vT0fL7JC6QvoJAqABC5lp7aO9Z5HN2ncKzR7d05sJtnchMiekBoDSb/Zeje2FXTE A0hyeT7GvRiDR3XGQxisTk5l/plYqFczpObt1WdPz097U1K7j6+VPV4yG+pAe5ZV20JCmENen/T tpaidy1a29HabjSLISMjqHO01j7ICyL4FVvsM7OmffNNT0Og2uIZGdU5RRbp+S1sbFnNGMQ+DAd 270YekTzeumi157EaSli8iH8Nxzij6qpZprDXcUTBMo2R04DESFxAEUSp7VOGxCknbVdPYr8Rlq LmNzRyVnBQoZBRrV63DBxYYY7b8QxRa31tfgFfwvaa7sAHffUSm/+twbeQvHB4cg9DnRg6m1gUu lu3pPAHwQ4FlDY3mulI9Y+4R0XKgNqMEQxQ/9TSuh37kxv885HMYAZnd6I16LgK+e2xMcosoHcS shcc0ZN6L0= X-Received: by 2002:a05:600c:c16e:b0:493:c068:db11 with SMTP id 5b1f17b1804b1-493d11f7ccamr10181815e9.26.1783118997392; Fri, 03 Jul 2026 15:49:57 -0700 (PDT) Received: from localhost.localdomain (tmo-121-138.customers.d1-online.com. [80.187.121.138]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-493c63ba971sm255611285e9.13.2026.07.03.15.49.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jul 2026 15:49:57 -0700 (PDT) From: Bruce Allen To: libcamera-devel@lists.libcamera.org Cc: Bruce Allen Subject: [PATCH v2 2/2] docs: Document SensorSequence request metadata Date: Fri, 3 Jul 2026 23:48:17 +0100 Message-ID: <20260703224817.15650-3-ballen4705@googlemail.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260703224817.15650-1-ballen4705@googlemail.com> References: <20260626003712.26624-1-ballen4705@googlemail.com> <20260703224817.15650-1-ballen4705@googlemail.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Describe how applications read SensorSequence from Request::metadata() and how it differs from per-buffer FrameMetadata::sequence. Signed-off-by: Bruce Allen --- Documentation/guides/application-developer.rst | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Documentation/guides/application-developer.rst b/Documentation/guides/application-developer.rst index a9620ca..77b4135 100644 --- a/Documentation/guides/application-developer.rst +++ b/Documentation/guides/application-developer.rst @@ -469,6 +469,32 @@ and the bytes used by planes. seq: 000040 bytesused: 1843200 seq: 000042 bytesused: 1843200 +Request metadata +~~~~~~~~~~~~~~~~ + +Completed requests also expose metadata as a :doxy-pub:`ControlList` through +:doxy-pub:`Request::metadata()`. Pipeline handlers populate this list with +controls defined as ``direction: out`` in the control definition YAML files. + +Common entries include :doxy-pub:`controls::SensorTimestamp`, +:doxy-pub:`controls::FrameWallClock`, and :doxy-pub:`controls::SensorSequence`. +The latter reports the sequence number from the sensor-facing capture device +(for example the CSI-2 receiver or V4L2 video node) for the frame associated +with the request. + +While per-buffer :doxy-pub:`FrameMetadata::sequence` identifies frames in each +completed stream, ``SensorSequence`` reflects the sensor-side capture path. If +the value increases by more than one between consecutive completed requests, +frames were not captured before the earlier request finished. This complements +sequence numbers derived from request delivery and is intended for diagnosing +frame continuity. + +.. code:: cpp + + const ControlList &metadata = request->metadata(); + if (auto seq = metadata.get(controls::SensorSequence)) + std::cout << " sensor sequence: " << *seq << std::endl; + A completed buffer contains of course image data which can be accessed through the per-plane dma-buf file descriptor transported by the ``FrameBuffer`` instance. An example of how to write image data to disk is available in the