mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-12 03:16:33 +00:00
610da9b1d9
git-svn-id: svn://anonsvn.mono-project.com/source/branches/abock/gstreamer-sharp@64347 e3ebcda4-bce8-0310-ba0a-eca2169e7518
40 lines
1 KiB
C#
40 lines
1 KiB
C#
using System;
|
|
using Gst;
|
|
|
|
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");
|
|
|
|
source.SetProperty("location", args[0]);
|
|
|
|
typefind.HaveType += OnHaveType;
|
|
|
|
pipeline.AddMany(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, HaveTypeArgs args)
|
|
{
|
|
args.Caps.Refcount++;
|
|
Console.WriteLine("MimeType: {0}, {1}", args.Caps, typefind.Caps);
|
|
}
|
|
}
|
|
|