Exemple #1
0
 static void OverrideDiscovered(GLib.GType gtype, DiscoveredNativeDelegate callback)
 {
     unsafe {
         IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("discovered"));
         *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback);
     }
 }
Exemple #2
0
        private void InternalDiscovered(Gst.PbUtils.DiscovererInfo info, IntPtr error)
        {
            DiscoveredNativeDelegate unmanaged = null;

            unsafe {
                IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("discovered"));
                unmanaged = (DiscoveredNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(DiscoveredNativeDelegate));
            }
            if (unmanaged == null)
            {
                return;
            }

            unmanaged(this.Handle, info == null ? IntPtr.Zero : info.Handle, error);
        }