mediaserver proxy constructor
authorLuc Yriarte <luc.yriarte@intel.com>
Tue, 23 Jul 2013 14:18:35 +0000 (16:18 +0200)
committerLuc Yriarte <luc.yriarte@intel.com>
Tue, 23 Jul 2013 14:18:35 +0000 (16:18 +0200)
src/MediaServer/MediaServer.cpp

index 5f96055..370d5fc 100644 (file)
@@ -110,6 +110,24 @@ void MediaServer::addEventListener(std::string property, EventMediaServerPropert
        */
 void MediaServer::setProxyPath(std::string path)
 {
+       if (proxy)
+               /* free upn_pdevice proxy */
+               g_object_unref(proxy);
+
+       GError* gerror = NULL;
+       proxy = upn_pdevice__proxy_new_for_bus_sync(G_BUS_TYPE_SESSION,
+                               G_DBUS_PROXY_FLAGS_NONE,
+                               "com.intel.dleyna-server",
+                               path.c_str(),
+                               NULL, /* GCancellable */
+                               &gerror);
+
+       if (gerror) {
+               LoggerD(gerror->message);
+               g_error_free(gerror);
+               return;
+       }
+
 }