summaryrefslogtreecommitdiff
path: root/sources/generated/Gst/Segment.cs
blob: b7b9f9417832ae01429381b1b436cf64cefa446d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
// This file was generated by the Gtk# code generator.
// Any changes made will be lost if regenerated.

namespace Gst {

	using System;
	using System.Collections;
	using System.Collections.Generic;
	using System.Runtime.InteropServices;

#region Autogenerated code
	[StructLayout(LayoutKind.Sequential)]
	public partial struct Segment : IEquatable<Segment> {

		public Gst.SegmentFlags Flags;
		public double Rate;
		public double AppliedRate;
		public Gst.Format Format;
		public ulong Base;
		public ulong Offset;
		public ulong Start;
		public ulong Stop;
		public ulong Time;
		public ulong Position;
		public ulong Duration;
		[MarshalAs (UnmanagedType.ByValArray, SizeConst=4)]
		private IntPtr[] _gstGstReserved;

		public static Gst.Segment Zero = new Gst.Segment ();

		public static Gst.Segment New(IntPtr raw) {
			if (raw == IntPtr.Zero)
				return Gst.Segment.Zero;
			return (Gst.Segment) Marshal.PtrToStructure (raw, typeof (Gst.Segment));
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gst_segment_new();

		public static Segment New()
		{
			Segment result = Segment.New (gst_segment_new());
			return result;
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gst_segment_get_type();

		public static GLib.GType GType { 
			get {
				IntPtr raw_ret = gst_segment_get_type();
				GLib.GType ret = new GLib.GType(raw_ret);
				return ret;
			}
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern bool gst_segment_clip(IntPtr raw, int format, ulong start, ulong stop, out ulong clip_start, out ulong clip_stop);

		public bool Clip(Gst.Format format, ulong start, ulong stop, out ulong clip_start, out ulong clip_stop) {
			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_segment_clip(this_as_native, (int) format, start, stop, out clip_start, out clip_stop);
			bool ret = raw_ret;
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
			return ret;
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_segment_copy_into(IntPtr raw, IntPtr dest);

		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);
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern bool gst_segment_do_seek(IntPtr raw, double rate, int format, int flags, int start_type, ulong start, int stop_type, ulong stop, out bool update);

		public bool DoSeek(double rate, Gst.Format format, Gst.SeekFlags flags, Gst.SeekType start_type, ulong start, Gst.SeekType stop_type, ulong stop, out bool update) {
			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_segment_do_seek(this_as_native, rate, (int) format, (int) flags, (int) start_type, start, (int) stop_type, stop, out update);
			bool ret = raw_ret;
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
			return ret;
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_segment_init(IntPtr raw, int format);

		public void Init(Gst.Format format) {
			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);
			gst_segment_init(this_as_native, (int) format);
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern bool gst_segment_is_equal(IntPtr raw, IntPtr s1);

		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;
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern bool gst_segment_offset_running_time(IntPtr raw, int format, long offset);

		public bool OffsetRunningTime(Gst.Format format, long offset) {
			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_segment_offset_running_time(this_as_native, (int) format, offset);
			bool ret = raw_ret;
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
			return ret;
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern ulong gst_segment_position_from_running_time(IntPtr raw, int format, ulong running_time);

		public ulong PositionFromRunningTime(Gst.Format format, ulong running_time) {
			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);
			ulong raw_ret = gst_segment_position_from_running_time(this_as_native, (int) format, running_time);
			ulong ret = raw_ret;
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
			return ret;
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern int gst_segment_position_from_running_time_full(IntPtr raw, int format, ulong running_time, out ulong position);

		public int PositionFromRunningTimeFull(Gst.Format format, ulong running_time, out ulong position) {
			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);
			int raw_ret = gst_segment_position_from_running_time_full(this_as_native, (int) format, running_time, out position);
			int ret = raw_ret;
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
			return ret;
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern ulong gst_segment_position_from_stream_time(IntPtr raw, int format, ulong stream_time);

		public ulong PositionFromStreamTime(Gst.Format format, ulong stream_time) {
			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);
			ulong raw_ret = gst_segment_position_from_stream_time(this_as_native, (int) format, stream_time);
			ulong ret = raw_ret;
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
			return ret;
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern int gst_segment_position_from_stream_time_full(IntPtr raw, int format, ulong stream_time, out ulong position);

		public int PositionFromStreamTimeFull(Gst.Format format, ulong stream_time, out ulong position) {
			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);
			int raw_ret = gst_segment_position_from_stream_time_full(this_as_native, (int) format, stream_time, out position);
			int ret = raw_ret;
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
			return ret;
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern bool gst_segment_set_running_time(IntPtr raw, int format, ulong running_time);

		public bool SetRunningTime(Gst.Format format, ulong running_time) {
			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_segment_set_running_time(this_as_native, (int) format, running_time);
			bool ret = raw_ret;
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
			return ret;
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern ulong gst_segment_to_position(IntPtr raw, int format, ulong running_time);

		[Obsolete]
		public ulong ToPosition(Gst.Format format, ulong running_time) {
			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);
			ulong raw_ret = gst_segment_to_position(this_as_native, (int) format, running_time);
			ulong ret = raw_ret;
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
			return ret;
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern ulong gst_segment_to_running_time(IntPtr raw, int format, ulong position);

		public ulong ToRunningTime(Gst.Format format, ulong position) {
			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);
			ulong raw_ret = gst_segment_to_running_time(this_as_native, (int) format, position);
			ulong ret = raw_ret;
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
			return ret;
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern int gst_segment_to_running_time_full(IntPtr raw, int format, ulong position, out ulong running_time);

		public int ToRunningTimeFull(Gst.Format format, ulong position, out ulong running_time) {
			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);
			int raw_ret = gst_segment_to_running_time_full(this_as_native, (int) format, position, out running_time);
			int ret = raw_ret;
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
			return ret;
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern ulong gst_segment_to_stream_time(IntPtr raw, int format, ulong position);

		public ulong ToStreamTime(Gst.Format format, ulong position) {
			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);
			ulong raw_ret = gst_segment_to_stream_time(this_as_native, (int) format, position);
			ulong ret = raw_ret;
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
			return ret;
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern int gst_segment_to_stream_time_full(IntPtr raw, int format, ulong position, out ulong stream_time);

		public int ToStreamTimeFull(Gst.Format format, ulong position, out ulong stream_time) {
			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);
			int raw_ret = gst_segment_to_stream_time_full(this_as_native, (int) format, position, out stream_time);
			int ret = raw_ret;
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
			return ret;
		}

		static void ReadNative (IntPtr native, ref Gst.Segment target)
		{
			target = New (native);
		}

		public bool Equals (Segment other)
		{
			return true && Flags.Equals (other.Flags) && Rate.Equals (other.Rate) && AppliedRate.Equals (other.AppliedRate) && Format.Equals (other.Format) && Base.Equals (other.Base) && Offset.Equals (other.Offset) && Start.Equals (other.Start) && Stop.Equals (other.Stop) && Time.Equals (other.Time) && Position.Equals (other.Position) && Duration.Equals (other.Duration);
		}

		public override bool Equals (object other)
		{
			return other is Segment && Equals ((Segment) other);
		}

		public override int GetHashCode ()
		{
			return this.GetType ().FullName.GetHashCode () ^ Flags.GetHashCode () ^ Rate.GetHashCode () ^ AppliedRate.GetHashCode () ^ Format.GetHashCode () ^ Base.GetHashCode () ^ Offset.GetHashCode () ^ Start.GetHashCode () ^ Stop.GetHashCode () ^ Time.GetHashCode () ^ Position.GetHashCode () ^ Duration.GetHashCode ();
		}

		public static explicit operator GLib.Value (Gst.Segment boxed)
		{
			GLib.Value val = GLib.Value.Empty;
			val.Init (Gst.Segment.GType);
			val.Val = boxed;
			return val;
		}

		public static explicit operator Gst.Segment (GLib.Value val)
		{
			return (Gst.Segment) val.Val;
		}
#endregion
	}
}