gst-launch: Add option to set the DLNA profile
authorJens Georg <mail@jensge.org>
Thu, 26 Apr 2012 17:31:35 +0000 (19:31 +0200)
committerJens Georg <mail@jensge.org>
Fri, 27 Apr 2012 18:11:47 +0000 (20:11 +0200)
doc/man/rygel.conf.xml
src/plugins/gst-launch/rygel-gst-launch-root-container.vala

index bc862ae..82c000a 100644 (file)
@@ -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>
index e032737..897e97c 100644 (file)
@@ -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);