[rygel] core: Re-Add X_MS_MediaReceiverRegistrar service
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] core: Re-Add X_MS_MediaReceiverRegistrar service
- Date: Mon, 22 Mar 2010 17:06:15 +0000 (UTC)
commit abe0d34831b880de773c41ba7fbde037ab94d3ac
Author: Jens Georg <mail jensge org>
Date: Mon Mar 8 09:52:36 2010 +0100
core: Re-Add X_MS_MediaReceiverRegistrar service
This serice is needed for XBox360
data/xml/Makefile.am | 3 +-
data/xml/X_MS_MediaReceiverRegistrar1.xml | 96 +++++++++++++++++++++++++
src/rygel/Makefile.am | 1 +
src/rygel/rygel-media-receiver-registrar.vala | 58 +++++++++++++++
src/rygel/rygel-plugin.vala | 6 ++
5 files changed, 163 insertions(+), 1 deletions(-)
---
diff --git a/data/xml/Makefile.am b/data/xml/Makefile.am
index 1883aee..3963648 100644
--- a/data/xml/Makefile.am
+++ b/data/xml/Makefile.am
@@ -3,7 +3,8 @@ xml_DATA = MediaServer2.xml \
ContentDirectory.xml \
ConnectionManager.xml \
AVTransport2.xml \
- RenderingControl2.xml
+ RenderingControl2.xml \
+ X_MS_MediaReceiverRegistrar1.xml
xmldir = $(datadir)/rygel/xml
diff --git a/data/xml/X_MS_MediaReceiverRegistrar1.xml b/data/xml/X_MS_MediaReceiverRegistrar1.xml
new file mode 100644
index 0000000..c862c1d
--- /dev/null
+++ b/data/xml/X_MS_MediaReceiverRegistrar1.xml
@@ -0,0 +1,96 @@
+<?xml version="1.0"?>
+<scpd xmlns="urn:schemas-upnp-org:service-1-0">
+ <specVersion>
+ <major>1</major>
+ <minor>0</minor>
+ </specVersion>
+ <actionList>
+ <action>
+ <name>IsAuthorized</name>
+ <argumentList>
+ <argument>
+ <name>DeviceID</name>
+ <direction>in</direction>
+ <relatedStateVariable>A_ARG_TYPE_DeviceID</relatedStateVariable>
+ </argument>
+ <argument>
+ <name>Result</name>
+ <direction>out</direction>
+ <relatedStateVariable>A_ARG_TYPE_Result</relatedStateVariable>
+ </argument>
+ </argumentList>
+ </action>
+ <action>
+ <name>RegisterDevice</name>
+ <argumentList>
+ <argument>
+ <name>RegistrationReqMsg</name>
+ <direction>in</direction>
+ <relatedStateVariable>A_ARG_TYPE_RegistrationReqMsg</relatedStateVariable>
+ </argument>
+ <argument>
+ <name>RegistrationRespMsg</name>
+ <direction>out</direction>
+ <relatedStateVariable>A_ARG_TYPE_RegistrationRespMsg</relatedStateVariable>
+ </argument>
+ </argumentList>
+ </action>
+ <action>
+ <name>IsValidated</name>
+ <argumentList>
+ <argument>
+ <name>DeviceID</name>
+ <direction>in</direction>
+ <relatedStateVariable>A_ARG_TYPE_DeviceID</relatedStateVariable>
+ </argument>
+ <argument>
+ <name>Result</name>
+ <direction>out</direction>
+ <relatedStateVariable>A_ARG_TYPE_Result</relatedStateVariable>
+ </argument>
+ </argumentList>
+ </action>
+ </actionList>
+ <serviceStateTable>
+ <stateVariable>
+ <name>A_ARG_TYPE_DeviceID</name>
+ <sendEventsAttribute>no</sendEventsAttribute>
+ <dataType>string</dataType>
+ </stateVariable>
+ <stateVariable>
+ <name>A_ARG_TYPE_Result</name>
+ <sendEventsAttribute>no</sendEventsAttribute>
+ <dataType>int</dataType>
+ </stateVariable>
+ <stateVariable>
+ <name>A_ARG_TYPE_RegistrationReqMsg</name>
+ <sendEventsAttribute>no</sendEventsAttribute>
+ <dataType>bin.base64</dataType>
+ </stateVariable>
+ <stateVariable>
+ <name>A_ARG_TYPE_RegistrationRespMsg</name>
+ <sendEventsAttribute>no</sendEventsAttribute>
+ <dataType>bin.base64</dataType>
+ </stateVariable>
+ <stateVariable>
+ <name>AuthorizationGrantedUpdateID</name>
+ <sendEventsAttribute>no</sendEventsAttribute>
+ <dataType>ui4</dataType>
+ </stateVariable>
+ <stateVariable>
+ <name>AuthorizationDeniedUpdateID</name>
+ <sendEventsAttribute>no</sendEventsAttribute>
+ <dataType>ui4</dataType>
+ </stateVariable>
+ <stateVariable>
+ <name>ValidationSucceededUpdateID</name>
+ <sendEventsAttribute>no</sendEventsAttribute>
+ <dataType>ui4</dataType>
+ </stateVariable>
+ <stateVariable>
+ <name>ValidationRevokedUpdateID</name>
+ <sendEventsAttribute>no</sendEventsAttribute>
+ <dataType>ui4</dataType>
+ </stateVariable>
+ </serviceStateTable>
+</scpd>
diff --git a/src/rygel/Makefile.am b/src/rygel/Makefile.am
index 37e9c84..395a8a3 100644
--- a/src/rygel/Makefile.am
+++ b/src/rygel/Makefile.am
@@ -96,6 +96,7 @@ VAPI_SOURCE_FILES = rygel-configuration.vala \
rygel-metadata-extractor.vala \
rygel-media-db-container.vala \
rygel-media-db-object-factory.vala \
+ rygel-media-receiver-registrar.vala \
rygel-log-handler.vala
rygel_VALAFLAGS = \
diff --git a/src/rygel/rygel-media-receiver-registrar.vala b/src/rygel/rygel-media-receiver-registrar.vala
new file mode 100644
index 0000000..3772c21
--- /dev/null
+++ b/src/rygel/rygel-media-receiver-registrar.vala
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2008 Zeeshan Ali <zeenix gmail com>.
+ *
+ * Author: Zeeshan Ali <zeenix gmail com>
+ *
+ * This file is part of Rygel.
+ *
+ * Rygel is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Rygel is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+using GUPnP;
+
+/**
+ * Basic implementation of MS MediaReceiverRegistrar service version 1.
+ */
+public class Rygel.MediaReceiverRegistrar: Service {
+ public const string UPNP_ID =
+ "urn:microsoft.com:serviceId:X_MS_MediaReceiverRegistrar";
+ public const string UPNP_TYPE =
+ "urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1";
+ public const string DESCRIPTION_PATH =
+ "xml/X_MS_MediaReceiverRegistrar1.xml";
+
+ public override void constructed () {
+ this.action_invoked["IsAuthorized"] += this.is_authorized_cb;
+ this.action_invoked["IsValidated"] += this.is_authorized_cb;
+ this.action_invoked["RegisterDevice"] += this.register_device_cb;
+ }
+
+ /* IsAuthorized and IsValided action implementations (fake) */
+ private void is_authorized_cb (MediaReceiverRegistrar registrar,
+ owned ServiceAction action) {
+ action.set ("Result", typeof (int), 1);
+
+ action.return ();
+ }
+
+ private void register_device_cb (MediaReceiverRegistrar registrar,
+ owned ServiceAction action) {
+ action.set ("RegistrationRespMsg",
+ typeof (string),
+ "WhatisSupposedToBeHere");
+
+ action.return ();
+ }
+}
diff --git a/src/rygel/rygel-plugin.vala b/src/rygel/rygel-plugin.vala
index fa7dc8d..de0f93a 100644
--- a/src/rygel/rygel-plugin.vala
+++ b/src/rygel/rygel-plugin.vala
@@ -78,6 +78,12 @@ public class Rygel.Plugin : GUPnP.ResourceFactory {
ConnectionManager.UPNP_TYPE,
ConnectionManager.DESCRIPTION_PATH,
typeof (SourceConnectionManager));
+
+ this.add_resource (resource_info);
+ resource_info = new ResourceInfo (MediaReceiverRegistrar.UPNP_ID,
+ MediaReceiverRegistrar.UPNP_TYPE,
+ MediaReceiverRegistrar.DESCRIPTION_PATH,
+ typeof (MediaReceiverRegistrar));
this.add_resource (resource_info);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]