diff options
author | Umang Jain <email@uajain.com> | 2020-08-21 14:46:08 +0000 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-08-23 20:46:08 +0300 |
commit | f8e2813ffe0943fabcff26e47bf4891c07ea18ab (patch) | |
tree | 9f64afd4283c023b983d38bc63e9a10119c86268 /src/android/camera_device.h | |
parent | 7197fd9d67a04353e226544b3d21413c366f7150 (diff) |
android: camera_device: Make CameraDevice a shared object
CameraDevice needs to be wrapper into the std::shared_ptr instead
of std::unique_ptr to enable refcounting. The refcounting will help
us to support hotplug and hot-unplug CameraHalManager operations
in the subsequent commit.
Signed-off-by: Umang Jain <email@uajain.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/android/camera_device.h')
-rw-r--r-- | src/android/camera_device.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/android/camera_device.h b/src/android/camera_device.h index 7be9e119..3e472c71 100644 --- a/src/android/camera_device.h +++ b/src/android/camera_device.h @@ -47,7 +47,8 @@ struct CameraStream { class CameraDevice : protected libcamera::Loggable { public: - CameraDevice(unsigned int id, const std::shared_ptr<libcamera::Camera> &camera); + static std::shared_ptr<CameraDevice> create(unsigned int id, + const std::shared_ptr<libcamera::Camera> &cam); ~CameraDevice(); int initialize(); @@ -72,6 +73,8 @@ protected: std::string logPrefix() const override; private: + CameraDevice(unsigned int id, const std::shared_ptr<libcamera::Camera> &camera); + struct Camera3RequestDescriptor { Camera3RequestDescriptor(unsigned int frameNumber, unsigned int numBuffers); |