core: Dump encodebin profile in transcoder
authorJens Georg <mail@jensge.org>
Sun, 4 Dec 2011 11:01:31 +0000 (12:01 +0100)
committerJens Georg <mail@jensge.org>
Sun, 4 Dec 2011 11:04:11 +0000 (12:04 +0100)
src/rygel/rygel-audio-transcoder.vala
src/rygel/rygel-gst-utils.vala
src/rygel/rygel-transcoder.vala
src/rygel/rygel-video-transcoder.vala

index 6a299b2..0b45be5 100644 (file)
@@ -98,6 +98,7 @@ internal class Rygel.AudioTranscoder : Rygel.Transcoder {
                                                           null,
                                                           null,
                                                           1);
+        enc_audio_profile.set_name ("audio");
 
         if (this.container_format != null) {
             var enc_container_profile = new EncodingContainerProfile ("container",
index 2585eb2..47b36f1 100644 (file)
@@ -92,6 +92,23 @@ internal abstract class Rygel.GstUtils {
         return get_best_depay (features, caps);
     }
 
+    public static void dump_encoding_profile (EncodingProfile profile,
+                                              int             indent = 0) {
+        var indent_s = string.nfill (indent, ' ');
+        debug (indent_s + "Dumping %s", profile.get_name ());
+        debug (indent_s + "  Format: %s", profile.get_format ().to_string ());
+        if (profile.get_restriction () != null) {
+            debug (indent_s + "  Restriction: %s",
+                   profile.get_restriction ().to_string ());
+        }
+
+        if (profile is EncodingContainerProfile) {
+        foreach (var subprofile in (profile as EncodingContainerProfile).get_profiles ()) {
+            dump_encoding_profile (subprofile, indent + 4);
+        }
+        }
+    }
+
     private static bool need_rtp_depayloader (Caps caps) {
         var structure = caps.get_structure (0);
         return structure.get_name () == "application/x-rtp";
index 9620ae2..92e0f5a 100644 (file)
@@ -69,6 +69,7 @@ internal abstract class Rygel.Transcoder : GLib.Object {
                                                 ENCODE_BIN);
 
         encoder.profile = this.get_encoding_profile ();
+        GstUtils.dump_encoding_profile (encoder.profile);
 
         var bin = new Bin ("transcoder-source");
         bin.add_many (src, decoder, encoder);
index 0b33bab..0639cab 100644 (file)
@@ -96,6 +96,7 @@ internal class Rygel.VideoTranscoder : Rygel.AudioTranscoder {
                                          null,
                                          this.video_restrictions,
                                          1);
+        enc_video_profile.set_name ("video");
 
         enc_container_profile.add_profile (enc_video_profile);