blob: af346784ea29c4ee04622dd757c6512bbf76d76d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
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");
FileSrc source = FileSrc.Make("source");
typefind = TypeFindElement.Make("typefind");
FakeSink sink = FakeSink.Make("sink");
source.Location = args[0];
typefind.HaveType += OnHaveType;
pipeline.Add (source, typefind, sink);
source.Link(typefind);
typefind.Link(sink);
pipeline.SetState(State.Paused);
pipeline.SetState(State.Null);
pipeline.Dispose();
}
private static void OnHaveType(object o, TypeFindElement.HaveTypeArgs args)
{
Console.WriteLine("MimeType: {0}", args.Caps);
}
}
|