[vlc-devel] commit: udev: probe support (untested) ( Rémi Denis-Courmont )
git version control
git at videolan.org
Mon Dec 21 20:46:04 CET 2009
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Dec 21 20:26:36 2009 +0200| [f39acb0deefb36207a585974cb6fce073168c279] | committer: Rémi Denis-Courmont
udev: probe support (untested)
This actually checks that udev works.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f39acb0deefb36207a585974cb6fce073168c279
---
modules/services_discovery/udev.c | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/modules/services_discovery/udev.c b/modules/services_discovery/udev.c
index 0a85c88..d24b906 100644
--- a/modules/services_discovery/udev.c
+++ b/modules/services_discovery/udev.c
@@ -35,6 +35,7 @@
static int OpenV4L (vlc_object_t *);
static int OpenDisc (vlc_object_t *);
static void Close (vlc_object_t *);
+static int vlc_sd_probe_Open (vlc_object_t *);
/*
* Module descriptor
@@ -57,8 +58,29 @@ vlc_module_begin ()
set_callbacks (OpenDisc, Close)
add_shortcut ("disc")
+ VLC_SD_PROBE_SUBMODULE
+
vlc_module_end ()
+static int vlc_sd_probe_Open (vlc_object_t *obj)
+{
+ vlc_probe_t *probe = (vlc_probe_t *)obj;
+
+ struct udev *udev = udev_new ();
+ if (udev == NULL)
+ return VLC_EGENERIC;
+
+ struct udev_monitor *mon = udev_monitor_new_from_netlink (udev, "udev");
+ if (mon != NULL)
+ {
+ vlc_sd_probe_Add (probe, "v4l", N_("Capture devices"));
+ vlc_sd_probe_Add (probe, "disc", N_("Discs"));
+ udev_monitor_unref (mon);
+ }
+ udev_unref (udev);
+ return VLC_PROBE_CONTINUE;
+}
+
struct device
{
dev_t devnum; /* must be first */
More information about the vlc-devel
mailing list