[rygel] core,playbin,mpris: Relay meta-data to player



commit 20ac91041ae1d7a77f2a9744c58d6d788a459090
Author: Jens Georg <mail jensge org>
Date:   Fri May 11 16:33:11 2012 +0200

    core,playbin,mpris: Relay meta-data to player

 src/plugins/mpris/rygel-mpris-player.vala     |    4 +++
 src/plugins/playbin/rygel-playbin-player.vala |   33 +++++++++++++++++++++++++
 src/rygel/rygel-av-transport.vala             |    9 +++++++
 src/rygel/rygel-media-player.vala             |    3 ++
 4 files changed, 49 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/mpris/rygel-mpris-player.vala b/src/plugins/mpris/rygel-mpris-player.vala
index 324b368..9935e09 100644
--- a/src/plugins/mpris/rygel-mpris-player.vala
+++ b/src/plugins/mpris/rygel-mpris-player.vala
@@ -83,6 +83,10 @@ public class Rygel.MPRIS.Player : GLib.Object, Rygel.MediaPlayer {
         }
     }
 
+    public string? mime_type { owned get; set; }
+    public string? metadata { owned get; set; }
+    public string? content_features { owned get; set; }
+
     public double volume {
         get {
             return this.actual_player.volume;
diff --git a/src/plugins/playbin/rygel-playbin-player.vala b/src/plugins/playbin/rygel-playbin-player.vala
index c37c94b..e7df98e 100644
--- a/src/plugins/playbin/rygel-playbin-player.vala
+++ b/src/plugins/playbin/rygel-playbin-player.vala
@@ -98,6 +98,39 @@ public class Rygel.Playbin.Player : GLib.Object, Rygel.MediaPlayer {
         }
     }
 
+    private string _mime_type = "";
+    public string? mime_type {
+        owned get {
+            return this._mime_type;
+        }
+
+        set {
+            this._mime_type = value;
+        }
+    }
+
+    private string _metadata = "";
+    public string? metadata {
+        owned get {
+            return this._metadata;
+        }
+
+        set {
+            this._metadata = value;
+        }
+    }
+
+    private string _content_features = "";
+    public string? content_features {
+        owned get {
+            return this._content_features;
+        }
+
+        set {
+            this.content_features = value;
+        }
+    }
+
     public double volume {
         get {
             return this.playbin.volume;
diff --git a/src/rygel/rygel-av-transport.vala b/src/rygel/rygel-av-transport.vala
index f8e40ce..fd30173 100644
--- a/src/rygel/rygel-av-transport.vala
+++ b/src/rygel/rygel-av-transport.vala
@@ -264,6 +264,15 @@ internal class Rygel.AVTransport : Service {
 
                         return;
                     }
+                    this.player.mime_type = mime;
+                    var features = msg.response_headers.get_one
+                                        ("contentFeatures.dlna.org");
+
+                    if (features != null) {
+                        this.player.content_features = features;
+                    } else {
+                        this.player.content_features = "*";
+                    }
 
                     this.uri = _uri;
                     this.n_tracks = 1;
diff --git a/src/rygel/rygel-media-player.vala b/src/rygel/rygel-media-player.vala
index b4165cb..c139cfb 100644
--- a/src/rygel/rygel-media-player.vala
+++ b/src/rygel/rygel-media-player.vala
@@ -28,6 +28,9 @@ public interface Rygel.MediaPlayer : GLib.Object {
     public abstract string? uri { owned get; set; }
     public abstract double volume { get; set; }
     public abstract int64 duration { get; }
+    public abstract string? metadata { owned get; set; }
+    public abstract string? mime_type { owned get; set; }
+    public abstract string? content_features { owned get; set; }
     public string duration_as_str {
         owned get {
             return GstUtils.time_to_string ((ClockTime) this.duration);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]