GStreamer-sharp signals and events

Ralph ralph.gucwa at racelogic.co.uk
Mon Dec 5 01:53:19 PST 2011


Ralph wrote
> 
> I'm developing a C# WPF application using OSSBuild and gstreamersharp.
> I have a problem listening to signals generated by playbin2.
> This is what I do:
> 
> In the constructor:
>       Gst.BasePlugins.PlayBin2 playBin = new Gst.BasePlugins.PlayBin2();
>       playBin.AboutToFinish += OnAboutToFinish;
> 
> Somewhere else:
>       private void OnAboutToFinish(object o, Gst.GLib.SignalArgs args)
>       {
>           //supply the next file
>           playBin.Uri = nextFileName;
>       }
> 
> 
> The problem is that even if OnAboutToFinish method contains no code, the
> program crashes.
> I found that in other languages (Python, for example) the event handler
> always returns TRUE.  Unfortunately setting args.RetVal to true causes the
> following exception:
> 
> Object reference not set to an instance of an object.
>    at Gst.GLib.Value.set_Val(Object value)
>    at Gst.DynamicSignal.OnMarshal(IntPtr closure, Value& retval, UInt32
> argc, IntPtr argsPtr, IntPtr ihint, IntPtr data)
> 
> 
> The same problem occurs if instead of using the .NET AboutToFinish event
> of playbin2, I connect to about-to-finish signal using Connect method:
>       playBin.Connect("about-to-finish", OnAboutToFinish);
> 
> 
> How should I handle playbin2 signals?
> 


Does anyone have ANY idea why the program crashes when an event handler is
attached to the event like AboutToFinish or VideoChanged?  It is really
stopping me now, after a few weeks of development I got stuck and I don't
know what to do.

--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/GStreamer-sharp-signals-and-events-tp4122933p4159868.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list