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 CapsMapFuncNative(IntPtr features, IntPtr structure, IntPtr user_data);
13 internal class CapsMapFuncInvoker {
15 CapsMapFuncNative native_cb;
17 GLib.DestroyNotify __notify;
19 ~CapsMapFuncInvoker ()
26 internal CapsMapFuncInvoker (CapsMapFuncNative native_cb) : this (native_cb, IntPtr.Zero, null) {}
28 internal CapsMapFuncInvoker (CapsMapFuncNative native_cb, IntPtr data) : this (native_cb, data, null) {}
30 internal CapsMapFuncInvoker (CapsMapFuncNative native_cb, IntPtr data, GLib.DestroyNotify notify)
32 this.native_cb = native_cb;
37 internal Gst.CapsMapFunc Handler {
39 return new Gst.CapsMapFunc(InvokeNative);
43 bool InvokeNative (Gst.CapsFeatures features, Gst.Structure structure)
45 IntPtr native_features = GLib.Marshaller.StructureToPtrAlloc (features);
46 bool __result = native_cb (native_features, structure == null ? IntPtr.Zero : structure.Handle, __data);
47 Marshal.FreeHGlobal (native_features);
52 internal class CapsMapFuncWrapper {
54 public bool NativeCallback (IntPtr features, IntPtr structure, IntPtr user_data)
57 bool __ret = managed (Gst.CapsFeatures.New (features), structure == IntPtr.Zero ? null : (Gst.Structure) GLib.Opaque.GetOpaque (structure, typeof (Gst.Structure), false));
61 } catch (Exception e) {
62 GLib.ExceptionManager.RaiseUnhandledException (e, false);
67 bool release_on_call = false;
70 public void PersistUntilCalled ()
72 release_on_call = true;
73 gch = GCHandle.Alloc (this);
76 internal CapsMapFuncNative NativeDelegate;
77 Gst.CapsMapFunc managed;
79 public CapsMapFuncWrapper (Gst.CapsMapFunc managed)
81 this.managed = managed;
83 NativeDelegate = new CapsMapFuncNative (NativeCallback);
86 public static Gst.CapsMapFunc GetManagedDelegate (CapsMapFuncNative native)
90 CapsMapFuncWrapper wrapper = (CapsMapFuncWrapper) native.Target;
93 return wrapper.managed;