1 // This file was generated by the Gtk# code generator.
2 // Any changes made will be lost if regenerated.
7 using System.Runtime.InteropServices;
9 #region Autogenerated code
10 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
11 internal delegate int PadProbeCallbackNative(IntPtr pad, IntPtr info, IntPtr user_data);
13 internal class PadProbeCallbackInvoker {
15 PadProbeCallbackNative native_cb;
17 GLib.DestroyNotify __notify;
19 ~PadProbeCallbackInvoker ()
26 internal PadProbeCallbackInvoker (PadProbeCallbackNative native_cb) : this (native_cb, IntPtr.Zero, null) {}
28 internal PadProbeCallbackInvoker (PadProbeCallbackNative native_cb, IntPtr data) : this (native_cb, data, null) {}
30 internal PadProbeCallbackInvoker (PadProbeCallbackNative native_cb, IntPtr data, GLib.DestroyNotify notify)
32 this.native_cb = native_cb;
37 internal Gst.PadProbeCallback Handler {
39 return new Gst.PadProbeCallback(InvokeNative);
43 Gst.PadProbeReturn InvokeNative (Gst.Pad pad, Gst.PadProbeInfo info)
45 IntPtr native_info = GLib.Marshaller.StructureToPtrAlloc (info);
46 Gst.PadProbeReturn __result = (Gst.PadProbeReturn) native_cb (pad == null ? IntPtr.Zero : pad.Handle, native_info, __data);
47 Marshal.FreeHGlobal (native_info);
52 internal class PadProbeCallbackWrapper {
54 public int NativeCallback (IntPtr pad, IntPtr info, IntPtr user_data)
57 Gst.PadProbeReturn __ret = managed (GLib.Object.GetObject(pad) as Gst.Pad, Gst.PadProbeInfo.New (info));
61 } catch (Exception e) {
62 GLib.ExceptionManager.RaiseUnhandledException (e, true);
63 // NOTREACHED: Above call does not return.
68 bool release_on_call = false;
71 public void PersistUntilCalled ()
73 release_on_call = true;
74 gch = GCHandle.Alloc (this);
77 internal PadProbeCallbackNative NativeDelegate;
78 Gst.PadProbeCallback managed;
80 public PadProbeCallbackWrapper (Gst.PadProbeCallback managed)
82 this.managed = managed;
84 NativeDelegate = new PadProbeCallbackNative (NativeCallback);
87 public static Gst.PadProbeCallback GetManagedDelegate (PadProbeCallbackNative native)
91 PadProbeCallbackWrapper wrapper = (PadProbeCallbackWrapper) native.Target;
94 return wrapper.managed;