summaryrefslogtreecommitdiff
path: root/include/libcamera/internal/device_enumerator.h
diff options
context:
space:
mode:
authorUmang Jain <email@uajain.com>2020-06-16 19:45:36 +0000
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-06-17 00:27:51 +0300
commitdd21ededd0fe9dede5942b0b68c45d43f1d671bd (patch)
tree87ccac84cfc1e42f56f01de565bc81e92d3a1b03 /include/libcamera/internal/device_enumerator.h
parentc6f8ec7d8afdf6352fdbf6363052d7fa8370d1da (diff)
libcamera: device_enumerator: Emit a signal when new devices are added
Emit a signal whenever new MediaDevices are added to the DeviceEnumerator. This will allow CameraManager to be notified about the new devices and it can re-emumerate all the devices currently present on the system. Device enumeration by the CameraManger is an expensive operation hence, we want one signal emission per 'x' milliseconds to notify multiple devices additions as a single batch, by the DeviceEnumerator. Add a \todo to investigate the support for that. Signed-off-by: Umang Jain <email@uajain.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'include/libcamera/internal/device_enumerator.h')
-rw-r--r--include/libcamera/internal/device_enumerator.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/libcamera/internal/device_enumerator.h b/include/libcamera/internal/device_enumerator.h
index 25a36308..a9850400 100644
--- a/include/libcamera/internal/device_enumerator.h
+++ b/include/libcamera/internal/device_enumerator.h
@@ -13,6 +13,8 @@
#include <linux/media.h>
+#include <libcamera/signal.h>
+
namespace libcamera {
class MediaDevice;
@@ -43,6 +45,8 @@ public:
std::shared_ptr<MediaDevice> search(const DeviceMatch &dm);
+ Signal<> devicesAdded;
+
protected:
std::unique_ptr<MediaDevice> createDevice(const std::string &deviceNode);
void addDevice(std::unique_ptr<MediaDevice> &&media);