summaryrefslogtreecommitdiff
path: root/src/android/camera_device.h
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-09-05 03:12:34 +0300
committerJacopo Mondi <jacopo@jmondi.org>2019-09-05 23:27:34 +0200
commit3986009cf14d94e2312a31d799c2e5d45d30a5b9 (patch)
treed8e0ab0feab6a2b0012a4a77171298ab3148b691 /src/android/camera_device.h
parent9214e2b4932a6d5f459a8319f34b3671fee35aa2 (diff)
android: camera_device: Use the new CameraMetadata helper class
Simplify the implementation of metadata handling in the CameraDevice class by using the new CameraMetadata helper class. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/android/camera_device.h')
-rw-r--r--src/android/camera_device.h15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/android/camera_device.h b/src/android/camera_device.h
index 7897ba9d..65ba877a 100644
--- a/src/android/camera_device.h
+++ b/src/android/camera_device.h
@@ -19,13 +19,7 @@
#include "message.h"
-#define METADATA_ASSERT(_r) \
- do { \
- if (!(_r)) break; \
- LOG(HAL, Error) << "Error: " << __func__ << ":" << __LINE__; \
- return nullptr; \
- } while(0);
-
+class CameraMetadata;
class ThreadRpc;
class CameraDevice : public libcamera::Object
@@ -59,14 +53,15 @@ private:
void notifyShutter(uint32_t frameNumber, uint64_t timestamp);
void notifyError(uint32_t frameNumber, camera3_stream_t *stream);
- camera_metadata_t *getResultMetadata(int frame_number, int64_t timestamp);
+ std::unique_ptr<CameraMetadata> getResultMetadata(int frame_number,
+ int64_t timestamp);
bool running_;
std::shared_ptr<libcamera::Camera> camera_;
std::unique_ptr<libcamera::CameraConfiguration> config_;
- camera_metadata_t *staticMetadata_;
- camera_metadata_t *requestTemplate_;
+ CameraMetadata *staticMetadata_;
+ CameraMetadata *requestTemplate_;
const camera3_callback_ops_t *callbacks_;
};