summaryrefslogtreecommitdiff
path: root/src/android/camera_device.h
diff options
context:
space:
mode:
authorHirokazu Honda <hiroh@chromium.org>2021-03-24 16:07:57 +0900
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-03-25 00:45:27 +0200
commitf101cc6878112d6587692913078f5656372c2e25 (patch)
tree10e4bcc675fcd20de534dbbdbbe83312f88064c6 /src/android/camera_device.h
parentdca709c44aeb0d6532edf3000f701f5d988c5116 (diff)
android: CameraDevice: Manage requestTemplates_ with std::unique_ptr
CameraMetadata stored in requestTemplates_ in CameraDevice is not necessary to be a raw pointer. This reduces the manual new/delete code by changing the type to std::unique_ptr. Signed-off-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/android/camera_device.h')
-rw-r--r--src/android/camera_device.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/android/camera_device.h b/src/android/camera_device.h
index cea82b24..09c395ff 100644
--- a/src/android/camera_device.h
+++ b/src/android/camera_device.h
@@ -97,8 +97,8 @@ private:
libcamera::FrameBuffer *createFrameBuffer(const buffer_handle_t camera3buffer);
void notifyShutter(uint32_t frameNumber, uint64_t timestamp);
void notifyError(uint32_t frameNumber, camera3_stream_t *stream);
- CameraMetadata *requestTemplatePreview();
- CameraMetadata *requestTemplateVideo();
+ std::unique_ptr<CameraMetadata> requestTemplatePreview();
+ std::unique_ptr<CameraMetadata> requestTemplateVideo();
libcamera::PixelFormat toPixelFormat(int format) const;
int processControls(Camera3RequestDescriptor *descriptor);
std::unique_ptr<CameraMetadata> getResultMetadata(
@@ -114,7 +114,7 @@ private:
std::unique_ptr<libcamera::CameraConfiguration> config_;
std::unique_ptr<CameraMetadata> staticMetadata_;
- std::map<unsigned int, const CameraMetadata *> requestTemplates_;
+ std::map<unsigned int, std::unique_ptr<CameraMetadata>> requestTemplates_;
const camera3_callback_ops_t *callbacks_;
std::vector<Camera3StreamConfiguration> streamConfigurations_;