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 MetaFreeFunctionNative(IntPtr meta, IntPtr buffer);
13 internal class MetaFreeFunctionInvoker {
15 MetaFreeFunctionNative native_cb;
17 GLib.DestroyNotify __notify;
19 ~MetaFreeFunctionInvoker ()
26 internal MetaFreeFunctionInvoker (MetaFreeFunctionNative native_cb) : this (native_cb, IntPtr.Zero, null) {}
28 internal MetaFreeFunctionInvoker (MetaFreeFunctionNative native_cb, IntPtr data) : this (native_cb, data, null) {}
30 internal MetaFreeFunctionInvoker (MetaFreeFunctionNative native_cb, IntPtr data, GLib.DestroyNotify notify)
32 this.native_cb = native_cb;
37 internal Gst.MetaFreeFunction Handler {
39 return new Gst.MetaFreeFunction(InvokeNative);
43 void InvokeNative (Gst.Meta meta, Gst.Buffer buffer)
45 IntPtr native_meta = GLib.Marshaller.StructureToPtrAlloc (meta);
46 native_cb (native_meta, buffer == null ? IntPtr.Zero : buffer.Handle);
47 Marshal.FreeHGlobal (native_meta);
51 internal class MetaFreeFunctionWrapper {
53 public void NativeCallback (IntPtr meta, IntPtr buffer)
56 managed (Gst.Meta.New (meta), buffer == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (buffer, typeof (Gst.Buffer), false));
59 } catch (Exception e) {
60 GLib.ExceptionManager.RaiseUnhandledException (e, false);
64 bool release_on_call = false;
67 public void PersistUntilCalled ()
69 release_on_call = true;
70 gch = GCHandle.Alloc (this);
73 internal MetaFreeFunctionNative NativeDelegate;
74 Gst.MetaFreeFunction managed;
76 public MetaFreeFunctionWrapper (Gst.MetaFreeFunction managed)
78 this.managed = managed;
80 NativeDelegate = new MetaFreeFunctionNative (NativeCallback);
83 public static Gst.MetaFreeFunction GetManagedDelegate (MetaFreeFunctionNative native)
87 MetaFreeFunctionWrapper wrapper = (MetaFreeFunctionWrapper) native.Target;
90 return wrapper.managed;