Example #1
0
        public static bool RtcpBufferMap(Gst.Buffer buffer, Gst.MapFlags flags, Gst.Rtp.RTCPBuffer rtcp)
        {
            IntPtr native_rtcp = GLib.Marshaller.StructureToPtrAlloc(rtcp);
            bool   raw_ret     = gst_rtcp_buffer_map(buffer == null ? IntPtr.Zero : buffer.Handle, (int)flags, native_rtcp);
            bool   ret         = raw_ret;

            Marshal.FreeHGlobal(native_rtcp);
            return(ret);
        }
Example #2
0
        public static bool RtpBufferMap(Gst.Buffer buffer, Gst.MapFlags flags, out Gst.Rtp.RTPBuffer rtp)
        {
            IntPtr native_rtp = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(Gst.Rtp.RTPBuffer)));
            bool   raw_ret    = gst_rtp_buffer_map(buffer == null ? IntPtr.Zero : buffer.Handle, (int)flags, native_rtp);
            bool   ret        = raw_ret;

            rtp = Gst.Rtp.RTPBuffer.New(native_rtp);
            Marshal.FreeHGlobal(native_rtp);
            return(ret);
        }
Example #3
0
        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);
        }
Example #4
0
        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);
        }
Example #5
0
        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);
        }
Example #6
0
        public bool Map(Gst.Video.VideoInfo info, Gst.Buffer buffer, Gst.MapFlags flags)
        {
            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);
            bool raw_ret = gst_video_frame_map(this_as_native, info == null ? IntPtr.Zero : info.Handle, buffer == null ? IntPtr.Zero : buffer.Handle, (int)flags);
            bool ret     = raw_ret;

            ReadNative(this_as_native, ref this);
            System.Runtime.InteropServices.Marshal.FreeHGlobal(this_as_native);
            return(ret);
        }
Example #7
0
        public bool Map(uint plane, Gst.MapInfo info, IntPtr data, int stride, Gst.MapFlags flags)
        {
            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_map(this_as_native, plane, native_info, data, stride, (int)flags);
            bool   ret         = raw_ret;

            ReadNative(this_as_native, ref this);
            System.Runtime.InteropServices.Marshal.FreeHGlobal(this_as_native);
            Marshal.FreeHGlobal(native_info);
            return(ret);
        }
Example #8
0
        IntPtr InvokeNative(Gst.Memory mem, ulong maxsize, Gst.MapFlags flags)
        {
            IntPtr __result = native_cb(mem == null ? IntPtr.Zero : mem.Handle, new UIntPtr(maxsize), (int)flags);

            return(__result);
        }