Release 1.20.0
[platform/upstream/gstreamer.git] / subprojects / gstreamer-sharp / sources / generated / Gst.PbUtils / Discoverer.cs
1 // This file was generated by the Gtk# code generator.
2 // Any changes made will be lost if regenerated.
3
4 namespace Gst.PbUtils {
5
6         using System;
7         using System.Collections;
8         using System.Collections.Generic;
9         using System.Runtime.InteropServices;
10
11 #region Autogenerated code
12         public partial class Discoverer : GLib.Object {
13
14                 public Discoverer (IntPtr raw) : base(raw) {}
15
16                 [DllImport("gstpbutils-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
17                 static extern IntPtr gst_discoverer_new(ulong timeout);
18
19                 public Discoverer (ulong timeout) : base (IntPtr.Zero)
20                 {
21                         if (GetType () != typeof (Discoverer)) {
22                                 var vals = new List<GLib.Value> ();
23                                 var names = new List<string> ();
24                                 names.Add ("timeout");
25                                 vals.Add (new GLib.Value (timeout));
26                                 CreateNativeObject (names.ToArray (), vals.ToArray ());
27                                 return;
28                         }
29                         Raw = gst_discoverer_new(timeout);
30                 }
31
32                 [GLib.Property ("timeout")]
33                 public ulong Timeout {
34                         get {
35                                 GLib.Value val = GetProperty ("timeout");
36                                 ulong ret = (ulong) val;
37                                 val.Dispose ();
38                                 return ret;
39                         }
40                         set {
41                                 GLib.Value val = new GLib.Value(value);
42                                 SetProperty("timeout", val);
43                                 val.Dispose ();
44                         }
45                 }
46
47                 [GLib.Property ("use-cache")]
48                 public bool UseCache {
49                         get {
50                                 GLib.Value val = GetProperty ("use-cache");
51                                 bool ret = (bool) val;
52                                 val.Dispose ();
53                                 return ret;
54                         }
55                         set {
56                                 GLib.Value val = new GLib.Value(value);
57                                 SetProperty("use-cache", val);
58                                 val.Dispose ();
59                         }
60                 }
61
62                 [GLib.Signal("discovered")]
63                 public event Gst.PbUtils.DiscoveredHandler Discovered {
64                         add {
65                                 this.AddSignalHandler ("discovered", value, typeof (Gst.PbUtils.DiscoveredArgs));
66                         }
67                         remove {
68                                 this.RemoveSignalHandler ("discovered", value);
69                         }
70                 }
71
72                 [GLib.Signal("starting")]
73                 public event System.EventHandler Starting {
74                         add {
75                                 this.AddSignalHandler ("starting", value);
76                         }
77                         remove {
78                                 this.RemoveSignalHandler ("starting", value);
79                         }
80                 }
81
82                 [GLib.Signal("finished")]
83                 public event System.EventHandler Finished {
84                         add {
85                                 this.AddSignalHandler ("finished", value);
86                         }
87                         remove {
88                                 this.RemoveSignalHandler ("finished", value);
89                         }
90                 }
91
92                 [GLib.Signal("source-setup")]
93                 public event Gst.PbUtils.SourceSetupHandler SourceSetup {
94                         add {
95                                 this.AddSignalHandler ("source-setup", value, typeof (Gst.PbUtils.SourceSetupArgs));
96                         }
97                         remove {
98                                 this.RemoveSignalHandler ("source-setup", value);
99                         }
100                 }
101
102                 static FinishedNativeDelegate Finished_cb_delegate;
103                 static FinishedNativeDelegate FinishedVMCallback {
104                         get {
105                                 if (Finished_cb_delegate == null)
106                                         Finished_cb_delegate = new FinishedNativeDelegate (Finished_cb);
107                                 return Finished_cb_delegate;
108                         }
109                 }
110
111                 static void OverrideFinished (GLib.GType gtype)
112                 {
113                         OverrideFinished (gtype, FinishedVMCallback);
114                 }
115
116                 static void OverrideFinished (GLib.GType gtype, FinishedNativeDelegate callback)
117                 {
118                         unsafe {
119                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("finished"));
120                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
121                         }
122                 }
123
124                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
125                 delegate void FinishedNativeDelegate (IntPtr inst);
126
127                 static void Finished_cb (IntPtr inst)
128                 {
129                         try {
130                                 Discoverer __obj = GLib.Object.GetObject (inst, false) as Discoverer;
131                                 __obj.OnFinished ();
132                         } catch (Exception e) {
133                                 GLib.ExceptionManager.RaiseUnhandledException (e, false);
134                         }
135                 }
136
137                 [GLib.DefaultSignalHandler(Type=typeof(Gst.PbUtils.Discoverer), ConnectionMethod="OverrideFinished")]
138                 protected virtual void OnFinished ()
139                 {
140                         InternalFinished ();
141                 }
142
143                 private void InternalFinished ()
144                 {
145                         FinishedNativeDelegate unmanaged = null;
146                         unsafe {
147                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("finished"));
148                                 unmanaged = (FinishedNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(FinishedNativeDelegate));
149                         }
150                         if (unmanaged == null) return;
151
152                         unmanaged (this.Handle);
153                 }
154
155                 static StartingNativeDelegate Starting_cb_delegate;
156                 static StartingNativeDelegate StartingVMCallback {
157                         get {
158                                 if (Starting_cb_delegate == null)
159                                         Starting_cb_delegate = new StartingNativeDelegate (Starting_cb);
160                                 return Starting_cb_delegate;
161                         }
162                 }
163
164                 static void OverrideStarting (GLib.GType gtype)
165                 {
166                         OverrideStarting (gtype, StartingVMCallback);
167                 }
168
169                 static void OverrideStarting (GLib.GType gtype, StartingNativeDelegate callback)
170                 {
171                         unsafe {
172                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("starting"));
173                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
174                         }
175                 }
176
177                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
178                 delegate void StartingNativeDelegate (IntPtr inst);
179
180                 static void Starting_cb (IntPtr inst)
181                 {
182                         try {
183                                 Discoverer __obj = GLib.Object.GetObject (inst, false) as Discoverer;
184                                 __obj.OnStarting ();
185                         } catch (Exception e) {
186                                 GLib.ExceptionManager.RaiseUnhandledException (e, false);
187                         }
188                 }
189
190                 [GLib.DefaultSignalHandler(Type=typeof(Gst.PbUtils.Discoverer), ConnectionMethod="OverrideStarting")]
191                 protected virtual void OnStarting ()
192                 {
193                         InternalStarting ();
194                 }
195
196                 private void InternalStarting ()
197                 {
198                         StartingNativeDelegate unmanaged = null;
199                         unsafe {
200                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("starting"));
201                                 unmanaged = (StartingNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(StartingNativeDelegate));
202                         }
203                         if (unmanaged == null) return;
204
205                         unmanaged (this.Handle);
206                 }
207
208                 static DiscoveredNativeDelegate Discovered_cb_delegate;
209                 static DiscoveredNativeDelegate DiscoveredVMCallback {
210                         get {
211                                 if (Discovered_cb_delegate == null)
212                                         Discovered_cb_delegate = new DiscoveredNativeDelegate (Discovered_cb);
213                                 return Discovered_cb_delegate;
214                         }
215                 }
216
217                 static void OverrideDiscovered (GLib.GType gtype)
218                 {
219                         OverrideDiscovered (gtype, DiscoveredVMCallback);
220                 }
221
222                 static void OverrideDiscovered (GLib.GType gtype, DiscoveredNativeDelegate callback)
223                 {
224                         unsafe {
225                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("discovered"));
226                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
227                         }
228                 }
229
230                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
231                 delegate void DiscoveredNativeDelegate (IntPtr inst, IntPtr info, IntPtr error);
232
233                 static void Discovered_cb (IntPtr inst, IntPtr info, IntPtr error)
234                 {
235                         try {
236                                 Discoverer __obj = GLib.Object.GetObject (inst, false) as Discoverer;
237                                 __obj.OnDiscovered (GLib.Object.GetObject(info) as Gst.PbUtils.DiscovererInfo, error);
238                         } catch (Exception e) {
239                                 GLib.ExceptionManager.RaiseUnhandledException (e, false);
240                         }
241                 }
242
243                 [GLib.DefaultSignalHandler(Type=typeof(Gst.PbUtils.Discoverer), ConnectionMethod="OverrideDiscovered")]
244                 protected virtual void OnDiscovered (Gst.PbUtils.DiscovererInfo info, IntPtr error)
245                 {
246                         InternalDiscovered (info, error);
247                 }
248
249                 private void InternalDiscovered (Gst.PbUtils.DiscovererInfo info, IntPtr error)
250                 {
251                         DiscoveredNativeDelegate unmanaged = null;
252                         unsafe {
253                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("discovered"));
254                                 unmanaged = (DiscoveredNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(DiscoveredNativeDelegate));
255                         }
256                         if (unmanaged == null) return;
257
258                         unmanaged (this.Handle, info == null ? IntPtr.Zero : info.Handle, error);
259                 }
260
261                 static SourceSetupNativeDelegate SourceSetup_cb_delegate;
262                 static SourceSetupNativeDelegate SourceSetupVMCallback {
263                         get {
264                                 if (SourceSetup_cb_delegate == null)
265                                         SourceSetup_cb_delegate = new SourceSetupNativeDelegate (SourceSetup_cb);
266                                 return SourceSetup_cb_delegate;
267                         }
268                 }
269
270                 static void OverrideSourceSetup (GLib.GType gtype)
271                 {
272                         OverrideSourceSetup (gtype, SourceSetupVMCallback);
273                 }
274
275                 static void OverrideSourceSetup (GLib.GType gtype, SourceSetupNativeDelegate callback)
276                 {
277                         unsafe {
278                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("source_setup"));
279                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
280                         }
281                 }
282
283                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
284                 delegate void SourceSetupNativeDelegate (IntPtr inst, IntPtr source);
285
286                 static void SourceSetup_cb (IntPtr inst, IntPtr source)
287                 {
288                         try {
289                                 Discoverer __obj = GLib.Object.GetObject (inst, false) as Discoverer;
290                                 __obj.OnSourceSetup (GLib.Object.GetObject(source) as Gst.Element);
291                         } catch (Exception e) {
292                                 GLib.ExceptionManager.RaiseUnhandledException (e, false);
293                         }
294                 }
295
296                 [GLib.DefaultSignalHandler(Type=typeof(Gst.PbUtils.Discoverer), ConnectionMethod="OverrideSourceSetup")]
297                 protected virtual void OnSourceSetup (Gst.Element source)
298                 {
299                         InternalSourceSetup (source);
300                 }
301
302                 private void InternalSourceSetup (Gst.Element source)
303                 {
304                         SourceSetupNativeDelegate unmanaged = null;
305                         unsafe {
306                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("source_setup"));
307                                 unmanaged = (SourceSetupNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(SourceSetupNativeDelegate));
308                         }
309                         if (unmanaged == null) return;
310
311                         unmanaged (this.Handle, source == null ? IntPtr.Zero : source.Handle);
312                 }
313
314
315                 // Internal representation of the wrapped structure ABI.
316                 static GLib.AbiStruct _class_abi = null;
317                 static public new GLib.AbiStruct class_abi {
318                         get {
319                                 if (_class_abi == null)
320                                         _class_abi = new GLib.AbiStruct (new List<GLib.AbiField>{ 
321                                                 new GLib.AbiField("finished"
322                                                         , GLib.Object.class_abi.Fields
323                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // finished
324                                                         , null
325                                                         , "starting"
326                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
327                                                         , 0
328                                                         ),
329                                                 new GLib.AbiField("starting"
330                                                         , -1
331                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // starting
332                                                         , "finished"
333                                                         , "discovered"
334                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
335                                                         , 0
336                                                         ),
337                                                 new GLib.AbiField("discovered"
338                                                         , -1
339                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // discovered
340                                                         , "starting"
341                                                         , "source_setup"
342                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
343                                                         , 0
344                                                         ),
345                                                 new GLib.AbiField("source_setup"
346                                                         , -1
347                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // source_setup
348                                                         , "discovered"
349                                                         , "_reserved"
350                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
351                                                         , 0
352                                                         ),
353                                                 new GLib.AbiField("_reserved"
354                                                         , -1
355                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) * 4 // _reserved
356                                                         , "source_setup"
357                                                         , null
358                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
359                                                         , 0
360                                                         ),
361                                         });
362
363                                 return _class_abi;
364                         }
365                 }
366
367
368                 // End of the ABI representation.
369
370                 [DllImport("gstpbutils-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
371                 static extern IntPtr gst_discoverer_get_type();
372
373                 public static new GLib.GType GType { 
374                         get {
375                                 IntPtr raw_ret = gst_discoverer_get_type();
376                                 GLib.GType ret = new GLib.GType(raw_ret);
377                                 return ret;
378                         }
379                 }
380
381                 [DllImport("gstpbutils-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
382                 static extern unsafe IntPtr gst_discoverer_discover_uri(IntPtr raw, IntPtr uri, out IntPtr error);
383
384                 public unsafe Gst.PbUtils.DiscovererInfo DiscoverUri(string uri) {
385                         IntPtr native_uri = GLib.Marshaller.StringToPtrGStrdup (uri);
386                         IntPtr error = IntPtr.Zero;
387                         IntPtr raw_ret = gst_discoverer_discover_uri(Handle, native_uri, out error);
388                         Gst.PbUtils.DiscovererInfo ret = GLib.Object.GetObject(raw_ret, true) as Gst.PbUtils.DiscovererInfo;
389                         GLib.Marshaller.Free (native_uri);
390                         if (error != IntPtr.Zero) throw new GLib.GException (error);
391                         return ret;
392                 }
393
394                 [DllImport("gstpbutils-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
395                 static extern bool gst_discoverer_discover_uri_async(IntPtr raw, IntPtr uri);
396
397                 public bool DiscoverUriAsync(string uri) {
398                         IntPtr native_uri = GLib.Marshaller.StringToPtrGStrdup (uri);
399                         bool raw_ret = gst_discoverer_discover_uri_async(Handle, native_uri);
400                         bool ret = raw_ret;
401                         GLib.Marshaller.Free (native_uri);
402                         return ret;
403                 }
404
405                 [DllImport("gstpbutils-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
406                 static extern void gst_discoverer_start(IntPtr raw);
407
408                 public void Start() {
409                         gst_discoverer_start(Handle);
410                 }
411
412                 [DllImport("gstpbutils-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
413                 static extern void gst_discoverer_stop(IntPtr raw);
414
415                 public void Stop() {
416                         gst_discoverer_stop(Handle);
417                 }
418
419
420                 static Discoverer ()
421                 {
422                         GtkSharp.GstreamerSharp.ObjectManager.Initialize ();
423                 }
424
425                 // Internal representation of the wrapped structure ABI.
426                 static GLib.AbiStruct _abi_info = null;
427                 static public new GLib.AbiStruct abi_info {
428                         get {
429                                 if (_abi_info == null)
430                                         _abi_info = new GLib.AbiStruct (new List<GLib.AbiField>{ 
431                                                 new GLib.AbiField("priv"
432                                                         , GLib.Object.abi_info.Fields
433                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // priv
434                                                         , null
435                                                         , "_reserved"
436                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
437                                                         , 0
438                                                         ),
439                                                 new GLib.AbiField("_reserved"
440                                                         , -1
441                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) * 4 // _reserved
442                                                         , "priv"
443                                                         , null
444                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
445                                                         , 0
446                                                         ),
447                                         });
448
449                                 return _abi_info;
450                         }
451                 }
452
453
454                 // End of the ABI representation.
455
456 #endregion
457         }
458 }