libcamera: device_enumerator: add DeviceEnumeratorSysfs class
A udev-based device enumerator is not sufficient, since libudev is an optional dependency, or udev might fail. In these cases, we should fall back to using sysfs to enumerate devices. Add a DeviceEnumeratorSysfs class which is a specialization of DeviceEnumerator that uses sysfs to enumerate media devices on the system. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "device_enumerator.h"
|
||||
#include "device_enumerator_sysfs.h"
|
||||
#include "device_enumerator_udev.h"
|
||||
|
||||
#include <string.h>
|
||||
@@ -153,8 +154,9 @@ std::unique_ptr<DeviceEnumerator> DeviceEnumerator::create()
|
||||
* Either udev is not available or udev initialization failed. Fall back
|
||||
* on the sysfs enumerator.
|
||||
*/
|
||||
|
||||
/** \todo Add a sysfs-based enumerator. */
|
||||
enumerator = utils::make_unique<DeviceEnumeratorSysfs>();
|
||||
if (!enumerator->init())
|
||||
return enumerator;
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user