rygel r291 - trunk/src/media-server
- From: zeeshanak svn gnome org
- To: svn-commits-list gnome org
- Subject: rygel r291 - trunk/src/media-server
- Date: Tue, 25 Nov 2008 14:43:03 +0000 (UTC)
Author: zeeshanak
Date: Tue Nov 25 14:43:03 2008
New Revision: 291
URL: http://svn.gnome.org/viewvc/rygel?rev=291&view=rev
Log:
The service classes should know their upnp classes themselves.
Modified:
trunk/src/media-server/rygel-connection-manager.vala
trunk/src/media-server/rygel-content-directory.vala
trunk/src/media-server/rygel-media-receiver-registrar.vala
trunk/src/media-server/rygel-media-server.vala
Modified: trunk/src/media-server/rygel-connection-manager.vala
==============================================================================
--- trunk/src/media-server/rygel-connection-manager.vala (original)
+++ trunk/src/media-server/rygel-connection-manager.vala Tue Nov 25 14:43:03 2008
@@ -28,6 +28,9 @@
using GUPnP;
public class Rygel.ConnectionManager : Service {
+ public const string UPNP_CLASS =
+ "urn:schemas-upnp-org:service:ConnectionManager";
+
private string source_protocol_info;
private string sink_protocol_info;
private string connection_ids;
Modified: trunk/src/media-server/rygel-content-directory.vala
==============================================================================
--- trunk/src/media-server/rygel-content-directory.vala (original)
+++ trunk/src/media-server/rygel-content-directory.vala Tue Nov 25 14:43:03 2008
@@ -27,6 +27,8 @@
using GUPnP;
public class Rygel.ContentDirectory: Service {
+ public const string UPNP_CLASS =
+ "urn:schemas-upnp-org:service:ContentDirectory";
string feature_list;
DIDLLiteWriter didl_writer;
Modified: trunk/src/media-server/rygel-media-receiver-registrar.vala
==============================================================================
--- trunk/src/media-server/rygel-media-receiver-registrar.vala (original)
+++ trunk/src/media-server/rygel-media-receiver-registrar.vala Tue Nov 25 14:43:03 2008
@@ -25,6 +25,8 @@
using GUPnP;
public class Rygel.MediaReceiverRegistrar: Service {
+ public const string UPNP_CLASS =
+ "urn:microsoft.com:service:X_MS_MediaReceiverRegistrar";
public override void constructed () {
this.action_invoked["IsAuthorized"] += this.is_authorized_cb;
Modified: trunk/src/media-server/rygel-media-server.vala
==============================================================================
--- trunk/src/media-server/rygel-media-server.vala (original)
+++ trunk/src/media-server/rygel-media-server.vala Tue Nov 25 14:43:03 2008
@@ -29,21 +29,12 @@
using CStuff;
public class Rygel.MediaServer: RootDevice {
- public static const string CONTENT_DIR =
- "urn:schemas-upnp-org:service:ContentDirectory";
- public static const string CONNECTION_MANAGER =
- "urn:schemas-upnp-org:service:ConnectionManager";
- public static const string MEDIA_RECEIVER_REGISTRAR =
- "urn:microsoft.com:service:X_MS_MediaReceiverRegistrar";
-
public static const string DESC_DOC = "xml/description.xml";
public static const string XBOX_DESC_DOC = "xml/description-xbox360.xml";
public static const string MODIFIED_DESC_DOC = "gupnp-media-server.xml";
public static const string GCONF_PATH = "/apps/gupnp-media-server/";
- private ContentDirectory content_dir; /* ContentDirectory */
- private ConnectionManager cm; /* ConnectionManager */
- private MediaReceiverRegistrar msr; /* MS MediaReceiverRegistrar */
+ private List<ServiceInfo> services; /* Services we implement */
public MediaServer (GUPnP.Context context,
Xml.Doc description_doc,
@@ -57,28 +48,29 @@
ResourceFactory factory = this.resource_factory;
/* Register Rygel.ContentDirectory */
- factory.register_resource_type (CONTENT_DIR + ":1",
+ factory.register_resource_type (ContentDirectory.UPNP_CLASS + ":1",
typeof (ContentDirectory));
- factory.register_resource_type (CONTENT_DIR + ":2",
+ factory.register_resource_type (ContentDirectory.UPNP_CLASS + ":2",
typeof (ContentDirectory));
/* Register Rygel.ConnectionManager */
- factory.register_resource_type (CONNECTION_MANAGER + ":1",
+ factory.register_resource_type (ConnectionManager.UPNP_CLASS + ":1",
typeof (ConnectionManager));
- factory.register_resource_type (CONNECTION_MANAGER + ":2",
+ factory.register_resource_type (ConnectionManager.UPNP_CLASS + ":2",
typeof (ConnectionManager));
/* Register Rygel.MediaReceiverRegistrar */
- factory.register_resource_type (MEDIA_RECEIVER_REGISTRAR + ":1",
- typeof (MediaReceiverRegistrar));
- factory.register_resource_type (MEDIA_RECEIVER_REGISTRAR + ":2",
- typeof (MediaReceiverRegistrar));
+ factory.register_resource_type
+ (MediaReceiverRegistrar.UPNP_CLASS + ":1",
+ typeof (MediaReceiverRegistrar));
+ factory.register_resource_type
+ (MediaReceiverRegistrar.UPNP_CLASS + ":2",
+ typeof (MediaReceiverRegistrar));
/* Now create the sevice objects */
- this.content_dir = (ContentDirectory) this.get_service (CONTENT_DIR);
- this.cm = (ConnectionManager) this.get_service (CONNECTION_MANAGER);
- this.msr = (MediaReceiverRegistrar) this.get_service
- (MEDIA_RECEIVER_REGISTRAR);
+ services.append (this.get_service (ContentDirectory.UPNP_CLASS));
+ services.append (this.get_service (ConnectionManager.UPNP_CLASS));
+ services.append (this.get_service (MediaReceiverRegistrar.UPNP_CLASS));
}
public static int main (string[] args) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]