From c1ae9055f98ba6b2f9983366fa1b0fd5445a77d2 Mon Sep 17 00:00:00 2001
From: Hirokazu Honda <hiroh@chromium.org>
Date: Wed, 28 Oct 2020 18:50:23 +0900
Subject: android: camera_device: Mark toPixelFormat() a const function
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

CameraDevice::toPixelFormat() doesn't change the state of the
CameraDevice. Marks it a const function so that it can be called
in const functions.

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 src/android/camera_device.cpp | 2 +-
 src/android/camera_device.h   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

(limited to 'src')

diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index ead8a433..4690346e 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -1188,7 +1188,7 @@ const camera_metadata_t *CameraDevice::constructDefaultRequestSettings(int type)
 	return requestTemplate->get();
 }
 
-PixelFormat CameraDevice::toPixelFormat(int format)
+PixelFormat CameraDevice::toPixelFormat(int format) const
 {
 	/* Translate Android format code to libcamera pixel format. */
 	auto it = formatsMap_.find(format);
diff --git a/src/android/camera_device.h b/src/android/camera_device.h
index fd08738a..45efcf47 100644
--- a/src/android/camera_device.h
+++ b/src/android/camera_device.h
@@ -104,7 +104,7 @@ private:
 	void notifyShutter(uint32_t frameNumber, uint64_t timestamp);
 	void notifyError(uint32_t frameNumber, camera3_stream_t *stream);
 	CameraMetadata *requestTemplatePreview();
-	libcamera::PixelFormat toPixelFormat(int format);
+	libcamera::PixelFormat toPixelFormat(int format) const;
 	std::unique_ptr<CameraMetadata> getResultMetadata(int frame_number,
 							  int64_t timestamp);
 
-- 
cgit v1.2.1