From patchwork Thu Aug 6 12:53:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 9249 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 363D5BD87A for ; Thu, 6 Aug 2020 12:53:45 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id CE44560914; Thu, 6 Aug 2020 14:53:44 +0200 (CEST) Received: from bin-mail-out-05.binero.net (bin-mail-out-05.binero.net [195.74.38.228]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B140F607EB for ; Thu, 6 Aug 2020 14:53:42 +0200 (CEST) X-Halon-ID: daa52812-d7e3-11ea-92dc-005056917a89 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (p54ac52a8.dip0.t-ipconnect.de [84.172.82.168]) by bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA id daa52812-d7e3-11ea-92dc-005056917a89; Thu, 06 Aug 2020 14:53:41 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Thu, 6 Aug 2020 14:53:30 +0200 Message-Id: <20200806125330.2983325-4-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200806125330.2983325-1-niklas.soderlund@ragnatech.se> References: <20200806125330.2983325-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 3/3] libcamera: camera: Mark controls() and properties() as const operations 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" Reading the controls and properties do not modify the camera's state and can be marked as const operations. Signed-off-by: Niklas Söderlund Reviewed-by: Kieran Bingham --- include/libcamera/camera.h | 4 ++-- src/libcamera/camera.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/libcamera/camera.h b/include/libcamera/camera.h index 48d88d64a0a94050..272c12c3c47392fc 100644 --- a/include/libcamera/camera.h +++ b/include/libcamera/camera.h @@ -86,8 +86,8 @@ public: int acquire(); int release(); - const ControlInfoMap &controls(); - const ControlList &properties(); + const ControlInfoMap &controls() const; + const ControlList &properties() const; const std::set &streams() const; std::unique_ptr generateConfiguration(const StreamRoles &roles = {}); diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp index 820fa1e3065e5f88..1685697b8ebbebcb 100644 --- a/src/libcamera/camera.cpp +++ b/src/libcamera/camera.cpp @@ -658,7 +658,7 @@ int Camera::release() * * \return A ControlInfoMap listing the controls supported by the camera */ -const ControlInfoMap &Camera::controls() +const ControlInfoMap &Camera::controls() const { return p_->pipe_->controls(this); } @@ -671,7 +671,7 @@ const ControlInfoMap &Camera::controls() * * \return A ControlList of properties supported by the camera */ -const ControlList &Camera::properties() +const ControlList &Camera::properties() const { return p_->pipe_->properties(this); }