[libcamera-devel] [PATCH 2/6] android: camera_metadata: Add const version of get()
Kieran Bingham
kieran.bingham at ideasonboard.com
Fri Jul 24 17:33:12 CEST 2020
On 24/07/2020 15:21, Jacopo Mondi wrote:
> Add a const version of the CameraMetadata::get() method to retrieve
> a const reference to the camera metadata wrapped by the class instance.
>
> Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> ---
> 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_;
>
--
Regards
--
Kieran
More information about the libcamera-devel
mailing list