Exemplo n.º 1
0
 static void OverridePacketLost(GLib.GType gtype, PacketLostNativeDelegate callback)
 {
     unsafe {
         IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("packet_lost"));
         *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback);
     }
 }
Exemplo n.º 2
0
        private bool InternalPacketLost(Gst.Event evnt)
        {
            PacketLostNativeDelegate unmanaged = null;

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

            bool __result = unmanaged(this.Handle, evnt == null ? IntPtr.Zero : evnt.Handle);

            return(__result);
        }