static void OverrideDecideAllocation(GLib.GType gtype, DecideAllocationNativeDelegate callback) { unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("decide_allocation")); *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback); } }
private bool InternalDecideAllocation(Gst.Query query) { DecideAllocationNativeDelegate unmanaged = null; unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("decide_allocation")); unmanaged = (DecideAllocationNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(DecideAllocationNativeDelegate)); } if (unmanaged == null) { return(false); } bool __result = unmanaged(this.Handle, query == null ? IntPtr.Zero : query.Handle); return(__result); }