[rygel] renderer-gst: Make sinks configurable



commit 9a1a5b0f35286db2d64fc687378faf70cf51556a
Author: Jens Georg <mail jensge org>
Date:   Thu Oct 11 20:22:46 2018 +0200

    renderer-gst: Make sinks configurable

 data/rygel.conf                                    |  2 ++
 doc/man/rygel.conf.xml                             | 19 +++++++++++++++-
 .../rygel-playbin-player.vala                      | 26 ++++++++++++++++++++++
 3 files changed, 46 insertions(+), 1 deletion(-)
---
diff --git a/data/rygel.conf b/data/rygel.conf
index 3225dbbc..57873196 100644
--- a/data/rygel.conf
+++ b/data/rygel.conf
@@ -118,6 +118,8 @@ virtual-folders=true
 [Playbin]
 enabled=true
 title=Audio/Video playback on @PRETTY_HOSTNAME@
+#audio-sink=autoaudiosink
+#video-sink=fakesink
 
 [GstLaunch]
 enabled=false
diff --git a/doc/man/rygel.conf.xml b/doc/man/rygel.conf.xml
index 8da7c3db..1789e208 100644
--- a/doc/man/rygel.conf.xml
+++ b/doc/man/rygel.conf.xml
@@ -441,7 +441,24 @@ man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/
   <refsect1>
     <title>Playbin plugin</title>
     <para>The Playbin plugin implements a media renderer (Digtal Media Renderer, DMR in DLNA terms). This 
plugin was known as GstRenderer.</para>
-    <para>This plugin has no special options.</para>
+    <para>It is highly recommended to leave the sink choice to playbin. If, however, the default choices 
don&apos;t work for you they can be reconfigured as follows</para>
+    <variablelist>
+       <varlistentry>
+        <term>
+          <option>audio-sink</option>
+        </term>
+        <listitem>
+          <para>Definition of the audio sink to use. Can be a single element or a partial pipeline 
definition in gst-launch&aps;s syntax</para>
+        </listitem>
+      </varlistentry>
+       <varlistentry>
+        <term>
+          <option>video-sink</option>
+        </term>
+        <listitem>
+          <para>Definition of the video sink to use. Can be a single element or a partial pipeline 
definition in gst-launch&aps;s syntax</para>
+        </listitem>
+      </varlistentry>   </variablelist>
   </refsect1>
   <refsect1>
     <title>LightMediaScanner Plugin</title>
diff --git a/src/librygel-renderer-gst/rygel-playbin-player.vala 
b/src/librygel-renderer-gst/rygel-playbin-player.vala
index 1b7b2420..f8a4f90a 100644
--- a/src/librygel-renderer-gst/rygel-playbin-player.vala
+++ b/src/librygel-renderer-gst/rygel-playbin-player.vala
@@ -629,6 +629,32 @@ public class Rygel.Playbin.Player : GLib.Object, Rygel.MediaPlayer {
     }
 
     private void setup_playbin () {
+        try {
+            var config = MetaConfig.get_default ();
+            var sink_launch = config.get_string ("Playbin", "audio-sink");
+            debug ("Trying to parse audio sink %s", sink_launch);
+            var sink = Gst.parse_bin_from_description (sink_launch,
+                                                       true,
+                                                       null,
+                                                       ParseFlags.FATAL_ERRORS);
+            this.playbin.audio_sink = sink;
+        } catch (Error error) {
+           debug ("No audio sink configured, using default: %s", error.message);
+        }
+
+        try {
+            var config = MetaConfig.get_default ();
+            var sink_launch = config.get_string ("Playbin", "video-sink");
+            debug ("Trying to parse video sink %s", sink_launch);
+            var sink = Gst.parse_bin_from_description (sink_launch,
+                                                       true,
+                                                       null,
+                                                       ParseFlags.FATAL_ERRORS);
+            this.playbin.video_sink = sink;
+        } catch (Error error) {
+           debug ("No video sink configured, using default: %s", error.message);
+        }
+
         // Needed to get "Stop" events from the playbin.
         // We can do this because we have a bus watch
         this.playbin.auto_flush_bus = false;


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