Gstreamer MonoDevelop

时间:2012-11-12 19:12:43

标签: c# monodevelop gstreamer

我想使用monodevelop开发一个应用程序。 由于我需要使用Gstreamer#播放音频和视频(事实上我必须使用Gstreamer-#),我尽力弄清楚我是如何做到这一点的,但不幸的是,我还没有找到任何合适的链接。

如果有人知道某事,如果你与我分享,我会很感激。

1 个答案:

答案 0 :(得分:1)

就像文档说的那样,你需要引用gstreamer-sharp.dll,这反过来需要在同一个目录中使用gstreamersharpglue-0.10.dll。

Gst.Application.Init(); // First init GStreamer - important!!
var pipeDescription = "playbin uri=myVid.avi name=myBin";
var pipeline = Gst.Parse.Launch(pipeDescription) as Gst.Bin; //Launch Pipeline
var someElementInPipe = pipeline.GetChildByName("myBin") as Gst.Element;
pipeline.SetState(Gst.State.Playing);

----或者使用ElementFactory进行手动管道构建----

Gst.Application.Init();
var pipeline = new Gst.Pipeline();
var elementA = Gst.ElementFactory.Make("someElement");
var elementB = Gst.ElementFactory.Make("someElement");
pipeline.Add(elementA, elementB);
elementA.Link(elementB);
pipeline.SetState(Gst.State.Playing);

有关更多示例,请查看以下测试: http://cgit.freedesktop.org/gstreamer/gstreamer-sharp/tree/tests