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 void MemoryUnmapFunctionNative(IntPtr mem);
13 internal class MemoryUnmapFunctionInvoker {
15 MemoryUnmapFunctionNative native_cb;
17 GLib.DestroyNotify __notify;
19 ~MemoryUnmapFunctionInvoker ()
26 internal MemoryUnmapFunctionInvoker (MemoryUnmapFunctionNative native_cb) : this (native_cb, IntPtr.Zero, null) {}
28 internal MemoryUnmapFunctionInvoker (MemoryUnmapFunctionNative native_cb, IntPtr data) : this (native_cb, data, null) {}
30 internal MemoryUnmapFunctionInvoker (MemoryUnmapFunctionNative native_cb, IntPtr data, GLib.DestroyNotify notify)
32 this.native_cb = native_cb;
37 internal Gst.MemoryUnmapFunction Handler {
39 return new Gst.MemoryUnmapFunction(InvokeNative);
43 void InvokeNative (Gst.Memory mem)
45 native_cb (mem == null ? IntPtr.Zero : mem.Handle);
49 internal class MemoryUnmapFunctionWrapper {
51 public void NativeCallback (IntPtr mem)
54 managed (mem == IntPtr.Zero ? null : (Gst.Memory) GLib.Opaque.GetOpaque (mem, typeof (Gst.Memory), false));
57 } catch (Exception e) {
58 GLib.ExceptionManager.RaiseUnhandledException (e, false);
62 bool release_on_call = false;
65 public void PersistUntilCalled ()
67 release_on_call = true;
68 gch = GCHandle.Alloc (this);
71 internal MemoryUnmapFunctionNative NativeDelegate;
72 Gst.MemoryUnmapFunction managed;
74 public MemoryUnmapFunctionWrapper (Gst.MemoryUnmapFunction managed)
76 this.managed = managed;
78 NativeDelegate = new MemoryUnmapFunctionNative (NativeCallback);
81 public static Gst.MemoryUnmapFunction GetManagedDelegate (MemoryUnmapFunctionNative native)
85 MemoryUnmapFunctionWrapper wrapper = (MemoryUnmapFunctionWrapper) native.Target;
88 return wrapper.managed;