[rygel] core: use playbin2 for meta-data if available



commit 523854978901e4bab1bded458a49b7b699bc36cf
Author: Jens Georg <mail jensge org>
Date:   Fri Sep 18 15:48:11 2009 +0200

    core: use playbin2 for meta-data if available

 src/rygel/rygel-metadata-extractor.vala |   26 ++++++++++----------------
 1 files changed, 10 insertions(+), 16 deletions(-)
---
diff --git a/src/rygel/rygel-metadata-extractor.vala b/src/rygel/rygel-metadata-extractor.vala
index 6c476f0..4f71816 100644
--- a/src/rygel/rygel-metadata-extractor.vala
+++ b/src/rygel/rygel-metadata-extractor.vala
@@ -87,7 +87,11 @@ public class Rygel.MetadataExtractor: GLib.Object {
         this.register_custom_tag (TAG_RYGEL_MTIME, typeof (uint64));
 
         // setup fake sinks
-        this.playbin = ElementFactory.make ("playbin", null);
+        this.playbin = ElementFactory.make ("playbin2", null);
+        if (this.playbin == null) {
+            this.playbin = ElementFactory.make ("playbin", null);
+        }
+
         this.fakesinks = new Gst.Element[2];
         this.fakesinks[0] = ElementFactory.make ("fakesink", null);
         this.fakesinks[1] = ElementFactory.make ("fakesink", null);
@@ -237,22 +241,13 @@ public class Rygel.MetadataExtractor: GLib.Object {
     }
 
     private void extract_stream_info () {
-        weak GLib.List <dynamic GLib.Object> stream_info = null;
-
-        stream_info = this.playbin.stream_info;
-        return_if_fail (stream_info != null);
-
-        foreach (var info in stream_info) {
-            if (info == null) {
-                continue;
-            }
-
-            extract_av_info (info);
-        }
+        extract_av_info (this.fakesinks[0].get_pad ("sink"),
+                StreamType.VIDEO);
+        extract_av_info (this.fakesinks[1].get_pad ("sink"),
+                StreamType.AUDIO);
     }
 
-    private void extract_av_info (dynamic GLib.Object info) {
-        Pad pad = (Pad) info.object;
+    private void extract_av_info (Pad pad, StreamType type) {
         if (pad == null) {
             return;
         }
@@ -267,7 +262,6 @@ public class Rygel.MetadataExtractor: GLib.Object {
             return;
         }
 
-        StreamType type = info.type;
         if (type == StreamType.AUDIO) {
             this.extract_audio_info (structure);
         } else if (type == StreamType.VIDEO) {



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