GNOME Bugzilla – Bug 796730
A bug in DynamicSignal.Emit for webrtcbin
Last modified: 2018-07-03 15:29:25 UTC
Created attachment 372906 [details] A bug repro. Hello I'm trying to implement the WebRtc demo (https://github.com/centricular/gstwebrtc-demos/blob/master/sendrecv/gst/webrtc-sendrecv.py) in C#, and I have encountered the AccessViolationException when trying to emit a signal from the webrtcbin. Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at GLib.GType.g_type_name(IntPtr raw) at GLib.GType.LookupType(IntPtr typeid) at Gst.DynamicSignal.Emit(Object o, String name, Object[] parameters) at Gst.Object.Emit(String signal, Object[] parameters) at ConsoleApp1.Program.Main(String[] args) in \Program.cs:line 16 It seems that the type ID obtained in the call (DynamicSignal.cs, line 383) IntPtr t = Marshal.ReadIntPtr (q.param_types, i); is invalid and it throws in the line 389 (casting to Type, which calls LookupType in GLib). I tried with the glib-sharp which is a part of gstreamer-sharp Nuget package, and the GLibSharp from the Nuget package https://www.nuget.org/packages/GLibSharp/3.22.24.36/
First you will need my webrtc branch to use GstWebRTC with gst-sharp: https://github.com/thiblahute/gstreamer-sharp/tree/webrtc Could you share your code to see what you are doing exactly? I would like to add a c# example to gstwebrtc-demo :-) I have the impression that particular bug was fixed in master, please check with my webrtc branch and let me know.
Yes, it works! I believe that you need GLib.GType.Register(Gst.WebRTC.WebRTCSessionDescription.GType, typeof(Gst.WebRTC.WebRTCSessionDescription)); somewhere in GtkSharp.GstreamerSharp.ObjectManager.Initialize As for the code, here it is: https://github.com/ttustonic/GStreamerSharpSamples These are my versions of tutorials, some tests for web cameras, WinForms and WPF demos, WebRtc sample (in GstSamples dir), so enjoy. Cheers, Tom
Nice, not sure why the type registration didn't get generated, I will check. Could you propose the webrtc example to gstwebrtc-demo? If you can't would you mind if I do?
Go ahead.
Proposed upstream https://github.com/centricular/gstwebrtc-demos/pull/32 Thanks a lot for your work :-) Closing now.