Exemplo n.º 1
0
 static void OverridePayload(GLib.GType gtype, PayloadNativeDelegate callback)
 {
     unsafe {
         IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("payload"));
         *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback);
     }
 }
Exemplo n.º 2
0
        private Gst.Buffer InternalPayload(Gst.Buffer buffer)
        {
            PayloadNativeDelegate unmanaged = null;

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

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

            return(__result == IntPtr.Zero ? null : (Gst.Buffer)GLib.Opaque.GetOpaque(__result, typeof(Gst.Buffer), true));
        }