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 IntPtr MemoryMapFullFunctionNative(IntPtr mem, IntPtr info, UIntPtr maxsize);
13 internal class MemoryMapFullFunctionInvoker {
15 MemoryMapFullFunctionNative native_cb;
17 GLib.DestroyNotify __notify;
19 ~MemoryMapFullFunctionInvoker ()
26 internal MemoryMapFullFunctionInvoker (MemoryMapFullFunctionNative native_cb) : this (native_cb, IntPtr.Zero, null) {}
28 internal MemoryMapFullFunctionInvoker (MemoryMapFullFunctionNative native_cb, IntPtr data) : this (native_cb, data, null) {}
30 internal MemoryMapFullFunctionInvoker (MemoryMapFullFunctionNative native_cb, IntPtr data, GLib.DestroyNotify notify)
32 this.native_cb = native_cb;
37 internal Gst.MemoryMapFullFunction Handler {
39 return new Gst.MemoryMapFullFunction(InvokeNative);
43 IntPtr InvokeNative (Gst.Memory mem, Gst.MapInfo info, ulong maxsize)
45 IntPtr native_info = GLib.Marshaller.StructureToPtrAlloc (info);
46 IntPtr __result = native_cb (mem == null ? IntPtr.Zero : mem.Handle, native_info, new UIntPtr (maxsize));
47 Marshal.FreeHGlobal (native_info);
52 internal class MemoryMapFullFunctionWrapper {
54 public IntPtr NativeCallback (IntPtr mem, IntPtr info, UIntPtr maxsize)
57 IntPtr __ret = managed (mem == IntPtr.Zero ? null : (Gst.Memory) GLib.Opaque.GetOpaque (mem, typeof (Gst.Memory), false), Gst.MapInfo.New (info), (ulong) maxsize);
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 MemoryMapFullFunctionNative NativeDelegate;
78 Gst.MemoryMapFullFunction managed;
80 public MemoryMapFullFunctionWrapper (Gst.MemoryMapFullFunction managed)
82 this.managed = managed;
84 NativeDelegate = new MemoryMapFullFunctionNative (NativeCallback);
87 public static Gst.MemoryMapFullFunction GetManagedDelegate (MemoryMapFullFunctionNative native)
91 MemoryMapFullFunctionWrapper wrapper = (MemoryMapFullFunctionWrapper) native.Target;
94 return wrapper.managed;