From dd21ededd0fe9dede5942b0b68c45d43f1d671bd Mon Sep 17 00:00:00 2001 From: Umang Jain Date: Tue, 16 Jun 2020 19:45:36 +0000 Subject: 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 Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham Signed-off-by: Laurent Pinchart --- include/libcamera/internal/device_enumerator.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/libcamera/internal/device_enumerator.h') 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 +#include + namespace libcamera { class MediaDevice; @@ -43,6 +45,8 @@ public: std::shared_ptr search(const DeviceMatch &dm); + Signal<> devicesAdded; + protected: std::unique_ptr createDevice(const std::string &deviceNode); void addDevice(std::unique_ptr &&media); -- cgit v1.2.1