diff options
Diffstat (limited to 'subprojects/gstreamer-sharp/sources/generated/Gst.Audio/Gst.AudioSharp.AudioClockGetTimeFuncNative.cs')
-rw-r--r-- | subprojects/gstreamer-sharp/sources/generated/Gst.Audio/Gst.AudioSharp.AudioClockGetTimeFuncNative.cs | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/subprojects/gstreamer-sharp/sources/generated/Gst.Audio/Gst.AudioSharp.AudioClockGetTimeFuncNative.cs b/subprojects/gstreamer-sharp/sources/generated/Gst.Audio/Gst.AudioSharp.AudioClockGetTimeFuncNative.cs new file mode 100644 index 0000000000..e043dc2ed9 --- /dev/null +++ b/subprojects/gstreamer-sharp/sources/generated/Gst.Audio/Gst.AudioSharp.AudioClockGetTimeFuncNative.cs @@ -0,0 +1,96 @@ +// This file was generated by the Gtk# code generator. +// Any changes made will be lost if regenerated. + +namespace Gst.AudioSharp { + + using System; + using System.Runtime.InteropServices; + +#region Autogenerated code + [UnmanagedFunctionPointer (CallingConvention.Cdecl)] + internal delegate ulong AudioClockGetTimeFuncNative(IntPtr clock, IntPtr user_data); + + internal class AudioClockGetTimeFuncInvoker { + + AudioClockGetTimeFuncNative native_cb; + IntPtr __data; + GLib.DestroyNotify __notify; + + ~AudioClockGetTimeFuncInvoker () + { + if (__notify == null) + return; + __notify (__data); + } + + internal AudioClockGetTimeFuncInvoker (AudioClockGetTimeFuncNative native_cb) : this (native_cb, IntPtr.Zero, null) {} + + internal AudioClockGetTimeFuncInvoker (AudioClockGetTimeFuncNative native_cb, IntPtr data) : this (native_cb, data, null) {} + + internal AudioClockGetTimeFuncInvoker (AudioClockGetTimeFuncNative native_cb, IntPtr data, GLib.DestroyNotify notify) + { + this.native_cb = native_cb; + __data = data; + __notify = notify; + } + + internal Gst.Audio.AudioClockGetTimeFunc Handler { + get { + return new Gst.Audio.AudioClockGetTimeFunc(InvokeNative); + } + } + + ulong InvokeNative (Gst.Clock clock) + { + ulong __result = native_cb (clock == null ? IntPtr.Zero : clock.Handle, __data); + return __result; + } + } + + internal class AudioClockGetTimeFuncWrapper { + + public ulong NativeCallback (IntPtr clock, IntPtr user_data) + { + try { + ulong __ret = managed (GLib.Object.GetObject(clock) as Gst.Clock); + if (release_on_call) + gch.Free (); + return __ret; + } catch (Exception e) { + GLib.ExceptionManager.RaiseUnhandledException (e, true); + // NOTREACHED: Above call does not return. + throw e; + } + } + + bool release_on_call = false; + GCHandle gch; + + public void PersistUntilCalled () + { + release_on_call = true; + gch = GCHandle.Alloc (this); + } + + internal AudioClockGetTimeFuncNative NativeDelegate; + Gst.Audio.AudioClockGetTimeFunc managed; + + public AudioClockGetTimeFuncWrapper (Gst.Audio.AudioClockGetTimeFunc managed) + { + this.managed = managed; + if (managed != null) + NativeDelegate = new AudioClockGetTimeFuncNative (NativeCallback); + } + + public static Gst.Audio.AudioClockGetTimeFunc GetManagedDelegate (AudioClockGetTimeFuncNative native) + { + if (native == null) + return null; + AudioClockGetTimeFuncWrapper wrapper = (AudioClockGetTimeFuncWrapper) native.Target; + if (wrapper == null) + return null; + return wrapper.managed; + } + } +#endregion +} |