gmyth-upnp/src/gmyth_upnp.c
branchtrunk
changeset 915 e612ba1d16ab
parent 909 847da7267234
child 922 04cd5e61dca3
     1.1 --- a/gmyth-upnp/src/gmyth_upnp.c	Fri Feb 01 22:17:33 2008 +0000
     1.2 +++ b/gmyth-upnp/src/gmyth_upnp.c	Fri Feb 15 13:52:23 2008 +0000
     1.3 @@ -212,6 +212,31 @@
     1.4          g_warning ("Fail to start upnp listener: %d", ret);
     1.5  }
     1.6  
     1.7 +static void
     1.8 +_fill_servers_cb (gpointer key,
     1.9 +                  gpointer value,
    1.10 +                  gpointer user_data)
    1.11 +{
    1.12 +    GList **lst;
    1.13 +
    1.14 +    lst = (GList **) user_data;
    1.15 +
    1.16 +    *lst = g_list_append (*lst, g_object_ref (value));
    1.17 +}
    1.18 +
    1.19 +GList*
    1.20 +gmyth_upnp_get_devices (GMythUPnP *self)
    1.21 +{
    1.22 +    GMythUPnPPrivate *priv;
    1.23 +    GList *lst;
    1.24 +
    1.25 +    priv = GMYTH_UPNP_GET_PRIVATE (self);
    1.26 +    lst = NULL;
    1.27 +    g_hash_table_foreach (priv->servers, (GHFunc) _fill_servers_cb, &lst);
    1.28 +
    1.29 +    return lst;
    1.30 +}
    1.31 +
    1.32  static gboolean
    1.33  _idle_emit_device_found_signal (gpointer data)
    1.34  {
    1.35 @@ -329,7 +354,6 @@
    1.36                                   g_strdup (uuid),
    1.37                                   g_object_ref (info));
    1.38              g_mutex_unlock (priv->mutex);
    1.39 -            g_debug ("info url: %s", info_url);
    1.40              g_free (info_url);
    1.41  
    1.42              idle_data = g_new0 (GMythUPnPIdleData, 1);
    1.43 @@ -403,11 +427,9 @@
    1.44  
    1.45              d_event = (struct Upnp_Discovery *) e;
    1.46  
    1.47 -            g_debug ("TYPE: %s", d_event->ServiceType);
    1.48 -
    1.49              if (strcmp (d_event->ServiceType, UPNP_SERVICE_FILTER) != 0)
    1.50              {
    1.51 -                g_debug ("invalid device : %s", d_event->DeviceId);
    1.52 +                g_warning ("invalid device : %s", d_event->DeviceId);
    1.53                  break;
    1.54              }
    1.55  
    1.56 @@ -446,7 +468,6 @@
    1.57  
    1.58          }
    1.59          default:
    1.60 -            g_debug ("No handle event: %d", e_type);
    1.61              break;
    1.62      }
    1.63