summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2020-10-03 13:17:35 +0200
committerJacopo Mondi <jacopo@jmondi.org>2020-10-07 16:07:44 +0200
commitfc1fcb5bc9c21cc497bb978b866885787587aa9f (patch)
tree18be546d2816b589f17bb0eb1007d2fb5de90dcd
parente3393f147e5d011c6f02447a18eb73b1cf134b4b (diff)
android: camera_device: Return Camera as shared_ptr
Return the Camera wrapped by the CameraDevice as a shared_ptr. This will be required to construct the FrameBuffer allocator in the CameraStream class. Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
-rw-r--r--src/android/camera_device.h2
-rw-r--r--src/android/camera_hal_manager.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/android/camera_device.h b/src/android/camera_device.h
index 826023b4..777d1a35 100644
--- a/src/android/camera_device.h
+++ b/src/android/camera_device.h
@@ -49,7 +49,7 @@ public:
unsigned int id() const { return id_; }
camera3_device_t *camera3Device() { return &camera3Device_; }
- const libcamera::Camera *camera() const { return camera_.get(); }
+ std::shared_ptr<libcamera::Camera> camera() const { return camera_; }
libcamera::CameraConfiguration *cameraConfiguration() const
{
return config_.get();
diff --git a/src/android/camera_hal_manager.cpp b/src/android/camera_hal_manager.cpp
index 05b47401..2a33f9b1 100644
--- a/src/android/camera_hal_manager.cpp
+++ b/src/android/camera_hal_manager.cpp
@@ -155,7 +155,7 @@ void CameraHalManager::cameraRemoved(std::shared_ptr<Camera> cam)
auto iter = std::find_if(cameras_.begin(), cameras_.end(),
[&cam](std::shared_ptr<CameraDevice> &camera) {
- return cam.get() == camera->camera();
+ return cam == camera->camera();
});
if (iter == cameras_.end())
return;