[libcamera-devel] [PATCH v2 12/12] android: camera_metadata: Rename get() to getMetadata()
Jacopo Mondi
jacopo at jmondi.org
Tue Oct 19 14:01:23 CEST 2021
Hi Umang,
On Tue, Oct 19, 2021 at 05:18:02PM +0530, Umang Jain wrote:
> Rename CameraMetadata::get() to CameraMetadata::getMetadata()
> to avoid confusion with std::unique_ptr::get() when CameraMetadata
> is used with a std::unique_ptr.
>
> No functional changes intended in this patch.
Thanks :)
Reviewed-by: Jacopo Mondi <jacopo at jmondi.org>
Thanks
j
>
> Signed-off-by: Umang Jain <umang.jain at ideasonboard.com>
> ---
> src/android/camera_device.cpp | 9 +++++----
> src/android/camera_metadata.cpp | 8 ++++----
> src/android/camera_metadata.h | 4 ++--
> 3 files changed, 11 insertions(+), 10 deletions(-)
>
> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
> index 0a2d3826..ea676409 100644
> --- a/src/android/camera_device.cpp
> +++ b/src/android/camera_device.cpp
> @@ -440,7 +440,7 @@ void CameraDevice::setCallbacks(const camera3_callback_ops_t *callbacks)
>
> const camera_metadata_t *CameraDevice::getStaticMetadata()
> {
> - return capabilities_.staticMetadata()->get();
> + return capabilities_.staticMetadata()->getMetadata();
> }
>
> /*
> @@ -450,7 +450,7 @@ const camera_metadata_t *CameraDevice::constructDefaultRequestSettings(int type)
> {
> auto it = requestTemplates_.find(type);
> if (it != requestTemplates_.end())
> - return it->second->get();
> + return it->second->getMetadata();
>
> /* Use the capture intent matching the requested template type. */
> std::unique_ptr<CameraMetadata> requestTemplate;
> @@ -496,7 +496,7 @@ const camera_metadata_t *CameraDevice::constructDefaultRequestSettings(int type)
> captureIntent);
>
> requestTemplates_[type] = std::move(requestTemplate);
> - return requestTemplates_[type]->get();
> + return requestTemplates_[type]->getMetadata();
> }
>
> /*
> @@ -1171,7 +1171,8 @@ void CameraDevice::sendCaptureResults()
> captureResult.frame_number = descriptor->frameNumber_;
>
> if (descriptor->resultMetadata_)
> - captureResult.result = descriptor->resultMetadata_->get();
> + captureResult.result =
> + descriptor->resultMetadata_->getMetadata();
>
> std::vector<camera3_stream_buffer_t> resultBuffers;
> resultBuffers.reserve(descriptor->buffers_.size());
> diff --git a/src/android/camera_metadata.cpp b/src/android/camera_metadata.cpp
> index 075b6a22..b3e515d2 100644
> --- a/src/android/camera_metadata.cpp
> +++ b/src/android/camera_metadata.cpp
> @@ -33,7 +33,7 @@ CameraMetadata::CameraMetadata(const camera_metadata_t *metadata)
> }
>
> CameraMetadata::CameraMetadata(const CameraMetadata &other)
> - : CameraMetadata(other.get())
> + : CameraMetadata(other.getMetadata())
> {
> }
>
> @@ -51,7 +51,7 @@ CameraMetadata &CameraMetadata::operator=(const CameraMetadata &other)
> if (metadata_)
> free_camera_metadata(metadata_);
>
> - metadata_ = clone_camera_metadata(other.get());
> + metadata_ = clone_camera_metadata(other.getMetadata());
> valid_ = metadata_ != nullptr;
>
> return *this;
> @@ -220,12 +220,12 @@ bool CameraMetadata::updateEntry(uint32_t tag, const void *data, size_t count,
> return false;
> }
>
> -camera_metadata_t *CameraMetadata::get()
> +camera_metadata_t *CameraMetadata::getMetadata()
> {
> return valid_ ? metadata_ : nullptr;
> }
>
> -const camera_metadata_t *CameraMetadata::get() const
> +const camera_metadata_t *CameraMetadata::getMetadata() const
> {
> return valid_ ? metadata_ : nullptr;
> }
> diff --git a/src/android/camera_metadata.h b/src/android/camera_metadata.h
> index 60be416c..8555c7c3 100644
> --- a/src/android/camera_metadata.h
> +++ b/src/android/camera_metadata.h
> @@ -85,8 +85,8 @@ public:
> return updateEntry(tag, data, count, sizeof(T));
> }
>
> - camera_metadata_t *get();
> - const camera_metadata_t *get() const;
> + camera_metadata_t *getMetadata();
> + const camera_metadata_t *getMetadata() const;
>
> private:
> bool resize(size_t count, size_t size);
> --
> 2.31.0
>
More information about the libcamera-devel
mailing list