static void OverrideCreate(GLib.GType gtype, CreateNativeDelegate callback) { unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("create")); *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback); } }
private Gst.FlowReturn InternalCreate(Gst.Buffer buf) { CreateNativeDelegate unmanaged = null; unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("create")); unmanaged = (CreateNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(CreateNativeDelegate)); } if (unmanaged == null) { return((Gst.FlowReturn) 0); } int __result = unmanaged(this.Handle, buf == null ? IntPtr.Zero : buf.Handle); return((Gst.FlowReturn)__result); }
static void OverrideCreate (Gst.GLib.GType gtype, CreateNativeDelegate callback) { GstPushSrcClass class_iface = GetClassStruct (gtype, false); class_iface.Create = callback; OverrideClassStruct (gtype, class_iface); }