Exemplo n.º 1
0
 static void OverrideMessage(GLib.GType gtype, MessageNativeDelegate callback)
 {
     unsafe {
         IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("message"));
         *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback);
     }
 }
Exemplo n.º 2
0
        private void InternalMessage(Gst.Message message)
        {
            MessageNativeDelegate unmanaged = null;

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

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