GStreamer-sharp signals and events

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

GStreamer-sharp signals and events

Ralph
This post was updated on .
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?
Reply | Threaded
Open this post in threaded view
|

Re: GStreamer-sharp signals and events

Ralph
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.
Reply | Threaded
Open this post in threaded view
|

Re: GStreamer-sharp signals and events

Sebastian Dröge-7
On Mo, 2011-12-05 at 01:53 -0800, Ralph wrote:

> 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.
Hi,

please file a bug in bugzilla at http://bugzilla.gnome.org . If possible
please attach a small testcase for this bug.

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: GStreamer-sharp signals and events

Ralph
Sebastian Dröge-7 wrote
Hi,

please file a bug in bugzilla at http://bugzilla.gnome.org . If possible
please attach a small testcase for this bug.

Bug 665587 posted.