gstreamer/samples/TypeFind.cs

42 lines
1 KiB
C#
Raw Normal View History

using System;
using Gst;
using Gst.CorePlugins;
public static class GstTypefindTest
{
private static TypeFindElement typefind;
public static void Main(string [] args)
{
Application.Init();
Pipeline pipeline = new Pipeline("pipeline");
Element source = ElementFactory.Make("filesrc", "source");
typefind = TypeFindElement.Make("typefind");
Element sink = ElementFactory.Make("fakesink", "sink");
2009-05-01 13:28:34 +00:00
source["location"] = args[0];
typefind.HaveType += OnHaveType;
2009-05-06 07:54:14 +00:00
pipeline.Add (source, typefind, sink);
source.Link(typefind);
typefind.Link(sink);
pipeline.SetState(State.Paused);
pipeline.SetState(State.Null);
source.Dispose();
typefind.Dispose();
sink.Dispose();
pipeline.Dispose();
}
private static void OnHaveType(object o, GLib.SignalArgs args)
{
2009-04-14 11:42:24 +00:00
Caps caps = args.Args[1] as Caps;
Console.WriteLine("MimeType: {0}", caps);
}
}