summaryrefslogtreecommitdiff
path: root/src/libcamera/include/device_enumerator.h
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-03-21 19:56:35 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-03-23 16:30:48 +0200
commit9ab024f7c27d9b6b3ab433502eab02d4a29a3da4 (patch)
tree09a944b3fe23357b94bb417a9bd0ca6af15e332d /src/libcamera/include/device_enumerator.h
parente75ef59e028e5b686d686789439ede443c9c4cde (diff)
libcamera: device_enumerator: Convey device ownership through unique_ptr
Replace usage of shared_ptr with unique_ptr to convey media device ownership internally in the enumerators when creating the media device. Once a media device has all its dependencies met, it is converted to a shared_ptr to keep the external API unchanged. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/libcamera/include/device_enumerator.h')
-rw-r--r--src/libcamera/include/device_enumerator.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcamera/include/device_enumerator.h b/src/libcamera/include/device_enumerator.h
index 770f4277..433e357a 100644
--- a/src/libcamera/include/device_enumerator.h
+++ b/src/libcamera/include/device_enumerator.h
@@ -44,8 +44,8 @@ public:
std::shared_ptr<MediaDevice> search(const DeviceMatch &dm);
protected:
- std::shared_ptr<MediaDevice> createDevice(const std::string &deviceNode);
- void addDevice(const std::shared_ptr<MediaDevice> &media);
+ std::unique_ptr<MediaDevice> createDevice(const std::string &deviceNode);
+ void addDevice(std::unique_ptr<MediaDevice> &&media);
void removeDevice(const std::string &deviceNode);
private: