splitmuxsink Filename with Datetime

Steve McFarlin steve.mcfarlin at hopin.to
Fri Feb 24 00:13:36 UTC 2023


As I said before I am not familiar with C#. It looks like Glib is sending the signal, and then you have a runtime conversion error to SignalArgs at the invocation point of your callback. As shown in the System.ArgumentException the type System.EventArgs can not be converted to Glib.SignalArgs. You probably have something wrong between what Glib-C# is sending to the callback and your callbacks signature. It might be worth looking at a C# Glib signal handling example. Maybe that will provide clues to your issue.

- steve


> On Feb 23, 2023, at 12:06 AM, Armin Erkert via gstreamer-devel <gstreamer-devel at lists.freedesktop.org> wrote:
> 
> 
> Hi,
> 
> I can find the a wrapper and I tryed to add a SignalHandler with
> 
> 
> public delegate void MyDelegateNewFormat(object sender, GLib.SignalArg args);
> 
> ....
> 
> splitElement.AddSignalHandler("format-location", new MyDelegateNewFormat(NewFormat));
> 
> .....
> 
> static void NewFormat(object sender, GLib.SignalArgs args)
> {
> }
> 
> But running this Error
> 
> System.ArgumentException: Object of type 'System.EventArgs' cannot be converted to type 'GLib.SignalArgs'.
>   at System.RuntimeType.TryChangeType(Object value, Binder binder, CultureInfo culture, Boolean needsSpecialCast)
>   at System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo culture, BindingFlags invokeAttr)
>   at System.Reflection.MethodBase.CheckArguments(Object[] parameters, Binder binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig)
>   at System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
>   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
>   at System.Delegate.DynamicInvokeImpl(Object[] args)
>   at System.Delegate.DynamicInvoke(Object[] args)
>   at GLib.Signal.ClosureInvokedCB(Object o, ClosureInvokedArgs args)
>   at GLib.SignalClosure.Invoke(ClosureInvokedArgs args)
>   at GLib.SignalClosure.MarshalCallback(IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data)
> PushData
>   at GLib.ExceptionManager.RaiseUnhandledException(Exception e, Boolean is_terminal)
>   at GLib.SignalClosure.MarshalCallback(IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data)
> 
> 
> 
> Zitat von Steve McFarlin via gstreamer-devel <gstreamer-devel at lists.freedesktop.org>:



More information about the gstreamer-devel mailing list