[rygel] gst-launch: Add option to set the DLNA profile



commit f2fa0470cc948777edb07fbf3ef155ad5d9caaf0
Author: Jens Georg <mail jensge org>
Date:   Thu Apr 26 19:31:35 2012 +0200

    gst-launch: Add option to set the DLNA profile

 doc/man/rygel.conf.xml                             |    8 +++++
 .../rygel-gst-launch-root-container.vala           |   34 ++++++++++++++------
 2 files changed, 32 insertions(+), 10 deletions(-)
---
diff --git a/doc/man/rygel.conf.xml b/doc/man/rygel.conf.xml
index bc862ae..82c000a 100644
--- a/doc/man/rygel.conf.xml
+++ b/doc/man/rygel.conf.xml
@@ -475,6 +475,14 @@ man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/
             </citerefentry>.</para>
         </listitem>
       </varlistentry>
+      <varlistentry>
+        <term>
+          <option>identifier-dlnaprofile</option>
+        </term>
+        <listitem>
+            <para>DLNA profile for the stream.</para>
+        </listitem>
+      </varlistentry>
     </variablelist>
     <para>An example configuration is available in the distributed configuration file <filename>/etc/&dhucpackage;</filename>.</para>
   </refsect1>
diff --git a/src/plugins/gst-launch/rygel-gst-launch-root-container.vala b/src/plugins/gst-launch/rygel-gst-launch-root-container.vala
index e032737..897e97c 100644
--- a/src/plugins/gst-launch/rygel-gst-launch-root-container.vala
+++ b/src/plugins/gst-launch/rygel-gst-launch-root-container.vala
@@ -57,19 +57,33 @@ public class Rygel.GstLaunch.RootContainer : SimpleContainer {
                                                "%s-mime".printf (name));
             var launch_line = config.get_string (CONFIG_GROUP,
                                                  "%s-launch".printf (name));
+            string dlna_profile = null;
+            MediaItem item;
+            try {
+                dlna_profile = config.get_string (CONFIG_GROUP,
+                                                  "%s-dlnaprofile".printf
+                                                  (name));
+            } catch (Error error) {}
 
             if (mime_type.has_prefix ("audio")) {
-                this.add_child_item (new AudioItem (name,
-                                                    this,
-                                                    title,
-                                                    mime_type,
-                                                    launch_line));
+                item = new AudioItem (name,
+                                      this,
+                                      title,
+                                      mime_type,
+                                      launch_line);
             } else {
-                this.add_child_item (new VideoItem (name,
-                                                    this,
-                                                    title,
-                                                    mime_type,
-                                                    launch_line));
+                item = new VideoItem (name,
+                                      this,
+                                      title,
+                                      mime_type,
+                                      launch_line);
+            }
+
+            if (item != null) {
+                if (dlna_profile != null) {
+                    item.dlna_profile = dlna_profile;
+                }
+                this.add_child_item (item);
             }
         } catch (GLib.Error err) {
             debug ("GstLaunch failed item '%s': %s", name, err.message);



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