"urn:schemas-upnp-org:service:ConnectionManager:2";
public const string DESCRIPTION_PATH = "xml/ConnectionManager.xml";
- protected string source_protocol_info;
protected string sink_protocol_info;
protected string connection_ids;
+ private TranscodeManager? get_transcode_manager () {
+ var root_device = (Rygel.RootDevice) this.root_device;
+
+ // Find the ContentDirectory service attached to this root device.
+ foreach (var service in root_device.services) {
+ if (service.get_type().is_a (typeof (Rygel.ContentDirectory))) {
+ var content_directory = (Rygel.ContentDirectory) service;
+ return (TranscodeManager) content_directory.http_server;
+ }
+ }
+ return null;
+ }
+
+ protected string source_protocol_info {
+ owned get {
+ string protocol_info = "http-get:*:*:*";
+ TranscodeManager tm = get_transcode_manager ();
+
+ if (tm != null) {
+ protocol_info += tm.get_transcoder_protocol_info ();
+ }
+ return protocol_info;
+ }
+ }
+
public override void constructed () {
this.sink_protocol_info = "";
this.connection_ids = "0";
- this.source_protocol_info = "http-get:*:*:*";
this.query_variable["SourceProtocolInfo"] +=
this.query_source_protocol_info_cb;
* Represents a Root device.
*/
public class Rygel.RootDevice: GUPnP.RootDevice {
- private ArrayList<ServiceInfo> services; /* Services we implement */
+ internal ArrayList<ServiceInfo> services; /* Services we implement */
public RootDevice (GUPnP.Context context,
Plugin plugin,
return transcoder;
}
+
+ public string get_transcoder_protocol_info () {
+ string protocol_info = "";
+
+ foreach (var transcoder in this.transcoders) {
+ protocol_info += ",http-get:*:%s:DLNA.ORG_PN=%s".printf (
+ transcoder.mime_type, transcoder.dlna_profile);
+ }
+ return protocol_info;
+ }
}