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 BufferListFuncNative(out IntPtr buffer, uint idx, IntPtr user_data);
13 internal class BufferListFuncInvoker {
15 BufferListFuncNative native_cb;
17 GLib.DestroyNotify __notify;
19 ~BufferListFuncInvoker ()
26 internal BufferListFuncInvoker (BufferListFuncNative native_cb) : this (native_cb, IntPtr.Zero, null) {}
28 internal BufferListFuncInvoker (BufferListFuncNative native_cb, IntPtr data) : this (native_cb, data, null) {}
30 internal BufferListFuncInvoker (BufferListFuncNative native_cb, IntPtr data, GLib.DestroyNotify notify)
32 this.native_cb = native_cb;
37 internal Gst.BufferListFunc Handler {
39 return new Gst.BufferListFunc(InvokeNative);
43 bool InvokeNative (out Gst.Buffer buffer, uint idx)
46 bool __result = native_cb (out native_buffer, idx, __data);
47 buffer = native_buffer == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (native_buffer, typeof (Gst.Buffer), true);
52 internal class BufferListFuncWrapper {
54 public bool NativeCallback (out IntPtr buffer, uint idx, IntPtr user_data)
59 bool __ret = managed (out mybuffer, idx);
60 buffer = mybuffer == null ? IntPtr.Zero : mybuffer.Handle;
65 } catch (Exception e) {
66 GLib.ExceptionManager.RaiseUnhandledException (e, true);
67 // NOTREACHED: Above call does not return.
72 bool release_on_call = false;
75 public void PersistUntilCalled ()
77 release_on_call = true;
78 gch = GCHandle.Alloc (this);
81 internal BufferListFuncNative NativeDelegate;
82 Gst.BufferListFunc managed;
84 public BufferListFuncWrapper (Gst.BufferListFunc managed)
86 this.managed = managed;
88 NativeDelegate = new BufferListFuncNative (NativeCallback);
91 public static Gst.BufferListFunc GetManagedDelegate (BufferListFuncNative native)
95 BufferListFuncWrapper wrapper = (BufferListFuncWrapper) native.Target;
98 return wrapper.managed;