2006-07-13 16:16:51 +00:00
|
|
|
using System;
|
|
|
|
using Gst;
|
2009-05-06 12:09:23 +00:00
|
|
|
using Gst.CorePlugins;
|
2006-07-13 16:16:51 +00:00
|
|
|
|
|
|
|
public static class GstTypefindTest
|
|
|
|
{
|
|
|
|
private static TypeFindElement typefind;
|
|
|
|
|
|
|
|
public static void Main(string [] args)
|
|
|
|
{
|
|
|
|
Application.Init();
|
|
|
|
|
|
|
|
Pipeline pipeline = new Pipeline("pipeline");
|
2009-06-05 18:59:24 +00:00
|
|
|
FileSrc source = FileSrc.Make("source");
|
2006-07-13 16:16:51 +00:00
|
|
|
typefind = TypeFindElement.Make("typefind");
|
2009-06-05 18:59:24 +00:00
|
|
|
FakeSink sink = FakeSink.Make("sink");
|
2006-07-13 16:16:51 +00:00
|
|
|
|
2009-06-05 18:59:24 +00:00
|
|
|
source.Location = args[0];
|
2006-07-13 16:16:51 +00:00
|
|
|
|
|
|
|
typefind.HaveType += OnHaveType;
|
|
|
|
|
2009-05-06 07:54:14 +00:00
|
|
|
pipeline.Add (source, typefind, sink);
|
2006-07-13 16:16:51 +00:00
|
|
|
source.Link(typefind);
|
|
|
|
typefind.Link(sink);
|
|
|
|
|
|
|
|
pipeline.SetState(State.Paused);
|
|
|
|
pipeline.SetState(State.Null);
|
2006-08-25 09:49:52 +00:00
|
|
|
|
2006-07-13 16:16:51 +00:00
|
|
|
pipeline.Dispose();
|
|
|
|
}
|
|
|
|
|
2009-06-05 18:59:24 +00:00
|
|
|
private static void OnHaveType(object o, TypeFindElement.HaveTypeArgs args)
|
2006-07-13 16:16:51 +00:00
|
|
|
{
|
2009-06-05 18:59:24 +00:00
|
|
|
Console.WriteLine("MimeType: {0}", args.Caps);
|
2006-07-13 16:16:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|