1 // This file was generated by the Gtk# code generator.
2 // Any changes made will be lost if regenerated.
4 namespace Gst.NetSharp {
7 using System.Runtime.InteropServices;
9 #region Autogenerated code
10 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
11 internal delegate bool PtpStatisticsCallbackNative(byte domain, IntPtr stats, IntPtr user_data);
13 internal class PtpStatisticsCallbackInvoker {
15 PtpStatisticsCallbackNative native_cb;
17 GLib.DestroyNotify __notify;
19 ~PtpStatisticsCallbackInvoker ()
26 internal PtpStatisticsCallbackInvoker (PtpStatisticsCallbackNative native_cb) : this (native_cb, IntPtr.Zero, null) {}
28 internal PtpStatisticsCallbackInvoker (PtpStatisticsCallbackNative native_cb, IntPtr data) : this (native_cb, data, null) {}
30 internal PtpStatisticsCallbackInvoker (PtpStatisticsCallbackNative native_cb, IntPtr data, GLib.DestroyNotify notify)
32 this.native_cb = native_cb;
37 internal Gst.Net.PtpStatisticsCallback Handler {
39 return new Gst.Net.PtpStatisticsCallback(InvokeNative);
43 bool InvokeNative (byte domain, Gst.Structure stats)
45 bool __result = native_cb (domain, stats == null ? IntPtr.Zero : stats.Handle, __data);
50 internal class PtpStatisticsCallbackWrapper {
52 public bool NativeCallback (byte domain, IntPtr stats, IntPtr user_data)
55 bool __ret = managed (domain, stats == IntPtr.Zero ? null : (Gst.Structure) GLib.Opaque.GetOpaque (stats, typeof (Gst.Structure), false));
59 } catch (Exception e) {
60 GLib.ExceptionManager.RaiseUnhandledException (e, false);
65 bool release_on_call = false;
68 public void PersistUntilCalled ()
70 release_on_call = true;
71 gch = GCHandle.Alloc (this);
74 internal PtpStatisticsCallbackNative NativeDelegate;
75 Gst.Net.PtpStatisticsCallback managed;
77 public PtpStatisticsCallbackWrapper (Gst.Net.PtpStatisticsCallback managed)
79 this.managed = managed;
81 NativeDelegate = new PtpStatisticsCallbackNative (NativeCallback);
84 public static Gst.Net.PtpStatisticsCallback GetManagedDelegate (PtpStatisticsCallbackNative native)
88 PtpStatisticsCallbackWrapper wrapper = (PtpStatisticsCallbackWrapper) native.Target;
91 return wrapper.managed;