static void OverrideReadSector(GLib.GType gtype, ReadSectorNativeDelegate callback) { unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("read_sector")); *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback); } }
private Gst.Buffer InternalReadSector(int sector) { ReadSectorNativeDelegate unmanaged = null; unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("read_sector")); unmanaged = (ReadSectorNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(ReadSectorNativeDelegate)); } if (unmanaged == null) { return(null); } IntPtr __result = unmanaged(this.Handle, sector); return(__result == IntPtr.Zero ? null : (Gst.Buffer)GLib.Opaque.GetOpaque(__result, typeof(Gst.Buffer), true)); }