[rygel] media-export: Use GUPnPDLNADiscoverer



commit 4f566a10508c608a943560f74e9a99a0e20b1c78
Author: Arun Raghavan <arun raghavan collabora co uk>
Date:   Tue Jun 1 14:31:26 2010 +0530

    media-export: Use GUPnPDLNADiscoverer
    
    Replaces the use of GstDiscoverer with GUPnPDLNADiscoverer. The same
    information is available, but we can now also use the DLNA profile name
    and MIME type.

 .../rygel-media-export-metadata-extractor.vala     |   28 ++++++++++----------
 1 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/src/plugins/media-export/rygel-media-export-metadata-extractor.vala b/src/plugins/media-export/rygel-media-export-metadata-extractor.vala
index 511e9dc..862342f 100644
--- a/src/plugins/media-export/rygel-media-export-metadata-extractor.vala
+++ b/src/plugins/media-export/rygel-media-export-metadata-extractor.vala
@@ -49,7 +49,7 @@ public class Rygel.MediaExport.MetadataExtractor: GLib.Object {
      */
     public signal void error (File file, Error err);
 
-    private Gst.Discoverer discoverer;
+    private GUPnP.DLNADiscoverer discoverer;
     /**
      * We export a GLib.File-based API but GstDiscoverer works with URIs, so
      * we store uri->GLib.File mappings in this hashmap, so that we can get
@@ -83,9 +83,9 @@ public class Rygel.MediaExport.MetadataExtractor: GLib.Object {
 
         this.file_hash = new HashMap<string, File> ();
 
-        this.discoverer = new Gst.Discoverer ((ClockTime)
+        this.discoverer = new GUPnP.DLNADiscoverer ((ClockTime)
                                               (this.timeout * 1000000000ULL));
-        this.discoverer.discovered.connect (on_discovered);
+        this.discoverer.done.connect (on_done);
         this.discoverer.start ();
     }
 
@@ -93,33 +93,33 @@ public class Rygel.MediaExport.MetadataExtractor: GLib.Object {
         this.discoverer.stop ();
     }
 
-    private void on_discovered (owned Gst.DiscovererInformation info,
-                                GLib.Error                      err) {
-        assert (this.file_hash.has_key (info.uri));
+    private void on_done (GUPnP.DLNAProfile profile,
+                          GLib.Error        err) {
+        assert (this.file_hash.has_key (profile.info.uri));
 
-        File file = this.file_hash.get (info.uri);
+        File file = this.file_hash.get (profile.info.uri);
         TagList tag_list = new TagList ();
 
-        this.file_hash.unset (info.uri);
+        this.file_hash.unset (profile.info.uri);
 
-        if ((info.result & Gst.DiscovererResult.TIMEOUT) != 0) {
+        if ((profile.info.result & Gst.DiscovererResult.TIMEOUT) != 0) {
             this.error (file,
                         new IOChannelError.FAILED ("Pipeline stuckwhile" +
                                                    "reading file info"));
             return;
-        } else if ((info.result & Gst.DiscovererResult.ERROR) != 0) {
+        } else if ((profile.info.result & Gst.DiscovererResult.ERROR) != 0) {
             this.error (file, err);
             return;
         }
 
         try {
             this.extract_mime_and_size (file, tag_list);
-            this.extract_duration (info, tag_list);
-            this.extract_stream_info (info, tag_list);
+            this.extract_duration (profile.info, tag_list);
+            this.extract_stream_info (profile.info, tag_list);
             this.extraction_done (file, tag_list);
         } catch (Error e) {
             debug ("Unable to extract metadata for %s: %s\n",
-                   info.uri,
+                   profile.info.uri,
                    err.message);
         }
     }
@@ -127,7 +127,7 @@ public class Rygel.MediaExport.MetadataExtractor: GLib.Object {
     public void extract (File file) {
         string uri = file.get_uri ();
         this.file_hash.set (uri, file);
-        this.discoverer.append_uri (uri);
+        this.discoverer.discover_uri (uri);
     }
 
     private void extract_mime_and_size (File    file,



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