[vlc-devel] commit: XCB/apps: probe if the X server is present ( 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:39:45 2009 +0200| [88c6f5f8eefc4bb203d59b4a14bc8b4b9b954637] | committer: Rémi Denis-Courmont 

XCB/apps: probe if the X server is present

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=88c6f5f8eefc4bb203d59b4a14bc8b4b9b954637
---

 modules/services_discovery/xcb_apps.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/modules/services_discovery/xcb_apps.c b/modules/services_discovery/xcb_apps.c
index 86ced7b..adab54c 100644
--- a/modules/services_discovery/xcb_apps.c
+++ b/modules/services_discovery/xcb_apps.c
@@ -37,6 +37,7 @@ typedef xcb_atom_t Atom;
 
 static int  Open (vlc_object_t *);
 static void Close (vlc_object_t *);
+static int vlc_sd_probe_Open (vlc_object_t *);
 
 /*
  * Module descriptor
@@ -50,6 +51,8 @@ vlc_module_begin ()
     set_callbacks (Open, Close)
 
     add_shortcut ("apps")
+
+    VLC_SD_PROBE_SUBMODULE
 vlc_module_end ()
 
 struct services_discovery_sys_t
@@ -66,6 +69,19 @@ static void *Run (void *);
 static void Update (services_discovery_t *);
 static void DelItem (void *);
 
+static int vlc_sd_probe_Open (vlc_object_t *obj)
+{
+    vlc_probe_t *probe = (vlc_probe_t *)obj;
+
+    char *display = var_CreateGetNonEmptyString (obj, "x11-display");
+    xcb_connection_t *conn = xcb_connect (display, NULL);
+    free (display);
+    if (xcb_connection_has_error (conn))
+        return VLC_EGENERIC;
+    xcb_disconnect (conn);
+    return vlc_sd_probe_Add (probe, "xcb_apps", N_("Screen capture"));
+}
+
 /**
  * Probes and initializes.
  */




More information about the vlc-devel mailing list