From patchwork Sat Jul 25 14:40:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 9002 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 3E6F3BD86F for ; Sat, 25 Jul 2020 14:37:30 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 32EE661366; Sat, 25 Jul 2020 16:37:29 +0200 (CEST) Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B206461212 for ; Sat, 25 Jul 2020 16:37:27 +0200 (CEST) Received: from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay10.mail.gandi.net (Postfix) with ESMTPSA id EE53D24000C; Sat, 25 Jul 2020 14:37:26 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Sat, 25 Jul 2020 16:40:54 +0200 Message-Id: <20200725144058.129388-3-jacopo@jmondi.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200725144058.129388-1-jacopo@jmondi.org> References: <20200725144058.129388-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 2/6] android: camera_metadata: Add const version of get() 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 a const version of the CameraMetadata::get() method to retrieve a const reference to the camera metadata wrapped by the class instance. Reviewed-by: Laurent Pinchart Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- src/android/camera_metadata.cpp | 5 +++++ src/android/camera_metadata.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/android/camera_metadata.cpp b/src/android/camera_metadata.cpp index 47b2e4ef117a..ea33e9c2de25 100644 --- a/src/android/camera_metadata.cpp +++ b/src/android/camera_metadata.cpp @@ -50,3 +50,8 @@ camera_metadata_t *CameraMetadata::get() { return valid_ ? metadata_ : nullptr; } + +const camera_metadata_t *CameraMetadata::get() const +{ + return valid_ ? metadata_ : nullptr; +} diff --git a/src/android/camera_metadata.h b/src/android/camera_metadata.h index 348a018165ef..f16dd27bbf44 100644 --- a/src/android/camera_metadata.h +++ b/src/android/camera_metadata.h @@ -21,6 +21,7 @@ public: bool addEntry(uint32_t tag, const void *data, size_t data_count); camera_metadata_t *get(); + const camera_metadata_t *get() const; private: camera_metadata_t *metadata_;