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 void TaskThreadFuncNative(IntPtr task, out GLib.Thread thread, IntPtr user_data);
13 internal class TaskThreadFuncInvoker {
15 TaskThreadFuncNative native_cb;
17 GLib.DestroyNotify __notify;
19 ~TaskThreadFuncInvoker ()
26 internal TaskThreadFuncInvoker (TaskThreadFuncNative native_cb) : this (native_cb, IntPtr.Zero, null) {}
28 internal TaskThreadFuncInvoker (TaskThreadFuncNative native_cb, IntPtr data) : this (native_cb, data, null) {}
30 internal TaskThreadFuncInvoker (TaskThreadFuncNative native_cb, IntPtr data, GLib.DestroyNotify notify)
32 this.native_cb = native_cb;
37 internal Gst.TaskThreadFunc Handler {
39 return new Gst.TaskThreadFunc(InvokeNative);
43 void InvokeNative (Gst.Task task, out GLib.Thread thread)
45 native_cb (task == null ? IntPtr.Zero : task.Handle, out thread, __data);
49 internal class TaskThreadFuncWrapper {
51 public void NativeCallback (IntPtr task, out GLib.Thread thread, IntPtr user_data)
54 managed (GLib.Object.GetObject(task) as Gst.Task, out thread);
57 } catch (Exception e) {
58 GLib.ExceptionManager.RaiseUnhandledException (e, true);
59 // NOTREACHED: Above call does not return.
64 bool release_on_call = false;
67 public void PersistUntilCalled ()
69 release_on_call = true;
70 gch = GCHandle.Alloc (this);
73 internal TaskThreadFuncNative NativeDelegate;
74 Gst.TaskThreadFunc managed;
76 public TaskThreadFuncWrapper (Gst.TaskThreadFunc managed)
78 this.managed = managed;
80 NativeDelegate = new TaskThreadFuncNative (NativeCallback);
83 public static Gst.TaskThreadFunc GetManagedDelegate (TaskThreadFuncNative native)
87 TaskThreadFuncWrapper wrapper = (TaskThreadFuncWrapper) native.Target;
90 return wrapper.managed;