info: enable discovered

Add comment telling how to regenerate the vapi files.
This commit is contained in:
Stefan Sauer 2010-10-18 17:14:46 +03:00
parent 0fdfd4d0af
commit 2448bf8b80

View file

@ -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);