public void Unmap(Gst.MapInfo info) { IntPtr native_info = GLib.Marshaller.StructureToPtrAlloc(info); gst_memory_unmap(Handle, native_info); Marshal.FreeHGlobal(native_info); }
void InvokeNative(Gst.Memory mem, Gst.MapInfo info) { IntPtr native_info = GLib.Marshaller.StructureToPtrAlloc(info); native_cb(mem == null ? IntPtr.Zero : mem.Handle, native_info); Marshal.FreeHGlobal(native_info); }
IntPtr InvokeNative(Gst.Memory mem, Gst.MapInfo info, ulong maxsize) { IntPtr native_info = GLib.Marshaller.StructureToPtrAlloc(info); IntPtr __result = native_cb(mem == null ? IntPtr.Zero : mem.Handle, native_info, new UIntPtr(maxsize)); Marshal.FreeHGlobal(native_info); return(__result); }
public bool Map(out Gst.MapInfo info, Gst.MapFlags flags) { IntPtr native_info = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(Gst.MapInfo))); bool raw_ret = gst_memory_map(Handle, native_info, (int)flags); bool ret = raw_ret; info = Gst.MapInfo.New(native_info); Marshal.FreeHGlobal(native_info); return(ret); }
public Gst.Memory MakeMapped(out Gst.MapInfo info, Gst.MapFlags flags) { IntPtr native_info = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(Gst.MapInfo))); IntPtr raw_ret = gst_memory_make_mapped(Handle, native_info, (int)flags); Gst.Memory ret = raw_ret == IntPtr.Zero ? null : (Gst.Memory)GLib.Opaque.GetOpaque(raw_ret, typeof(Gst.Memory), true); info = Gst.MapInfo.New(native_info); Marshal.FreeHGlobal(native_info); return(ret); }
public bool MapRange(uint idx, int length, out Gst.MapInfo info, Gst.MapFlags flags) { IntPtr native_info = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(Gst.MapInfo))); bool raw_ret = gst_buffer_map_range(Handle, idx, length, native_info, (int)flags); bool ret = raw_ret; info = Gst.MapInfo.New(native_info); Marshal.FreeHGlobal(native_info); return(ret); }
public bool Unmap(uint plane, Gst.MapInfo info) { IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal(System.Runtime.InteropServices.Marshal.SizeOf(this)); System.Runtime.InteropServices.Marshal.StructureToPtr(this, this_as_native, false); IntPtr native_info = GLib.Marshaller.StructureToPtrAlloc(info); bool raw_ret = gst_video_meta_unmap(this_as_native, plane, native_info); bool ret = raw_ret; ReadNative(this_as_native, ref this); System.Runtime.InteropServices.Marshal.FreeHGlobal(this_as_native); Marshal.FreeHGlobal(native_info); return(ret); }
public void UpdateImage(ref Gst.MapInfo map, int width, int height) { if (Bitmap == null || Bitmap.PixelSize.Width != width || Bitmap.PixelSize.Height != height) { var oldBitmap = Bitmap; Bitmap = new Avalonia.Media.Imaging.WriteableBitmap(new PixelSize(width, height), new Vector(96, 96), Avalonia.Platform.PixelFormat.Rgba8888); oldBitmap?.Dispose(); } using (var l = Bitmap.Lock()) { map.CopyTo(l.Address, l.RowBytes * l.Size.Height); } VisualRoot?.Renderer.AddDirty(this); }