]> git.sesse.net Git - vlc/commitdiff
udev: support for V4L1 devices (untested)
authorRémi Denis-Courmont <remi@remlab.net>
Thu, 15 Oct 2009 19:49:24 +0000 (22:49 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Thu, 15 Oct 2009 19:49:24 +0000 (22:49 +0300)
modules/services_discovery/udev.c

index c9299c27778cd24e67a8fa9b540b1cdcb8ff25f8..708e8001d781ad3b35428036753b47e6d71836af 100644 (file)
@@ -212,6 +212,14 @@ static char *decode_property (struct udev_device *dev, const char *name)
     return decode (udev_device_get_property_value (dev, name));
 }
 
+static bool is_v4l_legacy (struct udev_device *dev)
+{
+    const char *version;
+
+    version = udev_device_get_property_value (dev, "ID_V4L_VERSION");
+    return version && !strcmp (version, "1");
+}
+
 static void HandleDevice (services_discovery_t *sd, struct udev_device *dev,
                           bool add)
 {
@@ -222,7 +230,9 @@ static void HandleDevice (services_discovery_t *sd, struct udev_device *dev,
         return;
     }
 
-    const char *scheme = "v4l2"; /* FIXME: V4L v1 */
+    const char *scheme = "v4l2";
+    if (is_v4l_legacy (dev))
+        scheme = "v4l";
     const char *node = udev_device_get_devnode (dev);
     char *vnd = decode_property (dev, "ID_VENDOR_ENC");
     const char *name = udev_device_get_property_value (dev, "ID_V4L_PRODUCT");