(this.get_current_connection_info_cb);
}
+ public virtual string get_current_protocol_info () {
+ return "";
+ }
+
private void query_source_protocol_info_cb (Service cm,
string var,
ref Value val) {
this.av_transport_id,
"ProtocolInfo",
typeof (string),
- "",
+ this.get_current_protocol_info (),
"PeerConnectionManager",
typeof (string),
"",
return double.parse (rational[0]) / double.parse (rational[1]);
}
+
+ /// Return the protocol info of the current track's meta-data
+ public string protocol_info {
+ owned get {
+ if (this.metadata == null || this.uri == null) {
+ return "";
+ }
+
+ // Parse meta-data
+ var p = new GUPnP.DIDLLiteParser ();
+ GUPnP.DIDLLiteObject item = null;
+
+ p.item_available.connect ( (object) => { item = object; });
+ try {
+ p.parse_didl (this.metadata);
+ } catch (Error error) {
+ return "";
+ }
+
+ var resources = item.get_resources ();
+ foreach (var resource in resources) {
+ if (resource.uri == this.uri) {
+ return resource.protocol_info.to_string ();
+ }
+ }
+
+ return "";
+ }
+ }
}
var plugin = this.root_device.resource_factory as MediaRendererPlugin;
this.sink_protocol_info = plugin.get_protocol_info ();
}
+
+ public override string get_current_protocol_info () {
+ var plugin = this.root_device.resource_factory as MediaRendererPlugin;
+ var player = plugin.get_player ();
+
+ return player.protocol_info;
+ }
}