1 // This file was generated by the Gtk# code generator.
2 // Any changes made will be lost if regenerated.
4 namespace Gst.PbUtilsSharp {
7 using System.Runtime.InteropServices;
9 #region Autogenerated code
10 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
11 internal delegate void AudioVisualizerShaderFuncNative(IntPtr scope, IntPtr s, IntPtr d);
13 internal class AudioVisualizerShaderFuncInvoker {
15 AudioVisualizerShaderFuncNative native_cb;
17 GLib.DestroyNotify __notify;
19 ~AudioVisualizerShaderFuncInvoker ()
26 internal AudioVisualizerShaderFuncInvoker (AudioVisualizerShaderFuncNative native_cb) : this (native_cb, IntPtr.Zero, null) {}
28 internal AudioVisualizerShaderFuncInvoker (AudioVisualizerShaderFuncNative native_cb, IntPtr data) : this (native_cb, data, null) {}
30 internal AudioVisualizerShaderFuncInvoker (AudioVisualizerShaderFuncNative native_cb, IntPtr data, GLib.DestroyNotify notify)
32 this.native_cb = native_cb;
37 internal Gst.PbUtils.AudioVisualizerShaderFunc Handler {
39 return new Gst.PbUtils.AudioVisualizerShaderFunc(InvokeNative);
43 void InvokeNative (Gst.PbUtils.AudioVisualizer scope, Gst.Video.VideoFrame s, Gst.Video.VideoFrame d)
45 IntPtr native_s = GLib.Marshaller.StructureToPtrAlloc (s);
46 IntPtr native_d = GLib.Marshaller.StructureToPtrAlloc (d);
47 native_cb (scope == null ? IntPtr.Zero : scope.Handle, native_s, native_d);
48 Marshal.FreeHGlobal (native_s);
49 Marshal.FreeHGlobal (native_d);
53 internal class AudioVisualizerShaderFuncWrapper {
55 public void NativeCallback (IntPtr scope, IntPtr s, IntPtr d)
58 managed (GLib.Object.GetObject(scope) as Gst.PbUtils.AudioVisualizer, Gst.Video.VideoFrame.New (s), Gst.Video.VideoFrame.New (d));
61 } catch (Exception e) {
62 GLib.ExceptionManager.RaiseUnhandledException (e, false);
66 bool release_on_call = false;
69 public void PersistUntilCalled ()
71 release_on_call = true;
72 gch = GCHandle.Alloc (this);
75 internal AudioVisualizerShaderFuncNative NativeDelegate;
76 Gst.PbUtils.AudioVisualizerShaderFunc managed;
78 public AudioVisualizerShaderFuncWrapper (Gst.PbUtils.AudioVisualizerShaderFunc managed)
80 this.managed = managed;
82 NativeDelegate = new AudioVisualizerShaderFuncNative (NativeCallback);
85 public static Gst.PbUtils.AudioVisualizerShaderFunc GetManagedDelegate (AudioVisualizerShaderFuncNative native)
89 AudioVisualizerShaderFuncWrapper wrapper = (AudioVisualizerShaderFuncWrapper) native.Target;
92 return wrapper.managed;