summaryrefslogtreecommitdiff
path: root/src/libcamera/include/device_enumerator.h
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-01-06 12:19:24 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-01-25 01:59:29 +0200
commit0052aaa40e9d9c92f4ada41987f03015adf4953e (patch)
tree683f6bc5b2a3050540dbd19bcd47970f573a884a /src/libcamera/include/device_enumerator.h
parent4d84fa4fee4c138cc672715309de00dfbe4fc711 (diff)
libcamera: device_enumerator: Add hotplug support
Create a udev_monitor in the udev device enumerator to listen to media device disconnection, and emit the corresponding media device's disconnect signal in response. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/libcamera/include/device_enumerator.h')
-rw-r--r--src/libcamera/include/device_enumerator.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libcamera/include/device_enumerator.h b/src/libcamera/include/device_enumerator.h
index 3f87a625..22ed8ded 100644
--- a/src/libcamera/include/device_enumerator.h
+++ b/src/libcamera/include/device_enumerator.h
@@ -16,6 +16,7 @@
namespace libcamera {
+class EventNotifier;
class MediaDevice;
class DeviceMatch
@@ -46,6 +47,7 @@ public:
protected:
int addDevice(const std::string &deviceNode);
+ void removeDevice(const std::string &deviceNode);
private:
std::vector<std::shared_ptr<MediaDevice>> devices_;
@@ -64,8 +66,12 @@ public:
private:
struct udev *udev_;
+ struct udev_monitor *monitor_;
+ EventNotifier *notifier_;
std::string lookupDeviceNode(int major, int minor) final;
+
+ void udevNotify(EventNotifier *notifier);
};
} /* namespace libcamera */