GStreamer-sharp signals and events

Ralph ralph.gucwa at
Wed Nov 30 05:18:18 PST 2011

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, simply executing this method in response to the event
causes the application to crash.
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 events?

View this message in context:
Sent from the GStreamer-devel mailing list archive at

More information about the gstreamer-devel mailing list