From patchwork Tue Apr 7 15:34:21 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 26476 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 BCEA9C32F8 for ; Tue, 7 Apr 2026 15:35:25 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3B3FF62E59; Tue, 7 Apr 2026 17:35:25 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="gySEpswz"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 48A2A62E4B for ; Tue, 7 Apr 2026 17:35:18 +0200 (CEST) Received: from killaraus.ideasonboard.com (2001-14ba-703d-e500--2a1.rev.dnainternet.fi [IPv6:2001:14ba:703d:e500::2a1]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 9E4F6596 for ; Tue, 7 Apr 2026 17:33:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1775576030; bh=e/qv440tTvCbF/J/ZNHuJhJUaMF+UoqbLP8keLi6D9I=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gySEpswzUJz9z+8EYBxTfyCFM1U/FzYsA7l3ROtu7IDSP8raVsq0PeC5jgEHsAmLG B9BahZgYA8diZrQnzK/YvvUbkTe3aJFZ91UXyk5HgkctxSsk1G2RGSlQYrrbkHmWL/ 02uPSSo4B4byER8VglNwhTq2gMsNywb6/H/Jp+J8= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Subject: [PATCH v2 36/42] libcamera: global_configuration: Drop Option type Date: Tue, 7 Apr 2026 18:34:21 +0300 Message-ID: <20260407153427.1825999-37-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260407153427.1825999-1-laurent.pinchart@ideasonboard.com> References: <20260407153427.1825999-1-laurent.pinchart@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" The GlobalConfiguration::Option type was introduced to decouple the configuration option storage from its users, and make changes to the underlying implementation easier. While the type could indeed be changed to map to a different class, the API would need to remain the same. The Option type therefore brings little value. Drop it. Signed-off-by: Laurent Pinchart --- include/libcamera/internal/global_configuration.h | 4 +--- src/libcamera/global_configuration.cpp | 10 +--------- src/libcamera/pipeline/simple/simple.cpp | 2 +- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/include/libcamera/internal/global_configuration.h b/include/libcamera/internal/global_configuration.h index 2c0bfadb4676..5eb646e33fc2 100644 --- a/include/libcamera/internal/global_configuration.h +++ b/include/libcamera/internal/global_configuration.h @@ -22,12 +22,10 @@ namespace libcamera { class GlobalConfiguration { public: - using Option = const ValueNode &; - GlobalConfiguration(); unsigned int version() const; - Option configuration() const; + const ValueNode &configuration() const; template std::optional option( diff --git a/src/libcamera/global_configuration.cpp b/src/libcamera/global_configuration.cpp index 4d154c026e44..cd9cc25e43fd 100644 --- a/src/libcamera/global_configuration.cpp +++ b/src/libcamera/global_configuration.cpp @@ -55,14 +55,6 @@ LOG_DEFINE_CATEGORY(Configuration) * options, or configuration() to access the whole configuration. */ -/** - * \typedef GlobalConfiguration::Option - * \brief Type representing a configuration option - * - * All code outside GlobalConfiguration must use this type declaration and not - * the underlying type. - */ - /** * \brief Initialize the global configuration */ @@ -158,7 +150,7 @@ unsigned int GlobalConfiguration::version() const * * \return The top-level configuration option */ -GlobalConfiguration::Option GlobalConfiguration::configuration() const +const ValueNode &GlobalConfiguration::configuration() const { return (*configuration_)["configuration"]; } diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp index 0aa5b1c5255a..c6fe12d65b18 100644 --- a/src/libcamera/pipeline/simple/simple.cpp +++ b/src/libcamera/pipeline/simple/simple.cpp @@ -1880,7 +1880,7 @@ bool SimplePipelineHandler::matchDevice(std::shared_ptr media, swIspEnabled_ = info.swIspEnabled; const GlobalConfiguration &configuration = cameraManager()->_d()->configuration(); - for (GlobalConfiguration::Option entry : + for (const ValueNode &entry : configuration.configuration()["pipelines"]["simple"]["supported_devices"] .asList()) { auto name = entry["driver"].get();