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 bool BufferForeachMetaFuncNative(IntPtr buffer, IntPtr meta, IntPtr user_data);
13 internal class BufferForeachMetaFuncInvoker {
15 BufferForeachMetaFuncNative native_cb;
17 GLib.DestroyNotify __notify;
19 ~BufferForeachMetaFuncInvoker ()
26 internal BufferForeachMetaFuncInvoker (BufferForeachMetaFuncNative native_cb) : this (native_cb, IntPtr.Zero, null) {}
28 internal BufferForeachMetaFuncInvoker (BufferForeachMetaFuncNative native_cb, IntPtr data) : this (native_cb, data, null) {}
30 internal BufferForeachMetaFuncInvoker (BufferForeachMetaFuncNative native_cb, IntPtr data, GLib.DestroyNotify notify)
32 this.native_cb = native_cb;
37 internal Gst.BufferForeachMetaFunc Handler {
39 return new Gst.BufferForeachMetaFunc(InvokeNative);
43 bool InvokeNative (Gst.Buffer buffer, out Gst.Meta meta)
45 IntPtr native_meta = Marshal.AllocHGlobal (Marshal.SizeOf (typeof (Gst.Meta)));
46 bool __result = native_cb (buffer == null ? IntPtr.Zero : buffer.Handle, native_meta, __data);
47 meta = Gst.Meta.New (native_meta);
48 Marshal.FreeHGlobal (native_meta);
53 internal class BufferForeachMetaFuncWrapper {
55 public bool NativeCallback (IntPtr buffer, IntPtr meta, IntPtr user_data)
60 bool __ret = managed (buffer == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (buffer, typeof (Gst.Buffer), false), out mymeta);
61 if (meta != IntPtr.Zero) System.Runtime.InteropServices.Marshal.StructureToPtr (mymeta, meta, false);
66 } catch (Exception e) {
67 GLib.ExceptionManager.RaiseUnhandledException (e, true);
68 // NOTREACHED: Above call does not return.
73 bool release_on_call = false;
76 public void PersistUntilCalled ()
78 release_on_call = true;
79 gch = GCHandle.Alloc (this);
82 internal BufferForeachMetaFuncNative NativeDelegate;
83 Gst.BufferForeachMetaFunc managed;
85 public BufferForeachMetaFuncWrapper (Gst.BufferForeachMetaFunc managed)
87 this.managed = managed;
89 NativeDelegate = new BufferForeachMetaFuncNative (NativeCallback);
92 public static Gst.BufferForeachMetaFunc GetManagedDelegate (BufferForeachMetaFuncNative native)
96 BufferForeachMetaFuncWrapper wrapper = (BufferForeachMetaFuncWrapper) native.Target;
99 return wrapper.managed;