From patchwork Thu Sep 3 09:18:43 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: 28184 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 8C7F2C334B for ; Thu, 3 Sep 2026 09:18:58 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4D226685EB; Thu, 3 Sep 2026 11:18:54 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="mfuyH033"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4987A685DB for ; Thu, 3 Sep 2026 11:18:48 +0200 (CEST) Received: from pb-laptop.local (185.221.143.32.nat.pool.zt.hu [185.221.143.32]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 7AF271CF5; Thu, 3 Sep 2026 11:17:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1788427036; bh=mvLMk8HaxPpjPVa+2s+ZI0E7AuIGQfR/+9NKEJxB3Ss=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mfuyH033L2nEyLrwGLt6laNybhb6xJD6EFR3EpYCk/nkBp5DPjtesbm1SwtXITF75 mkGv7otWJocWI2k9zwh6lXa+u/rcziTsyZ+9ElkZ/dbiehek6X15+w+/o7vFbxgdlD uNWOTM5V3qbdJZLVRwgFbkmFyV5y1AeQGlUiAloc= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Cc: Kieran Bingham , Jacopo Mondi , Laurent Pinchart Subject: [PATCH v3 5/5] libcamera: controls: Add rvalue overload for `ControlList::set()` Date: Thu, 3 Sep 2026 11:18:43 +0200 Message-ID: <20260903091843.85548-6-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260903091843.85548-1-barnabas.pocze@ideasonboard.com> References: <20260903091843.85548-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 an overload of `ControlList::set()` that takes the `ControlValue` argument as an rvalue reference, therefore enabling the use of move assignment. Signed-off-by: Barnabás Pőcze Reviewed-by: Kieran Bingham Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- include/libcamera/controls.h | 1 + src/libcamera/controls.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h index 190a28970c..e7278b4965 100644 --- a/include/libcamera/controls.h +++ b/include/libcamera/controls.h @@ -513,6 +513,7 @@ public: const ControlValue &get(unsigned int id) const; void set(unsigned int id, const ControlValue &value); + void set(unsigned int id, ControlValue &&value); const ControlInfoMap *infoMap() const { return infoMap_; } const ControlIdMap *idMap() const { return idmap_; } diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp index 242072778b..ce10e4bbe1 100644 --- a/src/libcamera/controls.cpp +++ b/src/libcamera/controls.cpp @@ -1153,6 +1153,18 @@ void ControlList::set(unsigned int id, const ControlValue &value) *val = value; } +/** + * \copydoc ControlList::set(unsigned int, const ControlValue &) + */ +void ControlList::set(unsigned int id, ControlValue &&value) +{ + ControlValue *val = find(id); + if (!val) + return; + + *val = std::move(value); +} + /** * \fn ControlList::infoMap() * \brief Retrieve the ControlInfoMap used to construct the ControlList