Search code examples
.netxamarinmonodevelopgstreamergtk#

Install gstreamer-sharp for Xamarin Studio(Gtk#)


I need to install gstreamer-sharp for Xamarin Studio(Gtk# project). I installed OSSBuild and add to references gstreamer-sharp.dll, after debugging I got exception:

Gst.GLib.GException: no element "playbin" in Gst.Parse.Launch(String pipeline_description)

Output:

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'

Code:

    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();

I understand, it's only my fault, so I don't need to fix this, I need to reinstall gstreamer-sharp and correct use it in Xamarin. How is this done correctly?

P.S. I think it would be nice if people who have installed it for .Net could give me advice too.


Solution

  • I had to use a different code. This code is works fine:

            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);