1 // This file was generated by the Gtk# code generator.
2 // Any changes made will be lost if regenerated.
4 namespace Gst.PbUtils {
7 using System.Collections;
8 using System.Collections.Generic;
9 using System.Runtime.InteropServices;
11 #region Autogenerated code
12 public partial class Discoverer : GLib.Object {
14 public Discoverer (IntPtr raw) : base(raw) {}
16 [DllImport("gstpbutils-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
17 static extern IntPtr gst_discoverer_new(ulong timeout);
19 public Discoverer (ulong timeout) : base (IntPtr.Zero)
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 ());
29 Raw = gst_discoverer_new(timeout);
32 [GLib.Property ("timeout")]
33 public ulong Timeout {
35 GLib.Value val = GetProperty ("timeout");
36 ulong ret = (ulong) val;
41 GLib.Value val = new GLib.Value(value);
42 SetProperty("timeout", val);
47 [GLib.Property ("use-cache")]
48 public bool UseCache {
50 GLib.Value val = GetProperty ("use-cache");
51 bool ret = (bool) val;
56 GLib.Value val = new GLib.Value(value);
57 SetProperty("use-cache", val);
62 [GLib.Signal("discovered")]
63 public event Gst.PbUtils.DiscoveredHandler Discovered {
65 this.AddSignalHandler ("discovered", value, typeof (Gst.PbUtils.DiscoveredArgs));
68 this.RemoveSignalHandler ("discovered", value);
72 [GLib.Signal("starting")]
73 public event System.EventHandler Starting {
75 this.AddSignalHandler ("starting", value);
78 this.RemoveSignalHandler ("starting", value);
82 [GLib.Signal("finished")]
83 public event System.EventHandler Finished {
85 this.AddSignalHandler ("finished", value);
88 this.RemoveSignalHandler ("finished", value);
92 [GLib.Signal("source-setup")]
93 public event Gst.PbUtils.SourceSetupHandler SourceSetup {
95 this.AddSignalHandler ("source-setup", value, typeof (Gst.PbUtils.SourceSetupArgs));
98 this.RemoveSignalHandler ("source-setup", value);
102 static FinishedNativeDelegate Finished_cb_delegate;
103 static FinishedNativeDelegate FinishedVMCallback {
105 if (Finished_cb_delegate == null)
106 Finished_cb_delegate = new FinishedNativeDelegate (Finished_cb);
107 return Finished_cb_delegate;
111 static void OverrideFinished (GLib.GType gtype)
113 OverrideFinished (gtype, FinishedVMCallback);
116 static void OverrideFinished (GLib.GType gtype, FinishedNativeDelegate callback)
119 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("finished"));
120 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
124 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
125 delegate void FinishedNativeDelegate (IntPtr inst);
127 static void Finished_cb (IntPtr inst)
130 Discoverer __obj = GLib.Object.GetObject (inst, false) as Discoverer;
132 } catch (Exception e) {
133 GLib.ExceptionManager.RaiseUnhandledException (e, false);
137 [GLib.DefaultSignalHandler(Type=typeof(Gst.PbUtils.Discoverer), ConnectionMethod="OverrideFinished")]
138 protected virtual void OnFinished ()
143 private void InternalFinished ()
145 FinishedNativeDelegate unmanaged = null;
147 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("finished"));
148 unmanaged = (FinishedNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(FinishedNativeDelegate));
150 if (unmanaged == null) return;
152 unmanaged (this.Handle);
155 static StartingNativeDelegate Starting_cb_delegate;
156 static StartingNativeDelegate StartingVMCallback {
158 if (Starting_cb_delegate == null)
159 Starting_cb_delegate = new StartingNativeDelegate (Starting_cb);
160 return Starting_cb_delegate;
164 static void OverrideStarting (GLib.GType gtype)
166 OverrideStarting (gtype, StartingVMCallback);
169 static void OverrideStarting (GLib.GType gtype, StartingNativeDelegate callback)
172 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("starting"));
173 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
177 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
178 delegate void StartingNativeDelegate (IntPtr inst);
180 static void Starting_cb (IntPtr inst)
183 Discoverer __obj = GLib.Object.GetObject (inst, false) as Discoverer;
185 } catch (Exception e) {
186 GLib.ExceptionManager.RaiseUnhandledException (e, false);
190 [GLib.DefaultSignalHandler(Type=typeof(Gst.PbUtils.Discoverer), ConnectionMethod="OverrideStarting")]
191 protected virtual void OnStarting ()
196 private void InternalStarting ()
198 StartingNativeDelegate unmanaged = null;
200 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("starting"));
201 unmanaged = (StartingNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(StartingNativeDelegate));
203 if (unmanaged == null) return;
205 unmanaged (this.Handle);
208 static DiscoveredNativeDelegate Discovered_cb_delegate;
209 static DiscoveredNativeDelegate DiscoveredVMCallback {
211 if (Discovered_cb_delegate == null)
212 Discovered_cb_delegate = new DiscoveredNativeDelegate (Discovered_cb);
213 return Discovered_cb_delegate;
217 static void OverrideDiscovered (GLib.GType gtype)
219 OverrideDiscovered (gtype, DiscoveredVMCallback);
222 static void OverrideDiscovered (GLib.GType gtype, DiscoveredNativeDelegate callback)
225 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("discovered"));
226 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
230 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
231 delegate void DiscoveredNativeDelegate (IntPtr inst, IntPtr info, IntPtr error);
233 static void Discovered_cb (IntPtr inst, IntPtr info, IntPtr error)
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);
243 [GLib.DefaultSignalHandler(Type=typeof(Gst.PbUtils.Discoverer), ConnectionMethod="OverrideDiscovered")]
244 protected virtual void OnDiscovered (Gst.PbUtils.DiscovererInfo info, IntPtr error)
246 InternalDiscovered (info, error);
249 private void InternalDiscovered (Gst.PbUtils.DiscovererInfo info, IntPtr error)
251 DiscoveredNativeDelegate unmanaged = null;
253 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("discovered"));
254 unmanaged = (DiscoveredNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(DiscoveredNativeDelegate));
256 if (unmanaged == null) return;
258 unmanaged (this.Handle, info == null ? IntPtr.Zero : info.Handle, error);
261 static SourceSetupNativeDelegate SourceSetup_cb_delegate;
262 static SourceSetupNativeDelegate SourceSetupVMCallback {
264 if (SourceSetup_cb_delegate == null)
265 SourceSetup_cb_delegate = new SourceSetupNativeDelegate (SourceSetup_cb);
266 return SourceSetup_cb_delegate;
270 static void OverrideSourceSetup (GLib.GType gtype)
272 OverrideSourceSetup (gtype, SourceSetupVMCallback);
275 static void OverrideSourceSetup (GLib.GType gtype, SourceSetupNativeDelegate callback)
278 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("source_setup"));
279 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
283 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
284 delegate void SourceSetupNativeDelegate (IntPtr inst, IntPtr source);
286 static void SourceSetup_cb (IntPtr inst, IntPtr source)
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);
296 [GLib.DefaultSignalHandler(Type=typeof(Gst.PbUtils.Discoverer), ConnectionMethod="OverrideSourceSetup")]
297 protected virtual void OnSourceSetup (Gst.Element source)
299 InternalSourceSetup (source);
302 private void InternalSourceSetup (Gst.Element source)
304 SourceSetupNativeDelegate unmanaged = null;
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));
309 if (unmanaged == null) return;
311 unmanaged (this.Handle, source == null ? IntPtr.Zero : source.Handle);
315 // Internal representation of the wrapped structure ABI.
316 static GLib.AbiStruct _class_abi = null;
317 static public new GLib.AbiStruct class_abi {
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
326 , (uint) Marshal.SizeOf(typeof(IntPtr))
329 new GLib.AbiField("starting"
331 , (uint) Marshal.SizeOf(typeof(IntPtr)) // starting
334 , (uint) Marshal.SizeOf(typeof(IntPtr))
337 new GLib.AbiField("discovered"
339 , (uint) Marshal.SizeOf(typeof(IntPtr)) // discovered
342 , (uint) Marshal.SizeOf(typeof(IntPtr))
345 new GLib.AbiField("source_setup"
347 , (uint) Marshal.SizeOf(typeof(IntPtr)) // source_setup
350 , (uint) Marshal.SizeOf(typeof(IntPtr))
353 new GLib.AbiField("_reserved"
355 , (uint) Marshal.SizeOf(typeof(IntPtr)) * 4 // _reserved
358 , (uint) Marshal.SizeOf(typeof(IntPtr))
368 // End of the ABI representation.
370 [DllImport("gstpbutils-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
371 static extern IntPtr gst_discoverer_get_type();
373 public static new GLib.GType GType {
375 IntPtr raw_ret = gst_discoverer_get_type();
376 GLib.GType ret = new GLib.GType(raw_ret);
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);
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);
394 [DllImport("gstpbutils-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
395 static extern bool gst_discoverer_discover_uri_async(IntPtr raw, IntPtr uri);
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);
401 GLib.Marshaller.Free (native_uri);
405 [DllImport("gstpbutils-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
406 static extern void gst_discoverer_start(IntPtr raw);
408 public void Start() {
409 gst_discoverer_start(Handle);
412 [DllImport("gstpbutils-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
413 static extern void gst_discoverer_stop(IntPtr raw);
416 gst_discoverer_stop(Handle);
422 GtkSharp.GstreamerSharp.ObjectManager.Initialize ();
425 // Internal representation of the wrapped structure ABI.
426 static GLib.AbiStruct _abi_info = null;
427 static public new GLib.AbiStruct abi_info {
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
436 , (uint) Marshal.SizeOf(typeof(IntPtr))
439 new GLib.AbiField("_reserved"
441 , (uint) Marshal.SizeOf(typeof(IntPtr)) * 4 // _reserved
444 , (uint) Marshal.SizeOf(typeof(IntPtr))
454 // End of the ABI representation.