[libcamera-devel] [PATCH 4/7] android: camera_metadata: Add defaul constructor
Jacopo Mondi
jacopo at jmondi.org
Thu Jan 21 17:53:02 CET 2021
Add a default constructor that initializes a non valid CameraMetadata
to allow embedding instances of the class in other types.
Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
---
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 8e36e758d231..6f1bcdbe274a 100644
--- a/src/android/camera_metadata.cpp
+++ b/src/android/camera_metadata.cpp
@@ -13,6 +13,11 @@ using namespace libcamera;
LOG_DEFINE_CATEGORY(CameraMetadata)
+CameraMetadata::CameraMetadata()
+ : metadata_(nullptr), valid_(false)
+{
+}
+
CameraMetadata::CameraMetadata(size_t entryCapacity, size_t dataCapacity)
{
metadata_ = allocate_camera_metadata(entryCapacity, dataCapacity);
diff --git a/src/android/camera_metadata.h b/src/android/camera_metadata.h
index 720b760d44da..d653e2f0f502 100644
--- a/src/android/camera_metadata.h
+++ b/src/android/camera_metadata.h
@@ -14,6 +14,7 @@
class CameraMetadata
{
public:
+ CameraMetadata();
CameraMetadata(size_t entryCapacity, size_t dataCapacity);
CameraMetadata(const camera_metadata_t *metadata);
CameraMetadata(const CameraMetadata &other);
--
2.29.2
More information about the libcamera-devel
mailing list