summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo.mondi@ideasonboard.com>2023-08-07 13:12:46 +0200
committerJacopo Mondi <jacopo.mondi@ideasonboard.com>2023-08-08 13:47:30 +0200
commit59fde8be87724184c89dee112499b4921caa82c6 (patch)
treeef926833fa52e94bf8c73c6856e33f52fe7ad030 /include
parent41ebdcd2a98c8648542e5201ebe06adc278f321a (diff)
libcamera: device_enumerator_udev: Enumerate USB devices
Add experimental support for USB device enumeration in the udev-based device enumerator. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Diffstat (limited to 'include')
-rw-r--r--include/libcamera/internal/device_enumerator.h5
-rw-r--r--include/libcamera/internal/device_enumerator_udev.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/include/libcamera/internal/device_enumerator.h b/include/libcamera/internal/device_enumerator.h
index 8df6a3e2..1d6dbcb1 100644
--- a/include/libcamera/internal/device_enumerator.h
+++ b/include/libcamera/internal/device_enumerator.h
@@ -18,6 +18,7 @@
namespace libcamera {
class MediaDevice;
+class USBDevice;
class DeviceEnumerator
{
@@ -38,8 +39,12 @@ protected:
void addMediaDevice(std::unique_ptr<MediaDevice> media);
void removeMediaDevice(const std::string &deviceNode);
+ void addUSBDevice(std::unique_ptr<USBDevice> usb);
+ /* \todo implement remove() */
+
private:
std::vector<std::shared_ptr<MediaDevice>> mediaDevices_;
+ std::vector<std::shared_ptr<USBDevice>> usbDevices_;
};
} /* namespace libcamera */
diff --git a/include/libcamera/internal/device_enumerator_udev.h b/include/libcamera/internal/device_enumerator_udev.h
index 1b3360df..e67ee31e 100644
--- a/include/libcamera/internal/device_enumerator_udev.h
+++ b/include/libcamera/internal/device_enumerator_udev.h
@@ -59,6 +59,7 @@ private:
std::string lookupDeviceNode(dev_t devnum);
int addV4L2Device(dev_t devnum);
+ int createUSBDevice(struct udev_device *dev);
void udevNotify();
struct udev *udev_;