summaryrefslogtreecommitdiff
path: root/sources/generated/Gst/Task.cs
blob: f8cbed0c8c4c5d9ad005d79b5a653ceb7e0ced5d (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
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
// 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
	public partial class Task : Gst.Object {

		public Task (IntPtr raw) : base(raw) {}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gst_task_new(GstSharp.TaskFunctionNative func, IntPtr user_data, GLib.DestroyNotify notify);

		public Task (Gst.TaskFunction func, IntPtr user_data, GLib.DestroyNotify notify) : base (IntPtr.Zero)
		{
			if (GetType () != typeof (Task)) {
				var vals = new List<GLib.Value> ();
				var names = new List<string> ();
				CreateNativeObject (names.ToArray (), vals.ToArray ());
				return;
			}
			GstSharp.TaskFunctionWrapper func_wrapper = new GstSharp.TaskFunctionWrapper (func);
			Raw = gst_task_new(func_wrapper.NativeDelegate, user_data, notify);
		}

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

		public Gst.TaskState State {
			get  {
				int raw_ret = gst_task_get_state(Handle);
				Gst.TaskState ret = (Gst.TaskState) raw_ret;
				return ret;
			}
		}

		public GLib.Cond Cond {
			get {
				unsafe {
					IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("cond"));
					return new GLib.Cond((*raw_ptr));
				}
			}
		}

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

		public GLib.RecMutex Lock {
			get {
				unsafe {
					IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("lock"));
					return new GLib.RecMutex((*raw_ptr));
				}
			}
			set  {
				gst_task_set_lock(Handle, value == null ? IntPtr.Zero : value.Handle);
			}
		}

		public Gst.TaskFunction Func {
			get {
				unsafe {
					IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("func"));
					 GstSharp.TaskFunctionNative del = (GstSharp.TaskFunctionNative)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(GstSharp.TaskFunctionNative));
					return GstSharp.TaskFunctionWrapper.GetManagedDelegate ((del));
				}
			}
		}

		public IntPtr UserData {
			get {
				unsafe {
					IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("user_data"));
					return (*raw_ptr);
				}
			}
		}

		public bool Running {
			get {
				unsafe {
					bool* raw_ptr = (bool*)(((byte*)Handle) + abi_info.GetFieldOffset("running"));
					return (*raw_ptr);
				}
			}
		}


		// Internal representation of the wrapped structure ABI.
		static GLib.AbiStruct _class_abi = null;
		static public new GLib.AbiStruct class_abi {
			get {
				if (_class_abi == null)
					_class_abi = new GLib.AbiStruct (new List<GLib.AbiField>{ 
						new GLib.AbiField("pool"
							, Gst.Object.class_abi.Fields
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // pool
							, null
							, "_gst_reserved"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("_gst_reserved"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) * 4 // _gst_reserved
							, "pool"
							, null
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
					});

				return _class_abi;
			}
		}


		// End of the ABI representation.

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

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

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

		public static void CleanupAll() {
			gst_task_cleanup_all();
		}

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

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

		public Gst.TaskPool Pool { 
			get {
				IntPtr raw_ret = gst_task_get_pool(Handle);
				Gst.TaskPool ret = GLib.Object.GetObject(raw_ret, true) as Gst.TaskPool;
				return ret;
			}
			set {
				gst_task_set_pool(Handle, value == null ? IntPtr.Zero : value.Handle);
			}
		}

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

		public bool Join() {
			bool raw_ret = gst_task_join(Handle);
			bool ret = raw_ret;
			return ret;
		}

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

		public bool Pause() {
			bool raw_ret = gst_task_pause(Handle);
			bool ret = raw_ret;
			return ret;
		}

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

		public bool Resume() {
			bool raw_ret = gst_task_resume(Handle);
			bool ret = raw_ret;
			return ret;
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_task_set_enter_callback(IntPtr raw, GstSharp.TaskThreadFuncNative enter_func, IntPtr user_data, GLib.DestroyNotify notify);

		public Gst.TaskThreadFunc EnterCallback { 
			set {
				GstSharp.TaskThreadFuncWrapper value_wrapper = new GstSharp.TaskThreadFuncWrapper (value);
				IntPtr user_data;
				GLib.DestroyNotify notify;
				if (value == null) {
					user_data = IntPtr.Zero;
					notify = null;
				} else {
					user_data = (IntPtr) GCHandle.Alloc (value_wrapper);
					notify = GLib.DestroyHelper.NotifyHandler;
				}
				gst_task_set_enter_callback(Handle, value_wrapper.NativeDelegate, user_data, notify);
			}
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_task_set_leave_callback(IntPtr raw, GstSharp.TaskThreadFuncNative leave_func, IntPtr user_data, GLib.DestroyNotify notify);

		public Gst.TaskThreadFunc LeaveCallback { 
			set {
				GstSharp.TaskThreadFuncWrapper value_wrapper = new GstSharp.TaskThreadFuncWrapper (value);
				IntPtr user_data;
				GLib.DestroyNotify notify;
				if (value == null) {
					user_data = IntPtr.Zero;
					notify = null;
				} else {
					user_data = (IntPtr) GCHandle.Alloc (value_wrapper);
					notify = GLib.DestroyHelper.NotifyHandler;
				}
				gst_task_set_leave_callback(Handle, value_wrapper.NativeDelegate, user_data, notify);
			}
		}

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

		public bool SetState(Gst.TaskState state) {
			bool raw_ret = gst_task_set_state(Handle, (int) state);
			bool ret = raw_ret;
			return ret;
		}

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

		public bool Start() {
			bool raw_ret = gst_task_start(Handle);
			bool ret = raw_ret;
			return ret;
		}

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

		public bool Stop() {
			bool raw_ret = gst_task_stop(Handle);
			bool ret = raw_ret;
			return ret;
		}


		// Internal representation of the wrapped structure ABI.
		static GLib.AbiStruct _abi_info = null;
		static public new GLib.AbiStruct abi_info {
			get {
				if (_abi_info == null)
					_abi_info = new GLib.AbiStruct (new List<GLib.AbiField>{ 
						new GLib.AbiField("state"
							, Gst.Object.abi_info.Fields
							, (uint) Marshal.SizeOf(System.Enum.GetUnderlyingType(typeof(Gst.TaskState))) // state
							, null
							, "cond"
							, (long) Marshal.OffsetOf(typeof(GstTask_stateAlign), "state")
							, 0
							),
						new GLib.AbiField("cond"
							, -1
							, (uint) Marshal.SizeOf(typeof(GLib.Cond.ABI)) // cond
							, "state"
							, "lock"
							, (long) Marshal.OffsetOf(typeof(GstTask_condAlign), "cond")
							, 0
							),
						new GLib.AbiField("lock"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // lock
							, "cond"
							, "func"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("func"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // func
							, "lock"
							, "user_data"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("user_data"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // user_data
							, "func"
							, "notify"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("notify"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // notify
							, "user_data"
							, "running"
							, (long) Marshal.OffsetOf(typeof(GstTask_notifyAlign), "notify")
							, 0
							),
						new GLib.AbiField("running"
							, -1
							, (uint) Marshal.SizeOf(typeof(bool)) // running
							, "notify"
							, "thread"
							, (long) Marshal.OffsetOf(typeof(GstTask_runningAlign), "running")
							, 0
							),
						new GLib.AbiField("thread"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // thread
							, "running"
							, "priv"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("priv"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // priv
							, "thread"
							, "_gst_reserved"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("_gst_reserved"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) * 4 // _gst_reserved
							, "priv"
							, null
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
					});

				return _abi_info;
			}
		}

		[StructLayout(LayoutKind.Sequential)]
		public struct GstTask_stateAlign
		{
			sbyte f1;
			private Gst.TaskState state;
		}

		[StructLayout(LayoutKind.Sequential)]
		public struct GstTask_condAlign
		{
			sbyte f1;
			private GLib.Cond.ABI cond;
		}

		[StructLayout(LayoutKind.Sequential)]
		public struct GstTask_notifyAlign
		{
			sbyte f1;
			private GLib.DestroyNotify notify;
		}

		[StructLayout(LayoutKind.Sequential)]
		public struct GstTask_runningAlign
		{
			sbyte f1;
			private bool running;
		}


		// End of the ABI representation.

#endregion
	}
}