# HG changeset patch # User renatofilho # Date 1203083543 0 # Node ID e612ba1d16ab3d1e4d723c0bea25bde0f5d12aa4 # Parent ef147f779302d0d32d3489705073d8909bdea825 [svn r924] created method gmyth_upnp_get_devices diff -r ef147f779302 -r e612ba1d16ab gmyth-upnp/autogen.sh --- a/gmyth-upnp/autogen.sh Thu Feb 14 16:13:51 2008 +0000 +++ b/gmyth-upnp/autogen.sh Fri Feb 15 13:52:23 2008 +0000 @@ -4,7 +4,7 @@ srcdir=`dirname $0` test -z "$srcdir" && srcdir=. -PKG_NAME="mtv" +PKG_NAME="gmyth-upnp" (test -f $srcdir/configure.ac) || { echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" diff -r ef147f779302 -r e612ba1d16ab gmyth-upnp/configure.ac --- a/gmyth-upnp/configure.ac Thu Feb 14 16:13:51 2008 +0000 +++ b/gmyth-upnp/configure.ac Fri Feb 15 13:52:23 2008 +0000 @@ -3,7 +3,7 @@ AC_PREREQ(2.50) -AC_INIT([gmyth-upnp],[0.7]) +AC_INIT([gmyth-upnp],[0.7.1]) AC_CONFIG_SRCDIR([src/gmyth_upnp.c]) AC_CONFIG_HEADER(config.h) diff -r ef147f779302 -r e612ba1d16ab gmyth-upnp/gmyth-upnp.pc.in --- a/gmyth-upnp/gmyth-upnp.pc.in Thu Feb 14 16:13:51 2008 +0000 +++ b/gmyth-upnp/gmyth-upnp.pc.in Fri Feb 15 13:52:23 2008 +0000 @@ -5,8 +5,8 @@ Name: gmyth-upnp Description: Myth TV upnp library based upon GLib/GObject paradigm -Version: @VERSION@ -Requires: gobject-2.0 glib-2.0 clinkc +Version: 0.7.1 +Requires: gobject-2.0 glib-2.0 libupnp Libs: @LIBGMYTH_LIBS@ -L${libdir} -lgmythupnp Cflags: @LIBGMYTH_CFLAGS@ -I${includedir}/gmyth-upnp diff -r ef147f779302 -r e612ba1d16ab gmyth-upnp/src/gmyth_upnp.c --- a/gmyth-upnp/src/gmyth_upnp.c Thu Feb 14 16:13:51 2008 +0000 +++ b/gmyth-upnp/src/gmyth_upnp.c Fri Feb 15 13:52:23 2008 +0000 @@ -212,6 +212,31 @@ g_warning ("Fail to start upnp listener: %d", ret); } +static void +_fill_servers_cb (gpointer key, + gpointer value, + gpointer user_data) +{ + GList **lst; + + lst = (GList **) user_data; + + *lst = g_list_append (*lst, g_object_ref (value)); +} + +GList* +gmyth_upnp_get_devices (GMythUPnP *self) +{ + GMythUPnPPrivate *priv; + GList *lst; + + priv = GMYTH_UPNP_GET_PRIVATE (self); + lst = NULL; + g_hash_table_foreach (priv->servers, (GHFunc) _fill_servers_cb, &lst); + + return lst; +} + static gboolean _idle_emit_device_found_signal (gpointer data) { @@ -329,7 +354,6 @@ g_strdup (uuid), g_object_ref (info)); g_mutex_unlock (priv->mutex); - g_debug ("info url: %s", info_url); g_free (info_url); idle_data = g_new0 (GMythUPnPIdleData, 1); @@ -403,11 +427,9 @@ d_event = (struct Upnp_Discovery *) e; - g_debug ("TYPE: %s", d_event->ServiceType); - if (strcmp (d_event->ServiceType, UPNP_SERVICE_FILTER) != 0) { - g_debug ("invalid device : %s", d_event->DeviceId); + g_warning ("invalid device : %s", d_event->DeviceId); break; } @@ -446,7 +468,6 @@ } default: - g_debug ("No handle event: %d", e_type); break; } diff -r ef147f779302 -r e612ba1d16ab gmyth-upnp/src/gmyth_upnp.h --- a/gmyth-upnp/src/gmyth_upnp.h Thu Feb 14 16:13:51 2008 +0000 +++ b/gmyth-upnp/src/gmyth_upnp.h Fri Feb 15 13:52:23 2008 +0000 @@ -77,6 +77,7 @@ GType gmyth_upnp_get_type (void); GMythUPnP* gmyth_upnp_get_instance (void); void gmyth_upnp_search (GMythUPnP * gmyth_upnp); +GList* gmyth_upnp_get_devices (GMythUPnP * gmyth_upnp); G_END_DECLS #endif /* _GMYTH_UPNP_H_ */