linux-v4l2: Fix device enumeration on FreeBSD
Add platform specific code to enumerate v4l2 devices on FreeBSD.
This commit is contained in:
parent
88abdf7e51
commit
cef95722f9
@ -269,7 +269,11 @@ static void v4l2_device_list(obs_property_t *prop, obs_data_t *settings)
|
||||
size_t cur_device_index;
|
||||
const char *cur_device_name;
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
dirp = opendir("/dev");
|
||||
#else
|
||||
dirp = opendir("/sys/class/video4linux");
|
||||
#endif
|
||||
if (!dirp)
|
||||
return;
|
||||
|
||||
@ -285,6 +289,11 @@ static void v4l2_device_list(obs_property_t *prop, obs_data_t *settings)
|
||||
uint32_t caps;
|
||||
struct v4l2_capability video_cap;
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
if (strstr(dp->d_name, "video") == NULL)
|
||||
continue;
|
||||
#endif
|
||||
|
||||
if (dp->d_type == DT_DIR)
|
||||
continue;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user