From patchwork Thu Apr 23 23:00:54 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 26554 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 4E0EFBDCB5 for ; Thu, 23 Apr 2026 23:02:05 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B574062FB7; Fri, 24 Apr 2026 01:02:04 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="cjghgjJn"; 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 5240362FD1 for ; Fri, 24 Apr 2026 01:01:45 +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 ESMTPSA id C15ED103F for ; Fri, 24 Apr 2026 01:00:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1776985205; bh=3SF+tBB3vleQvw6gacY2li+u7UTo/rNJT8YeOKI+U+k=; h=From:To:Subject:Date:In-Reply-To:References:From; b=cjghgjJnVWGlyAjrkXAz+3Ek3bvGTT3ZOo7NN0WhPyITqMMlfVoKm/9xwDMBOgYW3 cK2Qxx1S/gXVmOfaFyr+0oYdbsMXfUZwM4UUF01Kh1CJcNxqXVBvj6ejlyQl35NVJL loXgvegeoCgQzblEM8/0rVukNfpXvLOcqSdoEGqU= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Subject: [PATCH v3 32/37] libcamera: global_configuration: Populate empty configuration Date: Fri, 24 Apr 2026 02:00:54 +0300 Message-ID: <20260423230059.3180987-33-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260423230059.3180987-1-laurent.pinchart@ideasonboard.com> References: <20260423230059.3180987-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" If no configuration file can be parsed, populate an empty configuration. This will serve as a base to store the configuration options set through environment variables. Signed-off-by: Laurent Pinchart Reviewed-by: Barnabás Pőcze Reviewed-by: Isaac Scott --- Changes since v1: - Move code to constructor to cover all loadFile() calls --- src/libcamera/global_configuration.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libcamera/global_configuration.cpp b/src/libcamera/global_configuration.cpp index a70562614b12..62b9762d3e31 100644 --- a/src/libcamera/global_configuration.cpp +++ b/src/libcamera/global_configuration.cpp @@ -61,6 +61,11 @@ LOG_DEFINE_CATEGORY(Configuration) GlobalConfiguration::GlobalConfiguration() { load(); + + if (configuration_->isEmpty()) { + configuration_->add("version", std::make_unique(1)); + configuration_->add("configuration", std::make_unique()); + } } void GlobalConfiguration::load()