summaryrefslogtreecommitdiff
path: root/sources/generated/Gst.PbUtils/Discoverer.cs
blob: 6cea90bb7951e080fa4eded92606ea9d7b92bdef (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
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
// This file was generated by the Gtk# code generator.
// Any changes made will be lost if regenerated.

namespace Gst.PbUtils {

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

#region Autogenerated code
	public partial class Discoverer : GLib.Object {

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

		[DllImport("libgstpbutils-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gst_discoverer_new(ulong timeout);

		public Discoverer (ulong timeout) : base (IntPtr.Zero)
		{
			if (GetType () != typeof (Discoverer)) {
				var vals = new List<GLib.Value> ();
				var names = new List<string> ();
				names.Add ("timeout");
				vals.Add (new GLib.Value (timeout));
				CreateNativeObject (names.ToArray (), vals.ToArray ());
				return;
			}
			Raw = gst_discoverer_new(timeout);
		}

		[GLib.Property ("timeout")]
		public ulong Timeout {
			get {
				GLib.Value val = GetProperty ("timeout");
				ulong ret = (ulong) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value(value);
				SetProperty("timeout", val);
				val.Dispose ();
			}
		}

		[GLib.Property ("use-cache")]
		public bool UseCache {
			get {
				GLib.Value val = GetProperty ("use-cache");
				bool ret = (bool) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value(value);
				SetProperty("use-cache", val);
				val.Dispose ();
			}
		}

		[GLib.Signal("discovered")]
		public event Gst.PbUtils.DiscoveredHandler Discovered {
			add {
				this.AddSignalHandler ("discovered", value, typeof (Gst.PbUtils.DiscoveredArgs));
			}
			remove {
				this.RemoveSignalHandler ("discovered", value);
			}
		}

		[GLib.Signal("starting")]
		public event System.EventHandler Starting {
			add {
				this.AddSignalHandler ("starting", value);
			}
			remove {
				this.RemoveSignalHandler ("starting", value);
			}
		}

		[GLib.Signal("finished")]
		public event System.EventHandler Finished {
			add {
				this.AddSignalHandler ("finished", value);
			}
			remove {
				this.RemoveSignalHandler ("finished", value);
			}
		}

		[GLib.Signal("source-setup")]
		public event Gst.PbUtils.SourceSetupHandler SourceSetup {
			add {
				this.AddSignalHandler ("source-setup", value, typeof (Gst.PbUtils.SourceSetupArgs));
			}
			remove {
				this.RemoveSignalHandler ("source-setup", value);
			}
		}

		static FinishedNativeDelegate Finished_cb_delegate;
		static FinishedNativeDelegate FinishedVMCallback {
			get {
				if (Finished_cb_delegate == null)
					Finished_cb_delegate = new FinishedNativeDelegate (Finished_cb);
				return Finished_cb_delegate;
			}
		}

		static void OverrideFinished (GLib.GType gtype)
		{
			OverrideFinished (gtype, FinishedVMCallback);
		}

		static void OverrideFinished (GLib.GType gtype, FinishedNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("finished"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void FinishedNativeDelegate (IntPtr inst);

		static void Finished_cb (IntPtr inst)
		{
			try {
				Discoverer __obj = GLib.Object.GetObject (inst, false) as Discoverer;
				__obj.OnFinished ();
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, false);
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gst.PbUtils.Discoverer), ConnectionMethod="OverrideFinished")]
		protected virtual void OnFinished ()
		{
			InternalFinished ();
		}

		private void InternalFinished ()
		{
			FinishedNativeDelegate unmanaged = null;
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("finished"));
				unmanaged = (FinishedNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(FinishedNativeDelegate));
			}
			if (unmanaged == null) return;

			unmanaged (this.Handle);
		}

		static StartingNativeDelegate Starting_cb_delegate;
		static StartingNativeDelegate StartingVMCallback {
			get {
				if (Starting_cb_delegate == null)
					Starting_cb_delegate = new StartingNativeDelegate (Starting_cb);
				return Starting_cb_delegate;
			}
		}

		static void OverrideStarting (GLib.GType gtype)
		{
			OverrideStarting (gtype, StartingVMCallback);
		}

		static void OverrideStarting (GLib.GType gtype, StartingNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("starting"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void StartingNativeDelegate (IntPtr inst);

		static void Starting_cb (IntPtr inst)
		{
			try {
				Discoverer __obj = GLib.Object.GetObject (inst, false) as Discoverer;
				__obj.OnStarting ();
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, false);
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gst.PbUtils.Discoverer), ConnectionMethod="OverrideStarting")]
		protected virtual void OnStarting ()
		{
			InternalStarting ();
		}

		private void InternalStarting ()
		{
			StartingNativeDelegate unmanaged = null;
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("starting"));
				unmanaged = (StartingNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(StartingNativeDelegate));
			}
			if (unmanaged == null) return;

			unmanaged (this.Handle);
		}

		static DiscoveredNativeDelegate Discovered_cb_delegate;
		static DiscoveredNativeDelegate DiscoveredVMCallback {
			get {
				if (Discovered_cb_delegate == null)
					Discovered_cb_delegate = new DiscoveredNativeDelegate (Discovered_cb);
				return Discovered_cb_delegate;
			}
		}

		static void OverrideDiscovered (GLib.GType gtype)
		{
			OverrideDiscovered (gtype, DiscoveredVMCallback);
		}

		static void OverrideDiscovered (GLib.GType gtype, DiscoveredNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("discovered"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void DiscoveredNativeDelegate (IntPtr inst, IntPtr info, IntPtr error);

		static void Discovered_cb (IntPtr inst, IntPtr info, IntPtr error)
		{
			try {
				Discoverer __obj = GLib.Object.GetObject (inst, false) as Discoverer;
				__obj.OnDiscovered (GLib.Object.GetObject(info) as Gst.PbUtils.DiscovererInfo, error);
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, false);
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gst.PbUtils.Discoverer), ConnectionMethod="OverrideDiscovered")]
		protected virtual void OnDiscovered (Gst.PbUtils.DiscovererInfo info, IntPtr error)
		{
			InternalDiscovered (info, error);
		}

		private void InternalDiscovered (Gst.PbUtils.DiscovererInfo info, IntPtr error)
		{
			DiscoveredNativeDelegate unmanaged = null;
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("discovered"));
				unmanaged = (DiscoveredNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(DiscoveredNativeDelegate));
			}
			if (unmanaged == null) return;

			unmanaged (this.Handle, info == null ? IntPtr.Zero : info.Handle, error);
		}

		static SourceSetupNativeDelegate SourceSetup_cb_delegate;
		static SourceSetupNativeDelegate SourceSetupVMCallback {
			get {
				if (SourceSetup_cb_delegate == null)
					SourceSetup_cb_delegate = new SourceSetupNativeDelegate (SourceSetup_cb);
				return SourceSetup_cb_delegate;
			}
		}

		static void OverrideSourceSetup (GLib.GType gtype)
		{
			OverrideSourceSetup (gtype, SourceSetupVMCallback);
		}

		static void OverrideSourceSetup (GLib.GType gtype, SourceSetupNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("source_setup"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void SourceSetupNativeDelegate (IntPtr inst, IntPtr source);

		static void SourceSetup_cb (IntPtr inst, IntPtr source)
		{
			try {
				Discoverer __obj = GLib.Object.GetObject (inst, false) as Discoverer;
				__obj.OnSourceSetup (GLib.Object.GetObject(source) as Gst.Element);
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, false);
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gst.PbUtils.Discoverer), ConnectionMethod="OverrideSourceSetup")]
		protected virtual void OnSourceSetup (Gst.Element source)
		{
			InternalSourceSetup (source);
		}

		private void InternalSourceSetup (Gst.Element source)
		{
			SourceSetupNativeDelegate unmanaged = null;
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("source_setup"));
				unmanaged = (SourceSetupNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(SourceSetupNativeDelegate));
			}
			if (unmanaged == null) return;

			unmanaged (this.Handle, source == null ? IntPtr.Zero : source.Handle);
		}


		// 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("finished"
							, GLib.Object.class_abi.Fields
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // finished
							, null
							, "starting"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("starting"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // starting
							, "finished"
							, "discovered"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("discovered"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // discovered
							, "starting"
							, "source_setup"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("source_setup"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // source_setup
							, "discovered"
							, "_reserved"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("_reserved"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) * 4 // _reserved
							, "source_setup"
							, null
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
					});

				return _class_abi;
			}
		}


		// End of the ABI representation.

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

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

		[DllImport("libgstpbutils-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern unsafe IntPtr gst_discoverer_discover_uri(IntPtr raw, IntPtr uri, out IntPtr error);

		public unsafe Gst.PbUtils.DiscovererInfo DiscoverUri(string uri) {
			IntPtr native_uri = GLib.Marshaller.StringToPtrGStrdup (uri);
			IntPtr error = IntPtr.Zero;
			IntPtr raw_ret = gst_discoverer_discover_uri(Handle, native_uri, out error);
			Gst.PbUtils.DiscovererInfo ret = GLib.Object.GetObject(raw_ret, true) as Gst.PbUtils.DiscovererInfo;
			GLib.Marshaller.Free (native_uri);
			if (error != IntPtr.Zero) throw new GLib.GException (error);
			return ret;
		}

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

		public bool DiscoverUriAsync(string uri) {
			IntPtr native_uri = GLib.Marshaller.StringToPtrGStrdup (uri);
			bool raw_ret = gst_discoverer_discover_uri_async(Handle, native_uri);
			bool ret = raw_ret;
			GLib.Marshaller.Free (native_uri);
			return ret;
		}

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

		public void Start() {
			gst_discoverer_start(Handle);
		}

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

		public void Stop() {
			gst_discoverer_stop(Handle);
		}


		static Discoverer ()
		{
			GtkSharp.GstreamerSharp.ObjectManager.Initialize ();
		}

		// 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("priv"
							, GLib.Object.abi_info.Fields
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // priv
							, null
							, "_reserved"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("_reserved"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) * 4 // _reserved
							, "priv"
							, null
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
					});

				return _abi_info;
			}
		}


		// End of the ABI representation.

#endregion
	}
}