summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libcamera/include/media_device.h4
-rw-r--r--src/libcamera/media_device.cpp10
2 files changed, 14 insertions, 0 deletions
diff --git a/src/libcamera/include/media_device.h b/src/libcamera/include/media_device.h
index 8a7b9489..27a2b46a 100644
--- a/src/libcamera/include/media_device.h
+++ b/src/libcamera/include/media_device.h
@@ -14,6 +14,8 @@
#include <linux/media.h>
+#include <libcamera/signal.h>
+
#include "media_object.h"
namespace libcamera {
@@ -48,6 +50,8 @@ public:
MediaLink *link(const MediaPad *source, const MediaPad *sink);
int disableLinks();
+ Signal<MediaDevice *> disconnected;
+
private:
std::string driver_;
std::string deviceNode_;
diff --git a/src/libcamera/media_device.cpp b/src/libcamera/media_device.cpp
index 51e5088e..be81bd8c 100644
--- a/src/libcamera/media_device.cpp
+++ b/src/libcamera/media_device.cpp
@@ -428,6 +428,16 @@ int MediaDevice::disableLinks()
}
/**
+ * \var MediaDevice::disconnected
+ * \brief Signal emitted when the media device is disconnected from the system
+ *
+ * This signal is emitted when the device enumerator detects that the media
+ * device has been removed from the system. For hot-pluggable devices this is
+ * usually caused by physical device disconnection, but can also result from
+ * driver unloading for most devices. The media device is passed as a parameter.
+ */
+
+/**
* \var MediaDevice::objects_
* \brief Global map of media objects (entities, pads, links) keyed by their
* object id.