[svn r924] created method gmyth_upnp_get_devices trunk
authorrenatofilho
Fri Feb 15 13:52:23 2008 +0000 (2008-02-15)
branchtrunk
changeset 915e612ba1d16ab
parent 914 ef147f779302
child 916 39d46bc373eb
[svn r924] created method gmyth_upnp_get_devices
gmyth-upnp/autogen.sh
gmyth-upnp/configure.ac
gmyth-upnp/gmyth-upnp.pc.in
gmyth-upnp/src/gmyth_upnp.c
gmyth-upnp/src/gmyth_upnp.h
     1.1 --- a/gmyth-upnp/autogen.sh	Thu Feb 14 16:13:51 2008 +0000
     1.2 +++ b/gmyth-upnp/autogen.sh	Fri Feb 15 13:52:23 2008 +0000
     1.3 @@ -4,7 +4,7 @@
     1.4  srcdir=`dirname $0`
     1.5  test -z "$srcdir" && srcdir=.
     1.6  
     1.7 -PKG_NAME="mtv"
     1.8 +PKG_NAME="gmyth-upnp"
     1.9  
    1.10  (test -f $srcdir/configure.ac) || {
    1.11      echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
     2.1 --- a/gmyth-upnp/configure.ac	Thu Feb 14 16:13:51 2008 +0000
     2.2 +++ b/gmyth-upnp/configure.ac	Fri Feb 15 13:52:23 2008 +0000
     2.3 @@ -3,7 +3,7 @@
     2.4  
     2.5  AC_PREREQ(2.50)
     2.6  
     2.7 -AC_INIT([gmyth-upnp],[0.7])
     2.8 +AC_INIT([gmyth-upnp],[0.7.1])
     2.9  
    2.10  AC_CONFIG_SRCDIR([src/gmyth_upnp.c])
    2.11  AC_CONFIG_HEADER(config.h)
     3.1 --- a/gmyth-upnp/gmyth-upnp.pc.in	Thu Feb 14 16:13:51 2008 +0000
     3.2 +++ b/gmyth-upnp/gmyth-upnp.pc.in	Fri Feb 15 13:52:23 2008 +0000
     3.3 @@ -5,8 +5,8 @@
     3.4  
     3.5  Name: gmyth-upnp
     3.6  Description: Myth TV upnp library based upon GLib/GObject paradigm
     3.7 -Version: @VERSION@
     3.8 -Requires: gobject-2.0 glib-2.0 clinkc
     3.9 +Version: 0.7.1
    3.10 +Requires: gobject-2.0 glib-2.0 libupnp
    3.11  
    3.12  Libs: @LIBGMYTH_LIBS@ -L${libdir} -lgmythupnp
    3.13  Cflags: @LIBGMYTH_CFLAGS@ -I${includedir}/gmyth-upnp
     4.1 --- a/gmyth-upnp/src/gmyth_upnp.c	Thu Feb 14 16:13:51 2008 +0000
     4.2 +++ b/gmyth-upnp/src/gmyth_upnp.c	Fri Feb 15 13:52:23 2008 +0000
     4.3 @@ -212,6 +212,31 @@
     4.4          g_warning ("Fail to start upnp listener: %d", ret);
     4.5  }
     4.6  
     4.7 +static void
     4.8 +_fill_servers_cb (gpointer key,
     4.9 +                  gpointer value,
    4.10 +                  gpointer user_data)
    4.11 +{
    4.12 +    GList **lst;
    4.13 +
    4.14 +    lst = (GList **) user_data;
    4.15 +
    4.16 +    *lst = g_list_append (*lst, g_object_ref (value));
    4.17 +}
    4.18 +
    4.19 +GList*
    4.20 +gmyth_upnp_get_devices (GMythUPnP *self)
    4.21 +{
    4.22 +    GMythUPnPPrivate *priv;
    4.23 +    GList *lst;
    4.24 +
    4.25 +    priv = GMYTH_UPNP_GET_PRIVATE (self);
    4.26 +    lst = NULL;
    4.27 +    g_hash_table_foreach (priv->servers, (GHFunc) _fill_servers_cb, &lst);
    4.28 +
    4.29 +    return lst;
    4.30 +}
    4.31 +
    4.32  static gboolean
    4.33  _idle_emit_device_found_signal (gpointer data)
    4.34  {
    4.35 @@ -329,7 +354,6 @@
    4.36                                   g_strdup (uuid),
    4.37                                   g_object_ref (info));
    4.38              g_mutex_unlock (priv->mutex);
    4.39 -            g_debug ("info url: %s", info_url);
    4.40              g_free (info_url);
    4.41  
    4.42              idle_data = g_new0 (GMythUPnPIdleData, 1);
    4.43 @@ -403,11 +427,9 @@
    4.44  
    4.45              d_event = (struct Upnp_Discovery *) e;
    4.46  
    4.47 -            g_debug ("TYPE: %s", d_event->ServiceType);
    4.48 -
    4.49              if (strcmp (d_event->ServiceType, UPNP_SERVICE_FILTER) != 0)
    4.50              {
    4.51 -                g_debug ("invalid device : %s", d_event->DeviceId);
    4.52 +                g_warning ("invalid device : %s", d_event->DeviceId);
    4.53                  break;
    4.54              }
    4.55  
    4.56 @@ -446,7 +468,6 @@
    4.57  
    4.58          }
    4.59          default:
    4.60 -            g_debug ("No handle event: %d", e_type);
    4.61              break;
    4.62      }
    4.63  
     5.1 --- a/gmyth-upnp/src/gmyth_upnp.h	Thu Feb 14 16:13:51 2008 +0000
     5.2 +++ b/gmyth-upnp/src/gmyth_upnp.h	Fri Feb 15 13:52:23 2008 +0000
     5.3 @@ -77,6 +77,7 @@
     5.4  GType               gmyth_upnp_get_type         (void);
     5.5  GMythUPnP*          gmyth_upnp_get_instance     (void);
     5.6  void                gmyth_upnp_search           (GMythUPnP * gmyth_upnp);
     5.7 +GList*              gmyth_upnp_get_devices      (GMythUPnP * gmyth_upnp);
     5.8  
     5.9  G_END_DECLS
    5.10  #endif                          /* _GMYTH_UPNP_H_ */