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 MemoryShareFunctionNative(IntPtr mem, IntPtr offset, IntPtr size);
13 internal class MemoryShareFunctionInvoker {
15 MemoryShareFunctionNative native_cb;
17 GLib.DestroyNotify __notify;
19 ~MemoryShareFunctionInvoker ()
26 internal MemoryShareFunctionInvoker (MemoryShareFunctionNative native_cb) : this (native_cb, IntPtr.Zero, null) {}
28 internal MemoryShareFunctionInvoker (MemoryShareFunctionNative native_cb, IntPtr data) : this (native_cb, data, null) {}
30 internal MemoryShareFunctionInvoker (MemoryShareFunctionNative native_cb, IntPtr data, GLib.DestroyNotify notify)
32 this.native_cb = native_cb;
37 internal Gst.MemoryShareFunction Handler {
39 return new Gst.MemoryShareFunction(InvokeNative);
43 Gst.Memory InvokeNative (Gst.Memory mem, long offset, long size)
45 Gst.Memory __result = native_cb (mem == null ? IntPtr.Zero : mem.Handle, new IntPtr (offset), new IntPtr (size)) == IntPtr.Zero ? null : (Gst.Memory) GLib.Opaque.GetOpaque (native_cb (mem == null ? IntPtr.Zero : mem.Handle, new IntPtr (offset), new IntPtr (size)), typeof (Gst.Memory), true);
50 internal class MemoryShareFunctionWrapper {
52 public IntPtr NativeCallback (IntPtr mem, IntPtr offset, IntPtr size)
55 Gst.Memory __ret = managed (mem == IntPtr.Zero ? null : (Gst.Memory) GLib.Opaque.GetOpaque (mem, typeof (Gst.Memory), false), (long) offset, (long) size);
58 return __ret == null ? IntPtr.Zero : __ret.OwnedCopy;
59 } catch (Exception e) {
60 GLib.ExceptionManager.RaiseUnhandledException (e, true);
61 // NOTREACHED: Above call does not return.
66 bool release_on_call = false;
69 public void PersistUntilCalled ()
71 release_on_call = true;
72 gch = GCHandle.Alloc (this);
75 internal MemoryShareFunctionNative NativeDelegate;
76 Gst.MemoryShareFunction managed;
78 public MemoryShareFunctionWrapper (Gst.MemoryShareFunction managed)
80 this.managed = managed;
82 NativeDelegate = new MemoryShareFunctionNative (NativeCallback);
85 public static Gst.MemoryShareFunction GetManagedDelegate (MemoryShareFunctionNative native)
89 MemoryShareFunctionWrapper wrapper = (MemoryShareFunctionWrapper) native.Target;
92 return wrapper.managed;