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>
This commit is contained in:
Laurent Pinchart 2019-09-05 03:12:34 +03:00 committed by Jacopo Mondi
parent 9214e2b493
commit 3986009cf1
2 changed files with 223 additions and 331 deletions

View file

@ -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_;
};