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 MetaTransformFunctionNative(IntPtr transbuf, IntPtr meta, IntPtr buffer, uint type, IntPtr data);
13 internal class MetaTransformFunctionInvoker {
15 MetaTransformFunctionNative native_cb;
17 GLib.DestroyNotify __notify;
19 ~MetaTransformFunctionInvoker ()
26 internal MetaTransformFunctionInvoker (MetaTransformFunctionNative native_cb) : this (native_cb, IntPtr.Zero, null) {}
28 internal MetaTransformFunctionInvoker (MetaTransformFunctionNative native_cb, IntPtr data) : this (native_cb, data, null) {}
30 internal MetaTransformFunctionInvoker (MetaTransformFunctionNative native_cb, IntPtr data, GLib.DestroyNotify notify)
32 this.native_cb = native_cb;
37 internal Gst.MetaTransformFunction Handler {
39 return new Gst.MetaTransformFunction(InvokeNative);
43 bool InvokeNative (Gst.Buffer transbuf, Gst.Meta meta, Gst.Buffer buffer, uint type, IntPtr data)
45 IntPtr native_meta = GLib.Marshaller.StructureToPtrAlloc (meta);
46 bool __result = native_cb (transbuf == null ? IntPtr.Zero : transbuf.Handle, native_meta, buffer == null ? IntPtr.Zero : buffer.Handle, type, __data);
47 Marshal.FreeHGlobal (native_meta);
52 internal class MetaTransformFunctionWrapper {
54 public bool NativeCallback (IntPtr transbuf, IntPtr meta, IntPtr buffer, uint type, IntPtr data)
57 bool __ret = managed (transbuf == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (transbuf, typeof (Gst.Buffer), false), Gst.Meta.New (meta), buffer == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (buffer, typeof (Gst.Buffer), false), type, data);
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 MetaTransformFunctionNative NativeDelegate;
77 Gst.MetaTransformFunction managed;
79 public MetaTransformFunctionWrapper (Gst.MetaTransformFunction managed)
81 this.managed = managed;
83 NativeDelegate = new MetaTransformFunctionNative (NativeCallback);
86 public static Gst.MetaTransformFunction GetManagedDelegate (MetaTransformFunctionNative native)
90 MetaTransformFunctionWrapper wrapper = (MetaTransformFunctionWrapper) native.Target;
93 return wrapper.managed;