static void OverrideHandleFrame(GLib.GType gtype, HandleFrameNativeDelegate callback) { unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("handle_frame")); *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback); } }
private Gst.FlowReturn InternalHandleFrame(Gst.Base.BaseParseFrame frame, int skipsize) { HandleFrameNativeDelegate unmanaged = null; unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("handle_frame")); unmanaged = (HandleFrameNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(HandleFrameNativeDelegate)); } if (unmanaged == null) { return((Gst.FlowReturn) 0); } IntPtr native_frame = GLib.Marshaller.StructureToPtrAlloc(frame); int __result = unmanaged(this.Handle, native_frame, skipsize); Marshal.FreeHGlobal(native_frame); return((Gst.FlowReturn)__result); }