From 2448bf8b80f2ec356a57ecf341e7c005cecfc902 Mon Sep 17 00:00:00 2001 From: Stefan Sauer Date: Mon, 18 Oct 2010 17:14:46 +0300 Subject: [PATCH] info: enable discovered Add comment telling how to regenerate the vapi files. --- mediainfo/src/mi-info.vala | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/mediainfo/src/mi-info.vala b/mediainfo/src/mi-info.vala index 571503305c..51c76889d6 100644 --- a/mediainfo/src/mi-info.vala +++ b/mediainfo/src/mi-info.vala @@ -20,10 +20,19 @@ using Gtk; using Gst; +/* +we need to update the vapi for yet unreleased gstreamer api: + +cd vala/mediainfo/vapi +vala-gen-introspect gstreamer-pbutils-0.10 packages/gstreamer-pbutils-0.10 && ../vapigen/vapigen --vapidir . --library \ + gstreamer-pbutils-0.10 packages/gstreamer-pbutils-0.10/gstreamer-pbutils-0.10.gi + +*/ + public class MediaInfo.Info : VBox { private Label uri; - //private Discoverer dc; + private Discoverer dc; private DrawingArea drawing_area; private Pipeline pb; @@ -43,7 +52,11 @@ public class MediaInfo.Info : VBox show_all (); // set up the gstreamer components - //dc = new Discoverer (Gst.SECONDS * 10, null); + try { + dc = new Discoverer ((ClockTime)(Gst.SECOND * 10)); + } catch (Error e) { + debug ("Failed to create the discoverer: %s", e.message); + } pb = ElementFactory.make ("playbin2", "player") as Pipeline; Gst.Bus bus = pb.get_bus (); @@ -69,7 +82,13 @@ public class MediaInfo.Info : VBox this.uri.set_text (uri); if (uri != null) { - //DiscovererInfo info = dc.discover_uri (uri, null); + DiscovererInfo info; + + try { + info = dc.discover_uri (uri); + } catch (Error e) { + debug ("Failed to extract metadata from %s: %s", uri, e.message); + } // play file ((GLib.Object)pb).set_property ("uri", uri);