Commit 748b8ea6 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Do not show non-capture V4L2 devices in services (fix #5095)

parent 05842dc3
......@@ -398,18 +398,26 @@ static char *decode_property (struct udev_device *dev, const char *name)
/*** Video4Linux support ***/
static bool is_v4l_legacy (struct udev_device *dev)
static bool v4l_is_legacy (struct udev_device *dev)
{
const char *version;
version = udev_device_get_property_value (dev, "ID_V4L_VERSION");
return version && !strcmp (version, "1");
return (version != NULL) && !strcmp (version, "1");
}
static bool v4l_can_capture (struct udev_device *dev)
{
const char *caps;
caps = udev_device_get_property_value (dev, "ID_V4L_CAPABILITIES");
return (caps != NULL) && (strstr (caps, ":capture:") != NULL);
}
static char *v4l_get_mrl (struct udev_device *dev)
{
/* Determine media location */
if (is_v4l_legacy (dev))
if (v4l_is_legacy (dev) || !v4l_can_capture (dev))
return NULL;
const char *node = udev_device_get_devnode (dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment