Beispiel #1
0
        public void CopySegment(Gst.Segment segment)
        {
            IntPtr native_segment = GLib.Marshaller.StructureToPtrAlloc(segment);

            gst_event_copy_segment(Handle, native_segment);
            Marshal.FreeHGlobal(native_segment);
        }
Beispiel #2
0
        public Sample(Gst.Buffer buffer, Gst.Caps caps, Gst.Segment segment, Gst.Structure info)
        {
            IntPtr native_segment = GLib.Marshaller.StructureToPtrAlloc(segment);

            info.Owned = false;
            Raw        = gst_sample_new(buffer == null ? IntPtr.Zero : buffer.Handle, caps == null ? IntPtr.Zero : caps.Handle, native_segment, info == null ? IntPtr.Zero : info.Handle);
            Marshal.FreeHGlobal(native_segment);
        }
Beispiel #3
0
        public static Event NewSegment(Gst.Segment segment)
        {
            IntPtr native_segment = GLib.Marshaller.StructureToPtrAlloc(segment);
            Event  result         = new Event(gst_event_new_segment(native_segment));

            Marshal.FreeHGlobal(native_segment);
            return(result);
        }
Beispiel #4
0
        public static Gst.Buffer Clip(Gst.Buffer buffer, Gst.Segment segment, int rate, int bpf)
        {
            buffer.Owned = false;
            IntPtr native_segment = GLib.Marshaller.StructureToPtrAlloc(segment);
            IntPtr raw_ret        = gst_audio_buffer_clip(buffer == null ? IntPtr.Zero : buffer.Handle, native_segment, rate, bpf);

            Gst.Buffer ret = raw_ret == IntPtr.Zero ? null : (Gst.Buffer)GLib.Opaque.GetOpaque(raw_ret, typeof(Gst.Buffer), true);
            Marshal.FreeHGlobal(native_segment);
            return(ret);
        }
Beispiel #5
0
        public void CopyInto(Gst.Segment dest)
        {
            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_dest = GLib.Marshaller.StructureToPtrAlloc(dest);

            gst_segment_copy_into(this_as_native, native_dest);
            ReadNative(this_as_native, ref this);
            System.Runtime.InteropServices.Marshal.FreeHGlobal(this_as_native);
            Marshal.FreeHGlobal(native_dest);
        }
Beispiel #6
0
        public bool IsEqual(Gst.Segment s1)
        {
            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_s1 = GLib.Marshaller.StructureToPtrAlloc(s1);
            bool   raw_ret   = gst_segment_is_equal(this_as_native, native_s1);
            bool   ret       = raw_ret;

            ReadNative(this_as_native, ref this);
            System.Runtime.InteropServices.Marshal.FreeHGlobal(this_as_native);
            Marshal.FreeHGlobal(native_s1);
            return(ret);
        }
Beispiel #7
0
 static void ReadNative(IntPtr native, ref Gst.Segment target)
 {
     target = New(native);
 }