From patchwork Wed Jan 7 19:36:03 2026 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: 25683 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 E46EABDCBF for ; Wed, 7 Jan 2026 19:36:18 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8043E61FBB; Wed, 7 Jan 2026 20:36:16 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="cOpMNq7/"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7BE1861FA0 for ; Wed, 7 Jan 2026 20:36:13 +0100 (CET) Received: from pb-laptop.local (185.221.143.114.nat.pool.zt.hu [185.221.143.114]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 906C21127; Wed, 7 Jan 2026 20:35:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1767814551; bh=jf6DTaOQ1YuPzEP8CZJ2Aem6gnNitU8qUPalqNaCarY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cOpMNq7/lAmUT8u3DLiNyFUDgD8/j9CO89QOPAwiuXc9SMoyp/p3Pm3pf9c1rtrOu ACl8bwiet8IrwTRevMQ7fky/G6YMSBr4XG6eDsWRNFTVJyu+6j0bzPpmYzke4bGoc0 U55o0ajXNmCCDnWenXwrHYedz+MY8LdgYA57rtYo= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck Subject: [RFC PATCH v1 1/5] gstreamer: Add `-Wno-volatile` for GCC Date: Wed, 7 Jan 2026 20:36:03 +0100 Message-ID: <20260107193607.2168539-2-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260107193607.2168539-1-barnabas.pocze@ideasonboard.com> References: <20260107193607.2168539-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" Older versions of glib may use `volatile` qualified variables, triggering the warning in C++20. So suppress it. Link: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719 Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart --- src/gstreamer/meson.build | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gstreamer/meson.build b/src/gstreamer/meson.build index fd83e073d..602f978e8 100644 --- a/src/gstreamer/meson.build +++ b/src/gstreamer/meson.build @@ -50,6 +50,13 @@ if cc.get_id() == 'clang' and glib_dep.version().version_compare('<2.63.0') libcamera_gst_cpp_args += ['-Wno-unused-function'] endif +# In C++20 many operations involving the `volatile` qualifier became deprecated. +# glib however made use of `volatile` in certain macros that would trigger +# this warning. See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719. +if cc.get_id() == 'gcc' and glib_dep.version().version_compare('<2.67.1') + libcamera_gst_cpp_args += ['-Wno-volatile'] +endif + libcamera_gst = shared_library('gstlibcamera', libcamera_gst_sources, cpp_args : libcamera_gst_cpp_args, From patchwork Wed Jan 7 19:36:04 2026 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: 25684 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 0C7AEC323E for ; Wed, 7 Jan 2026 19:36:20 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 00C5961FC1; Wed, 7 Jan 2026 20:36:17 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="cjnj7+rc"; 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 982A261FA3 for ; Wed, 7 Jan 2026 20:36:13 +0100 (CET) Received: from pb-laptop.local (185.221.143.114.nat.pool.zt.hu [185.221.143.114]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C83E417EB; Wed, 7 Jan 2026 20:35:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1767814551; bh=PJADmIcMVYSsK4UjaXq88z8n4mzdxSyj+P696Zi1wz8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cjnj7+rcR1eYOh0AKP8o23NiU1NI/CUszN8vD3xjy7yDUJAtkrY32r4ZlP1mWvkxg A7tRj/ilBjAH+zxxHCN4wMa8+b4dClxDsLTIA+KkIlSn9dNQ2ctEVt3qL2AZG0lsdo 24zwoTxlegJs8rqxOddSy7tr3rJHfRX3pIJOUZ2U= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck Subject: [RFC PATCH v1 2/5] meson: Ignore `Wredundant-move` with GCC 11 and above Date: Wed, 7 Jan 2026 20:36:04 +0100 Message-ID: <20260107193607.2168539-3-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260107193607.2168539-1-barnabas.pocze@ideasonboard.com> References: <20260107193607.2168539-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" In C++20 mode, object slicing in a return statement triggers automatic move since GCC 11, and using `std::move()` emits `-Wredundant-move` in those same GCC versions. So disable the warning in those as well. This is relevant for `valueOrTuple()` in `py_helpers.cpp`, which returns a `py::tuple` as `py::object`. Signed-off-by: Barnabás Pőcze --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 4aa7ecc96..1d8e1d994 100644 --- a/meson.build +++ b/meson.build @@ -168,7 +168,7 @@ if cc.get_id() == 'gcc' # disable the warning. With -Wpessimizing-move enabled, the compiler will # still warn of pessimizing moves, only the redundant but not pessimizing # moves will be ignored. - if cc.version().version_compare('>=13') + if cc.version().version_compare('>=11') cpp_arguments += [ '-Wno-redundant-move', ] From patchwork Wed Jan 7 19:36:05 2026 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: 25685 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 8D4D8BDCBF for ; Wed, 7 Jan 2026 19:36:20 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8C33C61FC7; Wed, 7 Jan 2026 20:36:17 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="MOS3ZdUv"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D1AD061FBB for ; Wed, 7 Jan 2026 20:36:13 +0100 (CET) Received: from pb-laptop.local (185.221.143.114.nat.pool.zt.hu [185.221.143.114]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 06D5A180F; Wed, 7 Jan 2026 20:35:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1767814552; bh=vvfwxztFIEYLUbdWq+BvDLroLOUqJalhjOohUNL/AzQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MOS3ZdUvb4kJOX1uQTccHckfKnskwCSdOSRMqvLuk7DxbPL6KdXES3FuNxg5wc6MG 2WvLAovkD0WiayYQ4cL7lmS8NLaVxWYrZ4YaumEBv4Vx9uBivZ0aTZKRM11uKux7YK z4YKNtTLV3RBNTUcexzLG63WnF/xJQQVm1h8ApK0= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck Subject: [RFC PATCH v1 3/5] libcamera: base: log: Ignore deprecations Date: Wed, 7 Jan 2026 20:36:05 +0100 Message-ID: <20260107193607.2168539-4-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260107193607.2168539-1-barnabas.pocze@ideasonboard.com> References: <20260107193607.2168539-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" `std::atomic_{load,store}()` with `std::shared_ptr` has been deprecated in C++20 in favour of `std::atomic>`. However, it is not available on all supported platforms. So ignore the deprecation warnings. Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart --- src/libcamera/base/log.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libcamera/base/log.cpp b/src/libcamera/base/log.cpp index 6e6d2887c..b28217750 100644 --- a/src/libcamera/base/log.cpp +++ b/src/libcamera/base/log.cpp @@ -326,6 +326,11 @@ private: std::vector> categories_ LIBCAMERA_TSA_GUARDED_BY(mutex_); std::list> levels_; + /* + * \todo Use `std::atomic>` and drop the pragma + * once it works on all supported platforms. + */ +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" std::shared_ptr output_; }; From patchwork Wed Jan 7 19:36:06 2026 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: 25686 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 049CFC3274 for ; Wed, 7 Jan 2026 19:36:21 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 04DF361FC9; Wed, 7 Jan 2026 20:36:18 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="kbAbHakn"; 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 1198761FBC for ; Wed, 7 Jan 2026 20:36:14 +0100 (CET) Received: from pb-laptop.local (185.221.143.114.nat.pool.zt.hu [185.221.143.114]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 3A24C18BF; Wed, 7 Jan 2026 20:35:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1767814552; bh=aj3Bd2OUFxoU+9pT4+J6qP/cg33JDnlUWxFbFuGHhqY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kbAbHaknP06fB/SDNUY8/fnhdjgT3nBj9yaraO6kkKpw9IBoYvlhtFth9UWL96N17 JOxkpX9Lx/Md3GzwbRcEEhZGwIa4m+PMEjiGL7jbIIrnXS1i21DR3O209/N836zlcv upx8u0BB6ftzxWL0ugq5nIc7Hdpvv6wUzz2ffMWU= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck Subject: [RFC PATCH v1 4/5] treewide: Use character literal instead of string in some cases Date: Wed, 7 Jan 2026 20:36:06 +0100 Message-ID: <20260107193607.2168539-5-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260107193607.2168539-1-barnabas.pocze@ideasonboard.com> References: <20260107193607.2168539-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" Use character literals instead of single character long strings. The main purpose of this change is to work around a GCC (libstdc++) bug that results in `-Wrestrict` warnings at certain optimization levels in C++20. Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105329 Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart --- src/libcamera/base/log.cpp | 12 ++++++------ src/libcamera/media_pipeline.cpp | 6 +++--- src/libcamera/pipeline/simple/simple.cpp | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/libcamera/base/log.cpp b/src/libcamera/base/log.cpp index b28217750..946bdebf0 100644 --- a/src/libcamera/base/log.cpp +++ b/src/libcamera/base/log.cpp @@ -236,8 +236,8 @@ void LogOutput::write(const LogMessage &msg) switch (target_) { case LoggingTargetSyslog: - str = std::string(log_severity_name(severity)) + " " - + msg.category().name() + " " + msg.fileInfo() + " "; + str = std::string(log_severity_name(severity)) + ' ' + + msg.category().name() + ' ' + msg.fileInfo() + ' '; if (!msg.prefix().empty()) str += msg.prefix() + ": "; str += msg.msg(); @@ -245,11 +245,11 @@ void LogOutput::write(const LogMessage &msg) break; case LoggingTargetStream: case LoggingTargetFile: - str = "[" + utils::time_point_to_string(msg.timestamp()) + "] [" + str = '[' + utils::time_point_to_string(msg.timestamp()) + "] [" + std::to_string(Thread::currentId()) + "] " - + severityColor + log_severity_name(severity) + " " - + categoryColor + msg.category().name() + " " - + fileColor + msg.fileInfo() + " "; + + severityColor + log_severity_name(severity) + ' ' + + categoryColor + msg.category().name() + ' ' + + fileColor + msg.fileInfo() + ' '; if (!msg.prefix().empty()) str += prefixColor + msg.prefix() + ": "; str += resetColor + msg.msg(); diff --git a/src/libcamera/media_pipeline.cpp b/src/libcamera/media_pipeline.cpp index 3c5517314..26c60c36b 100644 --- a/src/libcamera/media_pipeline.cpp +++ b/src/libcamera/media_pipeline.cpp @@ -243,11 +243,11 @@ int MediaPipeline::init(MediaEntity *source, std::string_view sink) [](const Entity &e) { std::string s = "["; if (e.sink) - s += std::to_string(e.sink->index()) + "|"; + s += std::to_string(e.sink->index()) + '|'; s += e.entity->name(); if (e.source) - s += "|" + std::to_string(e.source->index()); - s += "]"; + s += '|' + std::to_string(e.source->index()); + s += ']'; return s; }); diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp index b30b0a122..d37b76a48 100644 --- a/src/libcamera/pipeline/simple/simple.cpp +++ b/src/libcamera/pipeline/simple/simple.cpp @@ -578,11 +578,11 @@ SimpleCameraData::SimpleCameraData(SimplePipelineHandler *pipe, [](const Entity &e) { std::string s = "["; if (e.sink) - s += std::to_string(e.sink->index()) + "|"; + s += std::to_string(e.sink->index()) + '|'; s += e.entity->name(); if (e.source) - s += "|" + std::to_string(e.source->index()); - s += "]"; + s += '|' + std::to_string(e.source->index()); + s += ']'; return s; }); } From patchwork Wed Jan 7 19:36:07 2026 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: 25687 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 4C879C3284 for ; Wed, 7 Jan 2026 19:36:21 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 92B9661FCB; Wed, 7 Jan 2026 20:36:18 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="F7KW/nBh"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4FBA261FBF for ; Wed, 7 Jan 2026 20:36:14 +0100 (CET) Received: from pb-laptop.local (185.221.143.114.nat.pool.zt.hu [185.221.143.114]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6E6B0B7D; Wed, 7 Jan 2026 20:35:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1767814552; bh=oJeyCBY1MgPSqw7yokRn+c24oz39u9wPtJjuRvUh7zA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F7KW/nBhZb7m20m3mYZCpTrAr9McU8+cYurYhtmGtpPw3YqGEpga9nMHPnl5q72x6 4ol+trFFjZjIp6uaE4rl6CQ93OZg5eNf06AolI66bWRG8BcYlWuDNG1Q913GWBhHip z93PKAF/DL0gkU5FN3DJFtaUTRP21K8vvd89rSuA= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck Subject: [RFC PATCH v1 5/5] meson: Switch to C++20 Date: Wed, 7 Jan 2026 20:36:07 +0100 Message-ID: <20260107193607.2168539-6-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260107193607.2168539-1-barnabas.pocze@ideasonboard.com> References: <20260107193607.2168539-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" Signed-off-by: Barnabás Pőcze --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 1d8e1d994..427d8b1be 100644 --- a/meson.build +++ b/meson.build @@ -6,7 +6,7 @@ project('libcamera', 'c', 'cpp', default_options : [ 'werror=true', 'warning_level=2', - 'cpp_std=c++17', + 'cpp_std=c++20', ], license : 'LGPL 2.1+')