[rygel] core: GetProtocolInfo should utilize gupnp-dlna
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] core: GetProtocolInfo should utilize gupnp-dlna
- Date: Mon, 16 Aug 2010 20:42:08 +0000 (UTC)
commit 678e7123abb88fea79fdd8d2fc00146c79ad6b25
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Mon Aug 16 23:33:56 2010 +0300
core: GetProtocolInfo should utilize gupnp-dlna
GetProtocolInfo action for MediaServer should list all DLNA profiles
covered by gupnp-dlna.
src/rygel/rygel-source-connection-manager.vala | 24 +++++++++++++++++++++---
1 files changed, 21 insertions(+), 3 deletions(-)
---
diff --git a/src/rygel/rygel-source-connection-manager.vala b/src/rygel/rygel-source-connection-manager.vala
index 1990b43..2e83b6f 100644
--- a/src/rygel/rygel-source-connection-manager.vala
+++ b/src/rygel/rygel-source-connection-manager.vala
@@ -22,6 +22,7 @@
*/
using GUPnP;
+using Gst;
/**
* UPnP ConnectionManager service for serving end-points (MediaServer).
@@ -34,10 +35,27 @@ internal class Rygel.SourceConnectionManager : Rygel.ConnectionManager {
this.av_transport_id = -1;
this.direction = "Output";
- this.source_protocol_info = "";
-
var server = this.get_http_server ();
- foreach (var protocol_info in server.get_protocol_info ()) {
+ var protocol_infos = server.get_protocol_info ();
+
+ var discoverer = new GUPnP.DLNADiscoverer ((ClockTime) SECOND,
+ true,
+ false);
+ var protocol = server.get_protocol ();
+
+ foreach (var profile in discoverer.list_profiles ()) {
+ var protocol_info = new ProtocolInfo ();
+
+ protocol_info.protocol = protocol;
+ protocol_info.mime_type = profile.mime;
+ protocol_info.dlna_profile = profile.name;
+
+ if (!(protocol_info in protocol_infos)) {
+ protocol_infos.insert (0, protocol_info);
+ }
+ }
+
+ foreach (var protocol_info in protocol_infos) {
if (this.source_protocol_info != "") {
// No comma before the first one
this.source_protocol_info += ",";
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]