我需要为Xamarin Studio(Gtk #project)安装gstreamer-sharp。 我安装了OSSBuild并添加到引用gstreamer-sharp.dll,调试后我得到了异常:
Gst.GLib.GException:Gst.Parse.Launch中没有元素“playbin”(String pipeline_description)
输出:
0:00:00.010000000 6224 0748AA00 ERROR GST_REGISTRY gstregistrybinary.c:557:gst_registry_binary_read_cache: Binary registry type not recognized (invalid magic) for file at C:\Users\Admin\.gstreamer-0.10\registry.i686.bin
** (gStremTest:6224): WARNING **: Failed to load plugin 'C:\Program Files (x86)\OSSBuild\GStreamer\v0.10.6\bin\libgsf-win32-1-114.dll': `C:\Program Files (x86)\OSSBuild\GStreamer\v0.10.6\bin\libgsf-win32-1-114.dll': Не найден указанный модуль.
** (gStremTest:6224): WARNING **: Failed to load plugin 'C:\Program Files (x86)\OSSBuild\GStreamer\v0.10.6\bin\libpangocairo-1.0-0.dll': `C:\Program Files (x86)\OSSBuild\GStreamer\v0.10.6\bin\libpangocairo-1.0-0.dll': Не найдена указанная процедура.
** (gStremTest:6224): WARNING **: Failed to load plugin 'C:\Program Files (x86)\OSSBuild\GStreamer\v0.10.6\bin\librsvg-2-2.dll': `C:\Program Files (x86)\OSSBuild\GStreamer\v0.10.6\bin\librsvg-2-2.dll': Не найден указанный модуль.
0:00:02.501003000 6224 0748AA00 ERROR GST_PIPELINE grammar.tab.c:1975:_gst_parse_yyparse: no element "playbin"
0:00:02.501003000 6224 0748AA00 ERROR GST_PIPELINE grammar.tab.c:2564:_gst_parse_launch: Unrecoverable syntax error while parsing pipeline playbin uri=http://ftp.nluug.nl/ftp/graphics/blender/apricot/trailer/Sintel_Trailer1.1080p.DivX_Plus_HD.mkv
Loaded Module 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\mscorlib.resources\v4.0_4.0.0.0_ru_b77a5c561934e089\mscorlib.resources.dll'
代码:
Gst.Application.Init ();
GLib.MainLoop Loop;
Gst.Element element;
Loop = new GLib.MainLoop();
element = Gst.Parse.Launch("playbin uri=http://ftp.nluug.nl/ftp/graphics/blender/apricot/trailer/Sintel_Trailer1.1080p.DivX_Plus_HD.mkv");
element.Bus.AddSignalWatch();
element.SetState( Gst.State.Playing);
Loop.Run();
我理解,这只是我的错,所以我不需要解决这个问题,我需要重新安装gstreamer-sharp并在Xamarin中正确使用它。 这是如何正确完成的?
P.S。我认为如果为.Net安装它的人也可以给我建议,那就太好了。
答案 0 :(得分:2)
不幸的是,不支持gstreamer-sharp v.0.10。目前没有版本可以做你想要的,但是一旦1.0版本发布,它将完全支持windows,Android和linux。
V.1.0应根据其网站在未来2个月内发布。
答案 1 :(得分:1)
我不得不使用不同的代码。这段代码很好用:
Gst.Application.Init ();
var pipeDescription = "playbin uri=file:///a:/test.avi ";
var pipeline = Gst.Parse.Launch(pipeDescription) as Gst.Bin;
var someElementInPipe = pipeline.GetChildByName("myBin") as Gst.Element;
pipeline.SetState(Gst.State.Playing);