From patchwork Thu Oct 30 16:58:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 24914 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 01D93C32CE for ; Thu, 30 Oct 2025 16:58:41 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 906EE6098E; Thu, 30 Oct 2025 17:58:40 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="ZE2GtRmi"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1A7EA60947 for ; Thu, 30 Oct 2025 17:58:24 +0100 (CET) Received: from pb-laptop.local (185.221.140.239.nat.pool.zt.hu [185.221.140.239]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E993918E5; Thu, 30 Oct 2025 17:56:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1761843394; bh=SuOPzvKn2H326C+sircC2A8eH3QDwVNrhhGo1tYDfeQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZE2GtRmi+job4rNhcPSbjfGjiUBvRdKWHm7EbM5Lx6xaBywkb6do5325slZBKQXai myytAWtN+Zhnt24KTnHwE/P5FVLAizn98ffeyo29rbautMSX6uhcIuUk+io7NPA0NU M/K7nwTIvVTXhSERH+Li69/S0+7lGap5d6Xy/jqo= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Cc: Jacopo Mondi , Paul Elder Subject: [RFC PATCH v3 11/22] libcamera: request: Store `MetadataList` Date: Thu, 30 Oct 2025 17:58:05 +0100 Message-ID: <20251030165816.1095180-12-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251030165816.1095180-1-barnabas.pocze@ideasonboard.com> References: <20251030165816.1095180-1-barnabas.pocze@ideasonboard.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 a `MetadataList` to the `Request` object to store the metadata items returned by the camera. The metadata list is initialized using the camera's `MetadataListPlan` object, which is supposed to be filled by the pipeline handlers. This new list is exposed as `metadata2`, and the old `ControlList` is still present for now. Signed-off-by: Barnabás Pőcze Reviewed-by: Jacopo Mondi Reviewed-by: Paul Elder --- include/libcamera/request.h | 5 +++++ src/libcamera/request.cpp | 2 ++ 2 files changed, 7 insertions(+) diff --git a/include/libcamera/request.h b/include/libcamera/request.h index 0c5939f7b3..23e7bde72c 100644 --- a/include/libcamera/request.h +++ b/include/libcamera/request.h @@ -18,6 +18,7 @@ #include #include +#include namespace libcamera { @@ -51,6 +52,9 @@ public: ControlList &controls() { return *controls_; } ControlList &metadata() { return *metadata_; } +#ifndef __DOXYGEN__ + [[nodiscard]] MetadataList &metadata2() { return metadata2_; } +#endif const BufferMap &buffers() const { return bufferMap_; } int addBuffer(const Stream *stream, FrameBuffer *buffer, std::unique_ptr &&fence = {}); @@ -69,6 +73,7 @@ private: ControlList *controls_; ControlList *metadata_; + MetadataList metadata2_; BufferMap bufferMap_; const uint64_t cookie_; diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp index 992d476e09..0ff465e6f7 100644 --- a/src/libcamera/request.cpp +++ b/src/libcamera/request.cpp @@ -357,6 +357,7 @@ void Request::Private::timeout() */ Request::Request(Camera *camera, uint64_t cookie) : Extensible(std::make_unique(camera)), + metadata2_(camera->_d()->metadataPlan_), cookie_(cookie), status_(RequestPending) { controls_ = new ControlList(controls::controls, @@ -410,6 +411,7 @@ void Request::reuse(ReuseFlag flags) controls_->clear(); metadata_->clear(); + metadata2_.clear(); } /**