[rygel] renderer-gst: Use dlna+http[s] virtual protocol



commit 47fb964a887480c5898703e4c5b5e8493d74fd36
Author: Jens Georg <mail jensge org>
Date:   Thu Mar 20 22:15:18 2014 +0100

    renderer-gst: Use dlna+http[s] virtual protocol
    
    If the dlnasrc element is available, we try to use it for http and
    https protocols using it's virtual dlna+ protocol prefix.
    
    Signed-off-by: Jens Georg <mail jensge org>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=721817

 .../rygel-playbin-player.vala                      |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/src/librygel-renderer-gst/rygel-playbin-player.vala 
b/src/librygel-renderer-gst/rygel-playbin-player.vala
index bc4a6c2..b1c6b5d 100644
--- a/src/librygel-renderer-gst/rygel-playbin-player.vala
+++ b/src/librygel-renderer-gst/rygel-playbin-player.vala
@@ -89,6 +89,12 @@ public class Rygel.Playbin.Player : GLib.Object, Rygel.MediaPlayer {
                                         "video/x-xvid",
                                         "video/x-ms-wmv" };
     private static Player player;
+    private static bool has_dlna_src;
+
+    static construct {
+        Player.has_dlna_src = Gst.URI.protocol_is_supported (URIType.SRC,
+                                                             "dlna+http");
+    }
 
     public dynamic Element playbin { get; private set; }
 
@@ -191,7 +197,13 @@ public class Rygel.Playbin.Player : GLib.Object, Rygel.MediaPlayer {
         set {
             this._uri = value;
             this.playbin.set_state (State.READY);
-            this.playbin.uri = value;
+            if (Player.has_dlna_src && value.has_prefix ("http")) {
+                debug ("Trying to use DLNA src element");
+                this.playbin.uri = "dlna+" + value;
+            } else {
+                this.playbin.uri = value;
+            }
+
             if (value != "") {
                 this.guess_duration ();
                 switch (this._playback_state) {


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