mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-21 15:53:54 +03:00
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>
This commit is contained in:
parent
7197fd9d67
commit
f8e2813ffe
4 changed files with 14 additions and 4 deletions
|
@ -64,12 +64,12 @@ int CameraHalManager::init()
|
|||
*/
|
||||
unsigned int index = 0;
|
||||
for (auto &cam : cameraManager_->cameras()) {
|
||||
CameraDevice *camera = new CameraDevice(index, cam);
|
||||
std::shared_ptr<CameraDevice> camera = CameraDevice::create(index, cam);
|
||||
ret = camera->initialize();
|
||||
if (ret)
|
||||
continue;
|
||||
|
||||
cameras_.emplace_back(camera);
|
||||
cameras_.emplace_back(std::move(camera));
|
||||
++index;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue