[libcamera-devel] [PATCH v2 1/6] android: camera_metadata: Mark isValid() as const

Jacopo Mondi jacopo at jmondi.org
Sat Jul 25 16:40:53 CEST 2020


The CameraMetadata::isValid() method does not modify the object state
and can be called on const instances of the CameraMetadata class.

Mark the method as const to allow that.

Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.comR
Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
---
 src/android/camera_metadata.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/android/camera_metadata.h b/src/android/camera_metadata.h
index 75a9d7066f31..348a018165ef 100644
--- a/src/android/camera_metadata.h
+++ b/src/android/camera_metadata.h
@@ -17,7 +17,7 @@ public:
 	CameraMetadata(size_t entryCapacity, size_t dataCapacity);
 	~CameraMetadata();
 
-	bool isValid() { return valid_; }
+	bool isValid() const { return valid_; }
 	bool addEntry(uint32_t tag, const void *data, size_t data_count);
 
 	camera_metadata_t *get();
-- 
2.27.0



More information about the libcamera-devel mailing list