Back to development
[platform/upstream/gstreamer.git] / subprojects / gstreamer-sharp / sources / generated / Gst / Element.cs
1 // This file was generated by the Gtk# code generator.
2 // Any changes made will be lost if regenerated.
3
4 namespace Gst {
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 Element : Gst.Object {
13
14                 protected Element (IntPtr raw) : base(raw) {}
15
16                 protected Element() : base(IntPtr.Zero)
17                 {
18                         CreateNativeObject (new string [0], new GLib.Value [0]);
19                 }
20
21                 public GLib.RecMutex StateLock {
22                         get {
23                                 unsafe {
24                                         IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("state_lock"));
25                                         return new GLib.RecMutex((*raw_ptr));
26                                 }
27                         }
28                 }
29
30                 public GLib.Cond StateCond {
31                         get {
32                                 unsafe {
33                                         IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("state_cond"));
34                                         return new GLib.Cond((*raw_ptr));
35                                 }
36                         }
37                 }
38
39                 public uint StateCookie {
40                         get {
41                                 unsafe {
42                                         uint* raw_ptr = (uint*)(((byte*)Handle) + abi_info.GetFieldOffset("state_cookie"));
43                                         return (*raw_ptr);
44                                 }
45                         }
46                 }
47
48                 public Gst.State TargetState {
49                         get {
50                                 unsafe {
51                                         int* raw_ptr = (int*)(((byte*)Handle) + abi_info.GetFieldOffset("target_state"));
52                                         return (Gst.State) (*raw_ptr);
53                                 }
54                         }
55                 }
56
57                 public Gst.State CurrentState {
58                         get {
59                                 unsafe {
60                                         int* raw_ptr = (int*)(((byte*)Handle) + abi_info.GetFieldOffset("current_state"));
61                                         return (Gst.State) (*raw_ptr);
62                                 }
63                         }
64                 }
65
66                 public Gst.State NextState {
67                         get {
68                                 unsafe {
69                                         int* raw_ptr = (int*)(((byte*)Handle) + abi_info.GetFieldOffset("next_state"));
70                                         return (Gst.State) (*raw_ptr);
71                                 }
72                         }
73                 }
74
75                 public Gst.State PendingState {
76                         get {
77                                 unsafe {
78                                         int* raw_ptr = (int*)(((byte*)Handle) + abi_info.GetFieldOffset("pending_state"));
79                                         return (Gst.State) (*raw_ptr);
80                                 }
81                         }
82                 }
83
84                 public Gst.StateChangeReturn LastReturn {
85                         get {
86                                 unsafe {
87                                         int* raw_ptr = (int*)(((byte*)Handle) + abi_info.GetFieldOffset("last_return"));
88                                         return (Gst.StateChangeReturn) (*raw_ptr);
89                                 }
90                         }
91                 }
92
93                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
94                 static extern IntPtr gst_element_get_bus(IntPtr raw);
95
96                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
97                 static extern void gst_element_set_bus(IntPtr raw, IntPtr bus);
98
99                 public Gst.Bus Bus {
100                         get  {
101                                 IntPtr raw_ret = gst_element_get_bus(Handle);
102                                 Gst.Bus ret = GLib.Object.GetObject(raw_ret, true) as Gst.Bus;
103                                 return ret;
104                         }
105                         set  {
106                                 gst_element_set_bus(Handle, value == null ? IntPtr.Zero : value.Handle);
107                         }
108                 }
109
110                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
111                 static extern IntPtr gst_element_get_clock(IntPtr raw);
112
113                 public Gst.Clock Clock {
114                         get  {
115                                 IntPtr raw_ret = gst_element_get_clock(Handle);
116                                 Gst.Clock ret = GLib.Object.GetObject(raw_ret, true) as Gst.Clock;
117                                 return ret;
118                         }
119                 }
120
121                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
122                 static extern ulong gst_element_get_base_time(IntPtr raw);
123
124                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
125                 static extern void gst_element_set_base_time(IntPtr raw, ulong time);
126
127                 public ulong BaseTime {
128                         get  {
129                                 ulong raw_ret = gst_element_get_base_time(Handle);
130                                 ulong ret = raw_ret;
131                                 return ret;
132                         }
133                         set  {
134                                 gst_element_set_base_time(Handle, value);
135                         }
136                 }
137
138                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
139                 static extern ulong gst_element_get_start_time(IntPtr raw);
140
141                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
142                 static extern void gst_element_set_start_time(IntPtr raw, ulong time);
143
144                 public ulong StartTime {
145                         get  {
146                                 ulong raw_ret = gst_element_get_start_time(Handle);
147                                 ulong ret = raw_ret;
148                                 return ret;
149                         }
150                         set  {
151                                 gst_element_set_start_time(Handle, value);
152                         }
153                 }
154
155                 public ushort Numpads {
156                         get {
157                                 unsafe {
158                                         ushort* raw_ptr = (ushort*)(((byte*)Handle) + abi_info.GetFieldOffset("numpads"));
159                                         return (*raw_ptr);
160                                 }
161                         }
162                 }
163
164                 public GLib.List Pads {
165                         get {
166                                 unsafe {
167                                         IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("pads"));
168                                         return new GLib.List((*raw_ptr));
169                                 }
170                         }
171                 }
172
173                 public ushort Numsrcpads {
174                         get {
175                                 unsafe {
176                                         ushort* raw_ptr = (ushort*)(((byte*)Handle) + abi_info.GetFieldOffset("numsrcpads"));
177                                         return (*raw_ptr);
178                                 }
179                         }
180                 }
181
182                 public GLib.List Srcpads {
183                         get {
184                                 unsafe {
185                                         IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("srcpads"));
186                                         return new GLib.List((*raw_ptr));
187                                 }
188                         }
189                 }
190
191                 public ushort Numsinkpads {
192                         get {
193                                 unsafe {
194                                         ushort* raw_ptr = (ushort*)(((byte*)Handle) + abi_info.GetFieldOffset("numsinkpads"));
195                                         return (*raw_ptr);
196                                 }
197                         }
198                 }
199
200                 public GLib.List Sinkpads {
201                         get {
202                                 unsafe {
203                                         IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("sinkpads"));
204                                         return new GLib.List((*raw_ptr));
205                                 }
206                         }
207                 }
208
209                 public uint PadsCookie {
210                         get {
211                                 unsafe {
212                                         uint* raw_ptr = (uint*)(((byte*)Handle) + abi_info.GetFieldOffset("pads_cookie"));
213                                         return (*raw_ptr);
214                                 }
215                         }
216                 }
217
218                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
219                 static extern IntPtr gst_element_get_contexts(IntPtr raw);
220
221                 public GLib.List[] Contexts {
222                         get  {
223                                 IntPtr raw_ret = gst_element_get_contexts(Handle);
224                                 GLib.List[] ret = (GLib.List[]) GLib.Marshaller.ListPtrToArray (raw_ret, typeof(GLib.List), true, true, typeof(GLib.List));
225                                 return ret;
226                         }
227                 }
228
229                 [GLib.Signal("no-more-pads")]
230                 public event System.EventHandler NoMorePadsEvent {
231                         add {
232                                 this.AddSignalHandler ("no-more-pads", value);
233                         }
234                         remove {
235                                 this.RemoveSignalHandler ("no-more-pads", value);
236                         }
237                 }
238
239                 [GLib.Signal("pad-removed")]
240                 public event Gst.PadRemovedHandler PadRemoved {
241                         add {
242                                 this.AddSignalHandler ("pad-removed", value, typeof (Gst.PadRemovedArgs));
243                         }
244                         remove {
245                                 this.RemoveSignalHandler ("pad-removed", value);
246                         }
247                 }
248
249                 [GLib.Signal("pad-added")]
250                 public event Gst.PadAddedHandler PadAdded {
251                         add {
252                                 this.AddSignalHandler ("pad-added", value, typeof (Gst.PadAddedArgs));
253                         }
254                         remove {
255                                 this.RemoveSignalHandler ("pad-added", value);
256                         }
257                 }
258
259                 static PadAddedNativeDelegate PadAdded_cb_delegate;
260                 static PadAddedNativeDelegate PadAddedVMCallback {
261                         get {
262                                 if (PadAdded_cb_delegate == null)
263                                         PadAdded_cb_delegate = new PadAddedNativeDelegate (PadAdded_cb);
264                                 return PadAdded_cb_delegate;
265                         }
266                 }
267
268                 static void OverridePadAdded (GLib.GType gtype)
269                 {
270                         OverridePadAdded (gtype, PadAddedVMCallback);
271                 }
272
273                 static void OverridePadAdded (GLib.GType gtype, PadAddedNativeDelegate callback)
274                 {
275                         unsafe {
276                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("pad_added"));
277                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
278                         }
279                 }
280
281                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
282                 delegate void PadAddedNativeDelegate (IntPtr inst, IntPtr new_pad);
283
284                 static void PadAdded_cb (IntPtr inst, IntPtr new_pad)
285                 {
286                         try {
287                                 Element __obj = GLib.Object.GetObject (inst, false) as Element;
288                                 __obj.OnPadAdded (GLib.Object.GetObject(new_pad) as Gst.Pad);
289                         } catch (Exception e) {
290                                 GLib.ExceptionManager.RaiseUnhandledException (e, false);
291                         }
292                 }
293
294                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Element), ConnectionMethod="OverridePadAdded")]
295                 protected virtual void OnPadAdded (Gst.Pad new_pad)
296                 {
297                         InternalPadAdded (new_pad);
298                 }
299
300                 private void InternalPadAdded (Gst.Pad new_pad)
301                 {
302                         PadAddedNativeDelegate unmanaged = null;
303                         unsafe {
304                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("pad_added"));
305                                 unmanaged = (PadAddedNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(PadAddedNativeDelegate));
306                         }
307                         if (unmanaged == null) return;
308
309                         unmanaged (this.Handle, new_pad == null ? IntPtr.Zero : new_pad.Handle);
310                 }
311
312                 static PadRemovedNativeDelegate PadRemoved_cb_delegate;
313                 static PadRemovedNativeDelegate PadRemovedVMCallback {
314                         get {
315                                 if (PadRemoved_cb_delegate == null)
316                                         PadRemoved_cb_delegate = new PadRemovedNativeDelegate (PadRemoved_cb);
317                                 return PadRemoved_cb_delegate;
318                         }
319                 }
320
321                 static void OverridePadRemoved (GLib.GType gtype)
322                 {
323                         OverridePadRemoved (gtype, PadRemovedVMCallback);
324                 }
325
326                 static void OverridePadRemoved (GLib.GType gtype, PadRemovedNativeDelegate callback)
327                 {
328                         unsafe {
329                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("pad_removed"));
330                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
331                         }
332                 }
333
334                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
335                 delegate void PadRemovedNativeDelegate (IntPtr inst, IntPtr old_pad);
336
337                 static void PadRemoved_cb (IntPtr inst, IntPtr old_pad)
338                 {
339                         try {
340                                 Element __obj = GLib.Object.GetObject (inst, false) as Element;
341                                 __obj.OnPadRemoved (GLib.Object.GetObject(old_pad) as Gst.Pad);
342                         } catch (Exception e) {
343                                 GLib.ExceptionManager.RaiseUnhandledException (e, false);
344                         }
345                 }
346
347                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Element), ConnectionMethod="OverridePadRemoved")]
348                 protected virtual void OnPadRemoved (Gst.Pad old_pad)
349                 {
350                         InternalPadRemoved (old_pad);
351                 }
352
353                 private void InternalPadRemoved (Gst.Pad old_pad)
354                 {
355                         PadRemovedNativeDelegate unmanaged = null;
356                         unsafe {
357                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("pad_removed"));
358                                 unmanaged = (PadRemovedNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(PadRemovedNativeDelegate));
359                         }
360                         if (unmanaged == null) return;
361
362                         unmanaged (this.Handle, old_pad == null ? IntPtr.Zero : old_pad.Handle);
363                 }
364
365                 static NoMorePadsEventNativeDelegate NoMorePadsEvent_cb_delegate;
366                 static NoMorePadsEventNativeDelegate NoMorePadsEventVMCallback {
367                         get {
368                                 if (NoMorePadsEvent_cb_delegate == null)
369                                         NoMorePadsEvent_cb_delegate = new NoMorePadsEventNativeDelegate (NoMorePadsEvent_cb);
370                                 return NoMorePadsEvent_cb_delegate;
371                         }
372                 }
373
374                 static void OverrideNoMorePadsEvent (GLib.GType gtype)
375                 {
376                         OverrideNoMorePadsEvent (gtype, NoMorePadsEventVMCallback);
377                 }
378
379                 static void OverrideNoMorePadsEvent (GLib.GType gtype, NoMorePadsEventNativeDelegate callback)
380                 {
381                         unsafe {
382                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("no_more_pads"));
383                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
384                         }
385                 }
386
387                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
388                 delegate void NoMorePadsEventNativeDelegate (IntPtr inst);
389
390                 static void NoMorePadsEvent_cb (IntPtr inst)
391                 {
392                         try {
393                                 Element __obj = GLib.Object.GetObject (inst, false) as Element;
394                                 __obj.OnNoMorePadsEvent ();
395                         } catch (Exception e) {
396                                 GLib.ExceptionManager.RaiseUnhandledException (e, false);
397                         }
398                 }
399
400                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Element), ConnectionMethod="OverrideNoMorePadsEvent")]
401                 protected virtual void OnNoMorePadsEvent ()
402                 {
403                         InternalNoMorePadsEvent ();
404                 }
405
406                 private void InternalNoMorePadsEvent ()
407                 {
408                         NoMorePadsEventNativeDelegate unmanaged = null;
409                         unsafe {
410                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("no_more_pads"));
411                                 unmanaged = (NoMorePadsEventNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(NoMorePadsEventNativeDelegate));
412                         }
413                         if (unmanaged == null) return;
414
415                         unmanaged (this.Handle);
416                 }
417
418                 static RequestNewPadNativeDelegate RequestNewPad_cb_delegate;
419                 static RequestNewPadNativeDelegate RequestNewPadVMCallback {
420                         get {
421                                 if (RequestNewPad_cb_delegate == null)
422                                         RequestNewPad_cb_delegate = new RequestNewPadNativeDelegate (RequestNewPad_cb);
423                                 return RequestNewPad_cb_delegate;
424                         }
425                 }
426
427                 static void OverrideRequestNewPad (GLib.GType gtype)
428                 {
429                         OverrideRequestNewPad (gtype, RequestNewPadVMCallback);
430                 }
431
432                 static void OverrideRequestNewPad (GLib.GType gtype, RequestNewPadNativeDelegate callback)
433                 {
434                         unsafe {
435                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("request_new_pad"));
436                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
437                         }
438                 }
439
440                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
441                 delegate IntPtr RequestNewPadNativeDelegate (IntPtr inst, IntPtr templ, IntPtr name, IntPtr caps);
442
443                 static IntPtr RequestNewPad_cb (IntPtr inst, IntPtr templ, IntPtr name, IntPtr caps)
444                 {
445                         try {
446                                 Element __obj = GLib.Object.GetObject (inst, false) as Element;
447                                 Gst.Pad __result;
448                                 __result = __obj.OnRequestNewPad (GLib.Object.GetObject(templ) as Gst.PadTemplate, GLib.Marshaller.Utf8PtrToString (name), caps == IntPtr.Zero ? null : (Gst.Caps) GLib.Opaque.GetOpaque (caps, typeof (Gst.Caps), false));
449                                 return __result == null ? IntPtr.Zero : __result.OwnedHandle;
450                         } catch (Exception e) {
451                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
452                                 // NOTREACHED: above call does not return.
453                                 throw e;
454                         }
455                 }
456
457                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Element), ConnectionMethod="OverrideRequestNewPad")]
458                 protected virtual Gst.Pad OnRequestNewPad (Gst.PadTemplate templ, string name, Gst.Caps caps)
459                 {
460                         return InternalRequestNewPad (templ, name, caps);
461                 }
462
463                 private Gst.Pad InternalRequestNewPad (Gst.PadTemplate templ, string name, Gst.Caps caps)
464                 {
465                         RequestNewPadNativeDelegate unmanaged = null;
466                         unsafe {
467                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("request_new_pad"));
468                                 unmanaged = (RequestNewPadNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(RequestNewPadNativeDelegate));
469                         }
470                         if (unmanaged == null) return null;
471
472                         IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
473                         IntPtr __result = unmanaged (this.Handle, templ == null ? IntPtr.Zero : templ.Handle, native_name, caps == null ? IntPtr.Zero : caps.Handle);
474                         GLib.Marshaller.Free (native_name);
475                         return GLib.Object.GetObject(__result, true) as Gst.Pad;
476                 }
477
478                 static ReleasePadNativeDelegate ReleasePad_cb_delegate;
479                 static ReleasePadNativeDelegate ReleasePadVMCallback {
480                         get {
481                                 if (ReleasePad_cb_delegate == null)
482                                         ReleasePad_cb_delegate = new ReleasePadNativeDelegate (ReleasePad_cb);
483                                 return ReleasePad_cb_delegate;
484                         }
485                 }
486
487                 static void OverrideReleasePad (GLib.GType gtype)
488                 {
489                         OverrideReleasePad (gtype, ReleasePadVMCallback);
490                 }
491
492                 static void OverrideReleasePad (GLib.GType gtype, ReleasePadNativeDelegate callback)
493                 {
494                         unsafe {
495                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("release_pad"));
496                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
497                         }
498                 }
499
500                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
501                 delegate void ReleasePadNativeDelegate (IntPtr inst, IntPtr pad);
502
503                 static void ReleasePad_cb (IntPtr inst, IntPtr pad)
504                 {
505                         try {
506                                 Element __obj = GLib.Object.GetObject (inst, false) as Element;
507                                 __obj.OnReleasePad (GLib.Object.GetObject(pad) as Gst.Pad);
508                         } catch (Exception e) {
509                                 GLib.ExceptionManager.RaiseUnhandledException (e, false);
510                         }
511                 }
512
513                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Element), ConnectionMethod="OverrideReleasePad")]
514                 protected virtual void OnReleasePad (Gst.Pad pad)
515                 {
516                         InternalReleasePad (pad);
517                 }
518
519                 private void InternalReleasePad (Gst.Pad pad)
520                 {
521                         ReleasePadNativeDelegate unmanaged = null;
522                         unsafe {
523                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("release_pad"));
524                                 unmanaged = (ReleasePadNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(ReleasePadNativeDelegate));
525                         }
526                         if (unmanaged == null) return;
527
528                         unmanaged (this.Handle, pad == null ? IntPtr.Zero : pad.Handle);
529                 }
530
531                 static GetStateNativeDelegate GetState_cb_delegate;
532                 static GetStateNativeDelegate GetStateVMCallback {
533                         get {
534                                 if (GetState_cb_delegate == null)
535                                         GetState_cb_delegate = new GetStateNativeDelegate (GetState_cb);
536                                 return GetState_cb_delegate;
537                         }
538                 }
539
540                 static void OverrideGetState (GLib.GType gtype)
541                 {
542                         OverrideGetState (gtype, GetStateVMCallback);
543                 }
544
545                 static void OverrideGetState (GLib.GType gtype, GetStateNativeDelegate callback)
546                 {
547                         unsafe {
548                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("get_state"));
549                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
550                         }
551                 }
552
553                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
554                 delegate int GetStateNativeDelegate (IntPtr inst, out int state, out int pending, ulong timeout);
555
556                 static int GetState_cb (IntPtr inst, out int state, out int pending, ulong timeout)
557                 {
558                         try {
559                                 Element __obj = GLib.Object.GetObject (inst, false) as Element;
560                                 Gst.StateChangeReturn __result;
561                                 Gst.State mystate;
562                                 Gst.State mypending;
563                                 __result = __obj.OnGetState (out mystate, out mypending, timeout);
564                                 state = (int) mystate;
565                                 pending = (int) mypending;
566                                 return (int) __result;
567                         } catch (Exception e) {
568                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
569                                 // NOTREACHED: above call does not return.
570                                 throw e;
571                         }
572                 }
573
574                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Element), ConnectionMethod="OverrideGetState")]
575                 protected virtual Gst.StateChangeReturn OnGetState (out Gst.State state, out Gst.State pending, ulong timeout)
576                 {
577                         return InternalGetState (out state, out pending, timeout);
578                 }
579
580                 private Gst.StateChangeReturn InternalGetState (out Gst.State state, out Gst.State pending, ulong timeout)
581                 {
582                         GetStateNativeDelegate unmanaged = null;
583                         unsafe {
584                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("get_state"));
585                                 unmanaged = (GetStateNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(GetStateNativeDelegate));
586                         }
587                         if (unmanaged == null) throw new InvalidOperationException ("No base method to invoke");
588
589                         int native_state;
590                         int native_pending;
591                         int __result = unmanaged (this.Handle, out native_state, out native_pending, timeout);
592                         state = (Gst.State) native_state;
593                         pending = (Gst.State) native_pending;
594                         return (Gst.StateChangeReturn) __result;
595                 }
596
597                 static SetStateNativeDelegate SetState_cb_delegate;
598                 static SetStateNativeDelegate SetStateVMCallback {
599                         get {
600                                 if (SetState_cb_delegate == null)
601                                         SetState_cb_delegate = new SetStateNativeDelegate (SetState_cb);
602                                 return SetState_cb_delegate;
603                         }
604                 }
605
606                 static void OverrideSetState (GLib.GType gtype)
607                 {
608                         OverrideSetState (gtype, SetStateVMCallback);
609                 }
610
611                 static void OverrideSetState (GLib.GType gtype, SetStateNativeDelegate callback)
612                 {
613                         unsafe {
614                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("set_state"));
615                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
616                         }
617                 }
618
619                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
620                 delegate int SetStateNativeDelegate (IntPtr inst, int state);
621
622                 static int SetState_cb (IntPtr inst, int state)
623                 {
624                         try {
625                                 Element __obj = GLib.Object.GetObject (inst, false) as Element;
626                                 Gst.StateChangeReturn __result;
627                                 __result = __obj.OnSetState ((Gst.State) state);
628                                 return (int) __result;
629                         } catch (Exception e) {
630                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
631                                 // NOTREACHED: above call does not return.
632                                 throw e;
633                         }
634                 }
635
636                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Element), ConnectionMethod="OverrideSetState")]
637                 protected virtual Gst.StateChangeReturn OnSetState (Gst.State state)
638                 {
639                         return InternalSetState (state);
640                 }
641
642                 private Gst.StateChangeReturn InternalSetState (Gst.State state)
643                 {
644                         SetStateNativeDelegate unmanaged = null;
645                         unsafe {
646                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("set_state"));
647                                 unmanaged = (SetStateNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(SetStateNativeDelegate));
648                         }
649                         if (unmanaged == null) return (Gst.StateChangeReturn) 0;
650
651                         int __result = unmanaged (this.Handle, (int) state);
652                         return (Gst.StateChangeReturn) __result;
653                 }
654
655                 static ChangeStateNativeDelegate ChangeState_cb_delegate;
656                 static ChangeStateNativeDelegate ChangeStateVMCallback {
657                         get {
658                                 if (ChangeState_cb_delegate == null)
659                                         ChangeState_cb_delegate = new ChangeStateNativeDelegate (ChangeState_cb);
660                                 return ChangeState_cb_delegate;
661                         }
662                 }
663
664                 static void OverrideChangeState (GLib.GType gtype)
665                 {
666                         OverrideChangeState (gtype, ChangeStateVMCallback);
667                 }
668
669                 static void OverrideChangeState (GLib.GType gtype, ChangeStateNativeDelegate callback)
670                 {
671                         unsafe {
672                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("change_state"));
673                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
674                         }
675                 }
676
677                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
678                 delegate int ChangeStateNativeDelegate (IntPtr inst, int transition);
679
680                 static int ChangeState_cb (IntPtr inst, int transition)
681                 {
682                         try {
683                                 Element __obj = GLib.Object.GetObject (inst, false) as Element;
684                                 Gst.StateChangeReturn __result;
685                                 __result = __obj.OnChangeState ((Gst.StateChange) transition);
686                                 return (int) __result;
687                         } catch (Exception e) {
688                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
689                                 // NOTREACHED: above call does not return.
690                                 throw e;
691                         }
692                 }
693
694                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Element), ConnectionMethod="OverrideChangeState")]
695                 protected virtual Gst.StateChangeReturn OnChangeState (Gst.StateChange transition)
696                 {
697                         return InternalChangeState (transition);
698                 }
699
700                 private Gst.StateChangeReturn InternalChangeState (Gst.StateChange transition)
701                 {
702                         ChangeStateNativeDelegate unmanaged = null;
703                         unsafe {
704                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("change_state"));
705                                 unmanaged = (ChangeStateNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(ChangeStateNativeDelegate));
706                         }
707                         if (unmanaged == null) return (Gst.StateChangeReturn) 0;
708
709                         int __result = unmanaged (this.Handle, (int) transition);
710                         return (Gst.StateChangeReturn) __result;
711                 }
712
713                 static StateChangedNativeDelegate StateChanged_cb_delegate;
714                 static StateChangedNativeDelegate StateChangedVMCallback {
715                         get {
716                                 if (StateChanged_cb_delegate == null)
717                                         StateChanged_cb_delegate = new StateChangedNativeDelegate (StateChanged_cb);
718                                 return StateChanged_cb_delegate;
719                         }
720                 }
721
722                 static void OverrideStateChanged (GLib.GType gtype)
723                 {
724                         OverrideStateChanged (gtype, StateChangedVMCallback);
725                 }
726
727                 static void OverrideStateChanged (GLib.GType gtype, StateChangedNativeDelegate callback)
728                 {
729                         unsafe {
730                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("state_changed"));
731                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
732                         }
733                 }
734
735                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
736                 delegate void StateChangedNativeDelegate (IntPtr inst, int oldstate, int newstate, int pending);
737
738                 static void StateChanged_cb (IntPtr inst, int oldstate, int newstate, int pending)
739                 {
740                         try {
741                                 Element __obj = GLib.Object.GetObject (inst, false) as Element;
742                                 __obj.OnStateChanged ((Gst.State) oldstate, (Gst.State) newstate, (Gst.State) pending);
743                         } catch (Exception e) {
744                                 GLib.ExceptionManager.RaiseUnhandledException (e, false);
745                         }
746                 }
747
748                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Element), ConnectionMethod="OverrideStateChanged")]
749                 protected virtual void OnStateChanged (Gst.State oldstate, Gst.State newstate, Gst.State pending)
750                 {
751                         InternalStateChanged (oldstate, newstate, pending);
752                 }
753
754                 private void InternalStateChanged (Gst.State oldstate, Gst.State newstate, Gst.State pending)
755                 {
756                         StateChangedNativeDelegate unmanaged = null;
757                         unsafe {
758                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("state_changed"));
759                                 unmanaged = (StateChangedNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(StateChangedNativeDelegate));
760                         }
761                         if (unmanaged == null) return;
762
763                         unmanaged (this.Handle, (int) oldstate, (int) newstate, (int) pending);
764                 }
765
766                 static SetBusNativeDelegate SetBus_cb_delegate;
767                 static SetBusNativeDelegate SetBusVMCallback {
768                         get {
769                                 if (SetBus_cb_delegate == null)
770                                         SetBus_cb_delegate = new SetBusNativeDelegate (SetBus_cb);
771                                 return SetBus_cb_delegate;
772                         }
773                 }
774
775                 static void OverrideSetBus (GLib.GType gtype)
776                 {
777                         OverrideSetBus (gtype, SetBusVMCallback);
778                 }
779
780                 static void OverrideSetBus (GLib.GType gtype, SetBusNativeDelegate callback)
781                 {
782                         unsafe {
783                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("set_bus"));
784                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
785                         }
786                 }
787
788                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
789                 delegate void SetBusNativeDelegate (IntPtr inst, IntPtr bus);
790
791                 static void SetBus_cb (IntPtr inst, IntPtr bus)
792                 {
793                         try {
794                                 Element __obj = GLib.Object.GetObject (inst, false) as Element;
795                                 __obj.OnSetBus (GLib.Object.GetObject(bus) as Gst.Bus);
796                         } catch (Exception e) {
797                                 GLib.ExceptionManager.RaiseUnhandledException (e, false);
798                         }
799                 }
800
801                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Element), ConnectionMethod="OverrideSetBus")]
802                 protected virtual void OnSetBus (Gst.Bus bus)
803                 {
804                         InternalSetBus (bus);
805                 }
806
807                 private void InternalSetBus (Gst.Bus bus)
808                 {
809                         SetBusNativeDelegate unmanaged = null;
810                         unsafe {
811                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("set_bus"));
812                                 unmanaged = (SetBusNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(SetBusNativeDelegate));
813                         }
814                         if (unmanaged == null) return;
815
816                         unmanaged (this.Handle, bus == null ? IntPtr.Zero : bus.Handle);
817                 }
818
819                 static ProvideClockNativeDelegate ProvideClock_cb_delegate;
820                 static ProvideClockNativeDelegate ProvideClockVMCallback {
821                         get {
822                                 if (ProvideClock_cb_delegate == null)
823                                         ProvideClock_cb_delegate = new ProvideClockNativeDelegate (ProvideClock_cb);
824                                 return ProvideClock_cb_delegate;
825                         }
826                 }
827
828                 static void OverrideProvideClock (GLib.GType gtype)
829                 {
830                         OverrideProvideClock (gtype, ProvideClockVMCallback);
831                 }
832
833                 static void OverrideProvideClock (GLib.GType gtype, ProvideClockNativeDelegate callback)
834                 {
835                         unsafe {
836                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("provide_clock"));
837                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
838                         }
839                 }
840
841                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
842                 delegate IntPtr ProvideClockNativeDelegate (IntPtr inst);
843
844                 static IntPtr ProvideClock_cb (IntPtr inst)
845                 {
846                         try {
847                                 Element __obj = GLib.Object.GetObject (inst, false) as Element;
848                                 Gst.Clock __result;
849                                 __result = __obj.OnProvideClock ();
850                                 return __result == null ? IntPtr.Zero : __result.OwnedHandle;
851                         } catch (Exception e) {
852                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
853                                 // NOTREACHED: above call does not return.
854                                 throw e;
855                         }
856                 }
857
858                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Element), ConnectionMethod="OverrideProvideClock")]
859                 protected virtual Gst.Clock OnProvideClock ()
860                 {
861                         return InternalProvideClock ();
862                 }
863
864                 private Gst.Clock InternalProvideClock ()
865                 {
866                         ProvideClockNativeDelegate unmanaged = null;
867                         unsafe {
868                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("provide_clock"));
869                                 unmanaged = (ProvideClockNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(ProvideClockNativeDelegate));
870                         }
871                         if (unmanaged == null) return null;
872
873                         IntPtr __result = unmanaged (this.Handle);
874                         return GLib.Object.GetObject(__result, true) as Gst.Clock;
875                 }
876
877                 static SetClockNativeDelegate SetClock_cb_delegate;
878                 static SetClockNativeDelegate SetClockVMCallback {
879                         get {
880                                 if (SetClock_cb_delegate == null)
881                                         SetClock_cb_delegate = new SetClockNativeDelegate (SetClock_cb);
882                                 return SetClock_cb_delegate;
883                         }
884                 }
885
886                 static void OverrideSetClock (GLib.GType gtype)
887                 {
888                         OverrideSetClock (gtype, SetClockVMCallback);
889                 }
890
891                 static void OverrideSetClock (GLib.GType gtype, SetClockNativeDelegate callback)
892                 {
893                         unsafe {
894                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("set_clock"));
895                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
896                         }
897                 }
898
899                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
900                 delegate bool SetClockNativeDelegate (IntPtr inst, IntPtr clock);
901
902                 static bool SetClock_cb (IntPtr inst, IntPtr clock)
903                 {
904                         try {
905                                 Element __obj = GLib.Object.GetObject (inst, false) as Element;
906                                 bool __result;
907                                 __result = __obj.OnSetClock (GLib.Object.GetObject(clock) as Gst.Clock);
908                                 return __result;
909                         } catch (Exception e) {
910                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
911                                 // NOTREACHED: above call does not return.
912                                 throw e;
913                         }
914                 }
915
916                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Element), ConnectionMethod="OverrideSetClock")]
917                 protected virtual bool OnSetClock (Gst.Clock clock)
918                 {
919                         return InternalSetClock (clock);
920                 }
921
922                 private bool InternalSetClock (Gst.Clock clock)
923                 {
924                         SetClockNativeDelegate unmanaged = null;
925                         unsafe {
926                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("set_clock"));
927                                 unmanaged = (SetClockNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(SetClockNativeDelegate));
928                         }
929                         if (unmanaged == null) return false;
930
931                         bool __result = unmanaged (this.Handle, clock == null ? IntPtr.Zero : clock.Handle);
932                         return __result;
933                 }
934
935                 static SendEventNativeDelegate SendEvent_cb_delegate;
936                 static SendEventNativeDelegate SendEventVMCallback {
937                         get {
938                                 if (SendEvent_cb_delegate == null)
939                                         SendEvent_cb_delegate = new SendEventNativeDelegate (SendEvent_cb);
940                                 return SendEvent_cb_delegate;
941                         }
942                 }
943
944                 static void OverrideSendEvent (GLib.GType gtype)
945                 {
946                         OverrideSendEvent (gtype, SendEventVMCallback);
947                 }
948
949                 static void OverrideSendEvent (GLib.GType gtype, SendEventNativeDelegate callback)
950                 {
951                         unsafe {
952                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("send_event"));
953                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
954                         }
955                 }
956
957                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
958                 delegate bool SendEventNativeDelegate (IntPtr inst, IntPtr evnt);
959
960                 static bool SendEvent_cb (IntPtr inst, IntPtr evnt)
961                 {
962                         try {
963                                 Element __obj = GLib.Object.GetObject (inst, false) as Element;
964                                 bool __result;
965                                 __result = __obj.OnSendEvent (evnt == IntPtr.Zero ? null : (Gst.Event) GLib.Opaque.GetOpaque (evnt, typeof (Gst.Event), true));
966                                 return __result;
967                         } catch (Exception e) {
968                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
969                                 // NOTREACHED: above call does not return.
970                                 throw e;
971                         }
972                 }
973
974                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Element), ConnectionMethod="OverrideSendEvent")]
975                 protected virtual bool OnSendEvent (Gst.Event evnt)
976                 {
977                         return InternalSendEvent (evnt);
978                 }
979
980                 private bool InternalSendEvent (Gst.Event evnt)
981                 {
982                         SendEventNativeDelegate unmanaged = null;
983                         unsafe {
984                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("send_event"));
985                                 unmanaged = (SendEventNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(SendEventNativeDelegate));
986                         }
987                         if (unmanaged == null) return false;
988
989                         evnt.Owned = false;
990                         bool __result = unmanaged (this.Handle, evnt == null ? IntPtr.Zero : evnt.Handle);
991                         return __result;
992                 }
993
994                 static QueryNativeDelegate Query_cb_delegate;
995                 static QueryNativeDelegate QueryVMCallback {
996                         get {
997                                 if (Query_cb_delegate == null)
998                                         Query_cb_delegate = new QueryNativeDelegate (Query_cb);
999                                 return Query_cb_delegate;
1000                         }
1001                 }
1002
1003                 static void OverrideQuery (GLib.GType gtype)
1004                 {
1005                         OverrideQuery (gtype, QueryVMCallback);
1006                 }
1007
1008                 static void OverrideQuery (GLib.GType gtype, QueryNativeDelegate callback)
1009                 {
1010                         unsafe {
1011                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("query"));
1012                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
1013                         }
1014                 }
1015
1016                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
1017                 delegate bool QueryNativeDelegate (IntPtr inst, IntPtr query);
1018
1019                 static bool Query_cb (IntPtr inst, IntPtr query)
1020                 {
1021                         try {
1022                                 Element __obj = GLib.Object.GetObject (inst, false) as Element;
1023                                 bool __result;
1024                                 __result = __obj.OnQuery (query == IntPtr.Zero ? null : (Gst.Query) GLib.Opaque.GetOpaque (query, typeof (Gst.Query), false));
1025                                 return __result;
1026                         } catch (Exception e) {
1027                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
1028                                 // NOTREACHED: above call does not return.
1029                                 throw e;
1030                         }
1031                 }
1032
1033                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Element), ConnectionMethod="OverrideQuery")]
1034                 protected virtual bool OnQuery (Gst.Query query)
1035                 {
1036                         return InternalQuery (query);
1037                 }
1038
1039                 private bool InternalQuery (Gst.Query query)
1040                 {
1041                         QueryNativeDelegate unmanaged = null;
1042                         unsafe {
1043                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("query"));
1044                                 unmanaged = (QueryNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(QueryNativeDelegate));
1045                         }
1046                         if (unmanaged == null) return false;
1047
1048                         bool __result = unmanaged (this.Handle, query == null ? IntPtr.Zero : query.Handle);
1049                         return __result;
1050                 }
1051
1052                 static PostMessageNativeDelegate PostMessage_cb_delegate;
1053                 static PostMessageNativeDelegate PostMessageVMCallback {
1054                         get {
1055                                 if (PostMessage_cb_delegate == null)
1056                                         PostMessage_cb_delegate = new PostMessageNativeDelegate (PostMessage_cb);
1057                                 return PostMessage_cb_delegate;
1058                         }
1059                 }
1060
1061                 static void OverridePostMessage (GLib.GType gtype)
1062                 {
1063                         OverridePostMessage (gtype, PostMessageVMCallback);
1064                 }
1065
1066                 static void OverridePostMessage (GLib.GType gtype, PostMessageNativeDelegate callback)
1067                 {
1068                         unsafe {
1069                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("post_message"));
1070                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
1071                         }
1072                 }
1073
1074                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
1075                 delegate bool PostMessageNativeDelegate (IntPtr inst, IntPtr message);
1076
1077                 static bool PostMessage_cb (IntPtr inst, IntPtr message)
1078                 {
1079                         try {
1080                                 Element __obj = GLib.Object.GetObject (inst, false) as Element;
1081                                 bool __result;
1082                                 __result = __obj.OnPostMessage (message == IntPtr.Zero ? null : (Gst.Message) GLib.Opaque.GetOpaque (message, typeof (Gst.Message), true));
1083                                 return __result;
1084                         } catch (Exception e) {
1085                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
1086                                 // NOTREACHED: above call does not return.
1087                                 throw e;
1088                         }
1089                 }
1090
1091                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Element), ConnectionMethod="OverridePostMessage")]
1092                 protected virtual bool OnPostMessage (Gst.Message message)
1093                 {
1094                         return InternalPostMessage (message);
1095                 }
1096
1097                 private bool InternalPostMessage (Gst.Message message)
1098                 {
1099                         PostMessageNativeDelegate unmanaged = null;
1100                         unsafe {
1101                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("post_message"));
1102                                 unmanaged = (PostMessageNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(PostMessageNativeDelegate));
1103                         }
1104                         if (unmanaged == null) return false;
1105
1106                         message.Owned = false;
1107                         bool __result = unmanaged (this.Handle, message == null ? IntPtr.Zero : message.Handle);
1108                         return __result;
1109                 }
1110
1111                 static SetContextNativeDelegate SetContext_cb_delegate;
1112                 static SetContextNativeDelegate SetContextVMCallback {
1113                         get {
1114                                 if (SetContext_cb_delegate == null)
1115                                         SetContext_cb_delegate = new SetContextNativeDelegate (SetContext_cb);
1116                                 return SetContext_cb_delegate;
1117                         }
1118                 }
1119
1120                 static void OverrideSetContext (GLib.GType gtype)
1121                 {
1122                         OverrideSetContext (gtype, SetContextVMCallback);
1123                 }
1124
1125                 static void OverrideSetContext (GLib.GType gtype, SetContextNativeDelegate callback)
1126                 {
1127                         unsafe {
1128                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("set_context"));
1129                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
1130                         }
1131                 }
1132
1133                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
1134                 delegate void SetContextNativeDelegate (IntPtr inst, IntPtr context);
1135
1136                 static void SetContext_cb (IntPtr inst, IntPtr context)
1137                 {
1138                         try {
1139                                 Element __obj = GLib.Object.GetObject (inst, false) as Element;
1140                                 __obj.OnSetContext (Gst.Context.New (context));
1141                         } catch (Exception e) {
1142                                 GLib.ExceptionManager.RaiseUnhandledException (e, false);
1143                         }
1144                 }
1145
1146                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Element), ConnectionMethod="OverrideSetContext")]
1147                 protected virtual void OnSetContext (Gst.Context context)
1148                 {
1149                         InternalSetContext (context);
1150                 }
1151
1152                 private void InternalSetContext (Gst.Context context)
1153                 {
1154                         SetContextNativeDelegate unmanaged = null;
1155                         unsafe {
1156                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("set_context"));
1157                                 unmanaged = (SetContextNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(SetContextNativeDelegate));
1158                         }
1159                         if (unmanaged == null) return;
1160
1161                         IntPtr native_context = GLib.Marshaller.StructureToPtrAlloc (context);
1162                         unmanaged (this.Handle, native_context);
1163                         Marshal.FreeHGlobal (native_context);
1164                 }
1165
1166
1167                 // Internal representation of the wrapped structure ABI.
1168                 static GLib.AbiStruct _class_abi = null;
1169                 static public new GLib.AbiStruct class_abi {
1170                         get {
1171                                 if (_class_abi == null)
1172                                         _class_abi = new GLib.AbiStruct (new List<GLib.AbiField>{ 
1173                                                 new GLib.AbiField("metadata"
1174                                                         , Gst.Object.class_abi.Fields
1175                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // metadata
1176                                                         , null
1177                                                         , "elementfactory"
1178                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1179                                                         , 0
1180                                                         ),
1181                                                 new GLib.AbiField("elementfactory"
1182                                                         , -1
1183                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // elementfactory
1184                                                         , "metadata"
1185                                                         , "padtemplates"
1186                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1187                                                         , 0
1188                                                         ),
1189                                                 new GLib.AbiField("padtemplates"
1190                                                         , -1
1191                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // padtemplates
1192                                                         , "elementfactory"
1193                                                         , "numpadtemplates"
1194                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1195                                                         , 0
1196                                                         ),
1197                                                 new GLib.AbiField("numpadtemplates"
1198                                                         , -1
1199                                                         , (uint) Marshal.SizeOf(typeof(int)) // numpadtemplates
1200                                                         , "padtemplates"
1201                                                         , "pad_templ_cookie"
1202                                                         , (long) Marshal.OffsetOf(typeof(GstElement_numpadtemplatesAlign), "numpadtemplates")
1203                                                         , 0
1204                                                         ),
1205                                                 new GLib.AbiField("pad_templ_cookie"
1206                                                         , -1
1207                                                         , (uint) Marshal.SizeOf(typeof(uint)) // pad_templ_cookie
1208                                                         , "numpadtemplates"
1209                                                         , "pad_added"
1210                                                         , (long) Marshal.OffsetOf(typeof(GstElement_pad_templ_cookieAlign), "pad_templ_cookie")
1211                                                         , 0
1212                                                         ),
1213                                                 new GLib.AbiField("pad_added"
1214                                                         , -1
1215                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // pad_added
1216                                                         , "pad_templ_cookie"
1217                                                         , "pad_removed"
1218                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1219                                                         , 0
1220                                                         ),
1221                                                 new GLib.AbiField("pad_removed"
1222                                                         , -1
1223                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // pad_removed
1224                                                         , "pad_added"
1225                                                         , "no_more_pads"
1226                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1227                                                         , 0
1228                                                         ),
1229                                                 new GLib.AbiField("no_more_pads"
1230                                                         , -1
1231                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // no_more_pads
1232                                                         , "pad_removed"
1233                                                         , "request_new_pad"
1234                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1235                                                         , 0
1236                                                         ),
1237                                                 new GLib.AbiField("request_new_pad"
1238                                                         , -1
1239                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // request_new_pad
1240                                                         , "no_more_pads"
1241                                                         , "release_pad"
1242                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1243                                                         , 0
1244                                                         ),
1245                                                 new GLib.AbiField("release_pad"
1246                                                         , -1
1247                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // release_pad
1248                                                         , "request_new_pad"
1249                                                         , "get_state"
1250                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1251                                                         , 0
1252                                                         ),
1253                                                 new GLib.AbiField("get_state"
1254                                                         , -1
1255                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // get_state
1256                                                         , "release_pad"
1257                                                         , "set_state"
1258                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1259                                                         , 0
1260                                                         ),
1261                                                 new GLib.AbiField("set_state"
1262                                                         , -1
1263                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // set_state
1264                                                         , "get_state"
1265                                                         , "change_state"
1266                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1267                                                         , 0
1268                                                         ),
1269                                                 new GLib.AbiField("change_state"
1270                                                         , -1
1271                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // change_state
1272                                                         , "set_state"
1273                                                         , "state_changed"
1274                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1275                                                         , 0
1276                                                         ),
1277                                                 new GLib.AbiField("state_changed"
1278                                                         , -1
1279                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // state_changed
1280                                                         , "change_state"
1281                                                         , "set_bus"
1282                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1283                                                         , 0
1284                                                         ),
1285                                                 new GLib.AbiField("set_bus"
1286                                                         , -1
1287                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // set_bus
1288                                                         , "state_changed"
1289                                                         , "provide_clock"
1290                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1291                                                         , 0
1292                                                         ),
1293                                                 new GLib.AbiField("provide_clock"
1294                                                         , -1
1295                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // provide_clock
1296                                                         , "set_bus"
1297                                                         , "set_clock"
1298                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1299                                                         , 0
1300                                                         ),
1301                                                 new GLib.AbiField("set_clock"
1302                                                         , -1
1303                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // set_clock
1304                                                         , "provide_clock"
1305                                                         , "send_event"
1306                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1307                                                         , 0
1308                                                         ),
1309                                                 new GLib.AbiField("send_event"
1310                                                         , -1
1311                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // send_event
1312                                                         , "set_clock"
1313                                                         , "query"
1314                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1315                                                         , 0
1316                                                         ),
1317                                                 new GLib.AbiField("query"
1318                                                         , -1
1319                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // query
1320                                                         , "send_event"
1321                                                         , "post_message"
1322                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1323                                                         , 0
1324                                                         ),
1325                                                 new GLib.AbiField("post_message"
1326                                                         , -1
1327                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // post_message
1328                                                         , "query"
1329                                                         , "set_context"
1330                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1331                                                         , 0
1332                                                         ),
1333                                                 new GLib.AbiField("set_context"
1334                                                         , -1
1335                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // set_context
1336                                                         , "post_message"
1337                                                         , "_gst_reserved"
1338                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1339                                                         , 0
1340                                                         ),
1341                                                 new GLib.AbiField("_gst_reserved"
1342                                                         , -1
1343                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) * 18 // _gst_reserved
1344                                                         , "set_context"
1345                                                         , null
1346                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1347                                                         , 0
1348                                                         ),
1349                                         });
1350
1351                                 return _class_abi;
1352                         }
1353                 }
1354
1355                 [StructLayout(LayoutKind.Sequential)]
1356                 public struct GstElement_numpadtemplatesAlign
1357                 {
1358                         sbyte f1;
1359                         private int numpadtemplates;
1360                 }
1361
1362                 [StructLayout(LayoutKind.Sequential)]
1363                 public struct GstElement_pad_templ_cookieAlign
1364                 {
1365                         sbyte f1;
1366                         private uint pad_templ_cookie;
1367                 }
1368
1369
1370                 // End of the ABI representation.
1371
1372                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1373                 static extern IntPtr gst_element_get_type();
1374
1375                 public static new GLib.GType GType { 
1376                         get {
1377                                 IntPtr raw_ret = gst_element_get_type();
1378                                 GLib.GType ret = new GLib.GType(raw_ret);
1379                                 return ret;
1380                         }
1381                 }
1382
1383                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1384                 static extern unsafe IntPtr gst_element_make_from_uri(int type, IntPtr uri, IntPtr elementname, out IntPtr error);
1385
1386                 public static unsafe Gst.Element MakeFromUri(Gst.URIType type, string uri, string elementname) {
1387                         IntPtr native_uri = GLib.Marshaller.StringToPtrGStrdup (uri);
1388                         IntPtr native_elementname = GLib.Marshaller.StringToPtrGStrdup (elementname);
1389                         IntPtr error = IntPtr.Zero;
1390                         IntPtr raw_ret = gst_element_make_from_uri((int) type, native_uri, native_elementname, out error);
1391                         Gst.Element ret = GLib.Object.GetObject(raw_ret) as Gst.Element;
1392                         GLib.Marshaller.Free (native_uri);
1393                         GLib.Marshaller.Free (native_elementname);
1394                         if (error != IntPtr.Zero) throw new GLib.GException (error);
1395                         return ret;
1396                 }
1397
1398                 public static Gst.Element MakeFromUri(Gst.URIType type, string uri) {
1399                         return MakeFromUri (type, uri, null);
1400                 }
1401
1402                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1403                 static extern bool gst_element_register(IntPtr plugin, IntPtr name, uint rank, IntPtr type);
1404
1405                 public static bool Register(Gst.Plugin plugin, string name, uint rank, GLib.GType type) {
1406                         IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
1407                         bool raw_ret = gst_element_register(plugin == null ? IntPtr.Zero : plugin.Handle, native_name, rank, type.Val);
1408                         bool ret = raw_ret;
1409                         GLib.Marshaller.Free (native_name);
1410                         return ret;
1411                 }
1412
1413                 public static bool Register(string name, uint rank, GLib.GType type) {
1414                         return Register (null, name, rank, type);
1415                 }
1416
1417                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1418                 static extern IntPtr gst_element_state_change_return_get_name(int state_ret);
1419
1420                 public static string StateChangeReturnGetName(Gst.StateChangeReturn state_ret) {
1421                         IntPtr raw_ret = gst_element_state_change_return_get_name((int) state_ret);
1422                         string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
1423                         return ret;
1424                 }
1425
1426                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1427                 static extern IntPtr gst_element_state_get_name(int state);
1428
1429                 public static string StateGetName(Gst.State state) {
1430                         IntPtr raw_ret = gst_element_state_get_name((int) state);
1431                         string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
1432                         return ret;
1433                 }
1434
1435                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1436                 static extern void gst_element_abort_state(IntPtr raw);
1437
1438                 public void AbortState() {
1439                         gst_element_abort_state(Handle);
1440                 }
1441
1442                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1443                 static extern bool gst_element_add_pad(IntPtr raw, IntPtr pad);
1444
1445                 public bool AddPad(Gst.Pad pad) {
1446                         bool raw_ret = gst_element_add_pad(Handle, pad == null ? IntPtr.Zero : pad.Handle);
1447                         bool ret = raw_ret;
1448                         return ret;
1449                 }
1450
1451                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1452                 static extern UIntPtr gst_element_add_property_deep_notify_watch(IntPtr raw, IntPtr property_name, bool include_value);
1453
1454                 public ulong AddPropertyDeepNotifyWatch(string property_name, bool include_value) {
1455                         IntPtr native_property_name = GLib.Marshaller.StringToPtrGStrdup (property_name);
1456                         UIntPtr raw_ret = gst_element_add_property_deep_notify_watch(Handle, native_property_name, include_value);
1457                         ulong ret = (ulong) raw_ret;
1458                         GLib.Marshaller.Free (native_property_name);
1459                         return ret;
1460                 }
1461
1462                 public ulong AddPropertyDeepNotifyWatch(bool include_value) {
1463                         return AddPropertyDeepNotifyWatch (null, include_value);
1464                 }
1465
1466                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1467                 static extern UIntPtr gst_element_add_property_notify_watch(IntPtr raw, IntPtr property_name, bool include_value);
1468
1469                 public ulong AddPropertyNotifyWatch(string property_name, bool include_value) {
1470                         IntPtr native_property_name = GLib.Marshaller.StringToPtrGStrdup (property_name);
1471                         UIntPtr raw_ret = gst_element_add_property_notify_watch(Handle, native_property_name, include_value);
1472                         ulong ret = (ulong) raw_ret;
1473                         GLib.Marshaller.Free (native_property_name);
1474                         return ret;
1475                 }
1476
1477                 public ulong AddPropertyNotifyWatch(bool include_value) {
1478                         return AddPropertyNotifyWatch (null, include_value);
1479                 }
1480
1481                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1482                 static extern void gst_element_call_async(IntPtr raw, GstSharp.ElementCallAsyncFuncNative func, IntPtr user_data, GLib.DestroyNotify destroy_notify);
1483
1484                 public void CallAsync(Gst.ElementCallAsyncFunc func) {
1485                         GstSharp.ElementCallAsyncFuncWrapper func_wrapper = new GstSharp.ElementCallAsyncFuncWrapper (func);
1486                         IntPtr user_data;
1487                         GLib.DestroyNotify destroy_notify;
1488                         if (func == null) {
1489                                 user_data = IntPtr.Zero;
1490                                 destroy_notify = null;
1491                         } else {
1492                                 user_data = (IntPtr) GCHandle.Alloc (func_wrapper);
1493                                 destroy_notify = GLib.DestroyHelper.NotifyHandler;
1494                         }
1495                         gst_element_call_async(Handle, func_wrapper.NativeDelegate, user_data, destroy_notify);
1496                 }
1497
1498                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1499                 static extern int gst_element_change_state(IntPtr raw, int transition);
1500
1501                 public Gst.StateChangeReturn ChangeState(Gst.StateChange transition) {
1502                         int raw_ret = gst_element_change_state(Handle, (int) transition);
1503                         Gst.StateChangeReturn ret = (Gst.StateChangeReturn) raw_ret;
1504                         return ret;
1505                 }
1506
1507                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1508                 static extern int gst_element_continue_state(IntPtr raw, int _ret);
1509
1510                 public Gst.StateChangeReturn ContinueState(Gst.StateChangeReturn _ret) {
1511                         int raw_ret = gst_element_continue_state(Handle, (int) _ret);
1512                         Gst.StateChangeReturn ret = (Gst.StateChangeReturn) raw_ret;
1513                         return ret;
1514                 }
1515
1516                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1517                 static extern void gst_element_create_all_pads(IntPtr raw);
1518
1519                 public void CreateAllPads() {
1520                         gst_element_create_all_pads(Handle);
1521                 }
1522
1523                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1524                 static extern bool gst_element_foreach_pad(IntPtr raw, GstSharp.ElementForeachPadFuncNative func, IntPtr user_data);
1525
1526                 public bool ForeachPad(Gst.ElementForeachPadFunc func) {
1527                         GstSharp.ElementForeachPadFuncWrapper func_wrapper = new GstSharp.ElementForeachPadFuncWrapper (func);
1528                         bool raw_ret = gst_element_foreach_pad(Handle, func_wrapper.NativeDelegate, IntPtr.Zero);
1529                         bool ret = raw_ret;
1530                         return ret;
1531                 }
1532
1533                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1534                 static extern bool gst_element_foreach_sink_pad(IntPtr raw, GstSharp.ElementForeachPadFuncNative func, IntPtr user_data);
1535
1536                 public bool ForeachSinkPad(Gst.ElementForeachPadFunc func) {
1537                         GstSharp.ElementForeachPadFuncWrapper func_wrapper = new GstSharp.ElementForeachPadFuncWrapper (func);
1538                         bool raw_ret = gst_element_foreach_sink_pad(Handle, func_wrapper.NativeDelegate, IntPtr.Zero);
1539                         bool ret = raw_ret;
1540                         return ret;
1541                 }
1542
1543                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1544                 static extern bool gst_element_foreach_src_pad(IntPtr raw, GstSharp.ElementForeachPadFuncNative func, IntPtr user_data);
1545
1546                 public bool ForeachSrcPad(Gst.ElementForeachPadFunc func) {
1547                         GstSharp.ElementForeachPadFuncWrapper func_wrapper = new GstSharp.ElementForeachPadFuncWrapper (func);
1548                         bool raw_ret = gst_element_foreach_src_pad(Handle, func_wrapper.NativeDelegate, IntPtr.Zero);
1549                         bool ret = raw_ret;
1550                         return ret;
1551                 }
1552
1553                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1554                 static extern IntPtr gst_element_get_compatible_pad(IntPtr raw, IntPtr pad, IntPtr caps);
1555
1556                 public Gst.Pad GetCompatiblePad(Gst.Pad pad, Gst.Caps caps) {
1557                         IntPtr raw_ret = gst_element_get_compatible_pad(Handle, pad == null ? IntPtr.Zero : pad.Handle, caps == null ? IntPtr.Zero : caps.Handle);
1558                         Gst.Pad ret = GLib.Object.GetObject(raw_ret, true) as Gst.Pad;
1559                         return ret;
1560                 }
1561
1562                 public Gst.Pad GetCompatiblePad(Gst.Pad pad) {
1563                         return GetCompatiblePad (pad, null);
1564                 }
1565
1566                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1567                 static extern IntPtr gst_element_get_compatible_pad_template(IntPtr raw, IntPtr compattempl);
1568
1569                 public Gst.PadTemplate GetCompatiblePadTemplate(Gst.PadTemplate compattempl) {
1570                         IntPtr raw_ret = gst_element_get_compatible_pad_template(Handle, compattempl == null ? IntPtr.Zero : compattempl.Handle);
1571                         Gst.PadTemplate ret = GLib.Object.GetObject(raw_ret) as Gst.PadTemplate;
1572                         return ret;
1573                 }
1574
1575                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1576                 static extern IntPtr gst_element_get_context(IntPtr raw, IntPtr context_type);
1577
1578                 public Gst.Context GetContext(string context_type) {
1579                         IntPtr native_context_type = GLib.Marshaller.StringToPtrGStrdup (context_type);
1580                         IntPtr raw_ret = gst_element_get_context(Handle, native_context_type);
1581                         Gst.Context ret = Gst.Context.New (raw_ret);
1582                         GLib.Marshaller.Free (native_context_type);
1583                         return ret;
1584                 }
1585
1586                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1587                 static extern IntPtr gst_element_get_context_unlocked(IntPtr raw, IntPtr context_type);
1588
1589                 public Gst.Context GetContextUnlocked(string context_type) {
1590                         IntPtr native_context_type = GLib.Marshaller.StringToPtrGStrdup (context_type);
1591                         IntPtr raw_ret = gst_element_get_context_unlocked(Handle, native_context_type);
1592                         Gst.Context ret = Gst.Context.New (raw_ret);
1593                         GLib.Marshaller.Free (native_context_type);
1594                         return ret;
1595                 }
1596
1597                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1598                 static extern ulong gst_element_get_current_clock_time(IntPtr raw);
1599
1600                 public ulong CurrentClockTime { 
1601                         get {
1602                                 ulong raw_ret = gst_element_get_current_clock_time(Handle);
1603                                 ulong ret = raw_ret;
1604                                 return ret;
1605                         }
1606                 }
1607
1608                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1609                 static extern ulong gst_element_get_current_running_time(IntPtr raw);
1610
1611                 public ulong CurrentRunningTime { 
1612                         get {
1613                                 ulong raw_ret = gst_element_get_current_running_time(Handle);
1614                                 ulong ret = raw_ret;
1615                                 return ret;
1616                         }
1617                 }
1618
1619                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1620                 static extern IntPtr gst_element_get_factory(IntPtr raw);
1621
1622                 public Gst.ElementFactory Factory { 
1623                         get {
1624                                 IntPtr raw_ret = gst_element_get_factory(Handle);
1625                                 Gst.ElementFactory ret = GLib.Object.GetObject(raw_ret) as Gst.ElementFactory;
1626                                 return ret;
1627                         }
1628                 }
1629
1630                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1631                 static extern IntPtr gst_element_get_metadata(IntPtr raw, IntPtr key);
1632
1633                 public string GetMetadata(string key) {
1634                         IntPtr native_key = GLib.Marshaller.StringToPtrGStrdup (key);
1635                         IntPtr raw_ret = gst_element_get_metadata(Handle, native_key);
1636                         string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
1637                         GLib.Marshaller.Free (native_key);
1638                         return ret;
1639                 }
1640
1641                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1642                 static extern IntPtr gst_element_get_pad_template(IntPtr raw, IntPtr name);
1643
1644                 public Gst.PadTemplate GetPadTemplate(string name) {
1645                         IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
1646                         IntPtr raw_ret = gst_element_get_pad_template(Handle, native_name);
1647                         Gst.PadTemplate ret = GLib.Object.GetObject(raw_ret) as Gst.PadTemplate;
1648                         GLib.Marshaller.Free (native_name);
1649                         return ret;
1650                 }
1651
1652                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1653                 static extern IntPtr gst_element_get_pad_template_list(IntPtr raw);
1654
1655                 public Gst.PadTemplate[] PadTemplateList { 
1656                         get {
1657                                 IntPtr raw_ret = gst_element_get_pad_template_list(Handle);
1658                                 Gst.PadTemplate[] ret = (Gst.PadTemplate[]) GLib.Marshaller.ListPtrToArray (raw_ret, typeof(GLib.List), false, false, typeof(Gst.PadTemplate));
1659                                 return ret;
1660                         }
1661                 }
1662
1663                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1664                 static extern IntPtr gst_element_get_request_pad(IntPtr raw, IntPtr name);
1665
1666                 public Gst.Pad GetRequestPad(string name) {
1667                         IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
1668                         IntPtr raw_ret = gst_element_get_request_pad(Handle, native_name);
1669                         Gst.Pad ret = GLib.Object.GetObject(raw_ret, true) as Gst.Pad;
1670                         GLib.Marshaller.Free (native_name);
1671                         return ret;
1672                 }
1673
1674                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1675                 static extern int gst_element_get_state(IntPtr raw, out int state, out int pending, ulong timeout);
1676
1677                 public Gst.StateChangeReturn GetState(out Gst.State state, out Gst.State pending, ulong timeout) {
1678                         int native_state;
1679                         int native_pending;
1680                         int raw_ret = gst_element_get_state(Handle, out native_state, out native_pending, timeout);
1681                         Gst.StateChangeReturn ret = (Gst.StateChangeReturn) raw_ret;
1682                         state = (Gst.State) native_state;
1683                         pending = (Gst.State) native_pending;
1684                         return ret;
1685                 }
1686
1687                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1688                 static extern IntPtr gst_element_get_static_pad(IntPtr raw, IntPtr name);
1689
1690                 public Gst.Pad GetStaticPad(string name) {
1691                         IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
1692                         IntPtr raw_ret = gst_element_get_static_pad(Handle, native_name);
1693                         Gst.Pad ret = GLib.Object.GetObject(raw_ret, true) as Gst.Pad;
1694                         GLib.Marshaller.Free (native_name);
1695                         return ret;
1696                 }
1697
1698                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1699                 static extern bool gst_element_is_locked_state(IntPtr raw);
1700
1701                 public bool IsLockedState { 
1702                         get {
1703                                 bool raw_ret = gst_element_is_locked_state(Handle);
1704                                 bool ret = raw_ret;
1705                                 return ret;
1706                         }
1707                 }
1708
1709                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1710                 static extern IntPtr gst_element_iterate_pads(IntPtr raw);
1711
1712                 public Gst.Iterator IteratePads() {
1713                         IntPtr raw_ret = gst_element_iterate_pads(Handle);
1714                         Gst.Iterator ret = raw_ret == IntPtr.Zero ? null : (Gst.Iterator) GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.Iterator), true);
1715                         return ret;
1716                 }
1717
1718                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1719                 static extern IntPtr gst_element_iterate_sink_pads(IntPtr raw);
1720
1721                 public Gst.Iterator IterateSinkPads() {
1722                         IntPtr raw_ret = gst_element_iterate_sink_pads(Handle);
1723                         Gst.Iterator ret = raw_ret == IntPtr.Zero ? null : (Gst.Iterator) GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.Iterator), true);
1724                         return ret;
1725                 }
1726
1727                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1728                 static extern IntPtr gst_element_iterate_src_pads(IntPtr raw);
1729
1730                 public Gst.Iterator IterateSrcPads() {
1731                         IntPtr raw_ret = gst_element_iterate_src_pads(Handle);
1732                         Gst.Iterator ret = raw_ret == IntPtr.Zero ? null : (Gst.Iterator) GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.Iterator), true);
1733                         return ret;
1734                 }
1735
1736                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1737                 static extern bool gst_element_link(IntPtr raw, IntPtr dest);
1738
1739                 public bool Link(Gst.Element dest) {
1740                         bool raw_ret = gst_element_link(Handle, dest == null ? IntPtr.Zero : dest.Handle);
1741                         bool ret = raw_ret;
1742                         return ret;
1743                 }
1744
1745                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1746                 static extern bool gst_element_link_filtered(IntPtr raw, IntPtr dest, IntPtr filter);
1747
1748                 public bool LinkFiltered(Gst.Element dest, Gst.Caps filter) {
1749                         bool raw_ret = gst_element_link_filtered(Handle, dest == null ? IntPtr.Zero : dest.Handle, filter == null ? IntPtr.Zero : filter.Handle);
1750                         bool ret = raw_ret;
1751                         return ret;
1752                 }
1753
1754                 public bool LinkFiltered(Gst.Element dest) {
1755                         return LinkFiltered (dest, null);
1756                 }
1757
1758                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1759                 static extern bool gst_element_link_pads(IntPtr raw, IntPtr srcpadname, IntPtr dest, IntPtr destpadname);
1760
1761                 public bool LinkPads(string srcpadname, Gst.Element dest, string destpadname) {
1762                         IntPtr native_srcpadname = GLib.Marshaller.StringToPtrGStrdup (srcpadname);
1763                         IntPtr native_destpadname = GLib.Marshaller.StringToPtrGStrdup (destpadname);
1764                         bool raw_ret = gst_element_link_pads(Handle, native_srcpadname, dest == null ? IntPtr.Zero : dest.Handle, native_destpadname);
1765                         bool ret = raw_ret;
1766                         GLib.Marshaller.Free (native_srcpadname);
1767                         GLib.Marshaller.Free (native_destpadname);
1768                         return ret;
1769                 }
1770
1771                 public bool LinkPads(Gst.Element dest) {
1772                         return LinkPads (null, dest, null);
1773                 }
1774
1775                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1776                 static extern bool gst_element_link_pads_filtered(IntPtr raw, IntPtr srcpadname, IntPtr dest, IntPtr destpadname, IntPtr filter);
1777
1778                 public bool LinkPadsFiltered(string srcpadname, Gst.Element dest, string destpadname, Gst.Caps filter) {
1779                         IntPtr native_srcpadname = GLib.Marshaller.StringToPtrGStrdup (srcpadname);
1780                         IntPtr native_destpadname = GLib.Marshaller.StringToPtrGStrdup (destpadname);
1781                         bool raw_ret = gst_element_link_pads_filtered(Handle, native_srcpadname, dest == null ? IntPtr.Zero : dest.Handle, native_destpadname, filter == null ? IntPtr.Zero : filter.Handle);
1782                         bool ret = raw_ret;
1783                         GLib.Marshaller.Free (native_srcpadname);
1784                         GLib.Marshaller.Free (native_destpadname);
1785                         return ret;
1786                 }
1787
1788                 public bool LinkPadsFiltered(Gst.Element dest) {
1789                         return LinkPadsFiltered (null, dest, null, null);
1790                 }
1791
1792                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1793                 static extern bool gst_element_link_pads_full(IntPtr raw, IntPtr srcpadname, IntPtr dest, IntPtr destpadname, int flags);
1794
1795                 public bool LinkPadsFull(string srcpadname, Gst.Element dest, string destpadname, Gst.PadLinkCheck flags) {
1796                         IntPtr native_srcpadname = GLib.Marshaller.StringToPtrGStrdup (srcpadname);
1797                         IntPtr native_destpadname = GLib.Marshaller.StringToPtrGStrdup (destpadname);
1798                         bool raw_ret = gst_element_link_pads_full(Handle, native_srcpadname, dest == null ? IntPtr.Zero : dest.Handle, native_destpadname, (int) flags);
1799                         bool ret = raw_ret;
1800                         GLib.Marshaller.Free (native_srcpadname);
1801                         GLib.Marshaller.Free (native_destpadname);
1802                         return ret;
1803                 }
1804
1805                 public bool LinkPadsFull(Gst.Element dest, Gst.PadLinkCheck flags) {
1806                         return LinkPadsFull (null, dest, null, flags);
1807                 }
1808
1809                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1810                 static extern void gst_element_lost_state(IntPtr raw);
1811
1812                 public void LostState() {
1813                         gst_element_lost_state(Handle);
1814                 }
1815
1816                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1817                 static extern void gst_element_message_full(IntPtr raw, int type, uint domain, int code, IntPtr text, IntPtr debug, IntPtr file, IntPtr function, int line);
1818
1819                 public void MessageFull(Gst.MessageType type, uint domain, int code, string text, string debug, string file, string function, int line) {
1820                         IntPtr native_file = GLib.Marshaller.StringToPtrGStrdup (file);
1821                         IntPtr native_function = GLib.Marshaller.StringToPtrGStrdup (function);
1822                         gst_element_message_full(Handle, (int) type, domain, code, GLib.Marshaller.StringToPtrGStrdup(text), GLib.Marshaller.StringToPtrGStrdup(debug), native_file, native_function, line);
1823                         GLib.Marshaller.Free (native_file);
1824                         GLib.Marshaller.Free (native_function);
1825                 }
1826
1827                 public void MessageFull(Gst.MessageType type, uint domain, int code, string file, string function, int line) {
1828                         MessageFull (type, domain, code, null, null, file, function, line);
1829                 }
1830
1831                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1832                 static extern void gst_element_message_full_with_details(IntPtr raw, int type, uint domain, int code, IntPtr text, IntPtr debug, IntPtr file, IntPtr function, int line, IntPtr structure);
1833
1834                 public void MessageFullWithDetails(Gst.MessageType type, uint domain, int code, string text, string debug, string file, string function, int line, Gst.Structure structure) {
1835                         IntPtr native_file = GLib.Marshaller.StringToPtrGStrdup (file);
1836                         IntPtr native_function = GLib.Marshaller.StringToPtrGStrdup (function);
1837                         structure.Owned = false;
1838                         gst_element_message_full_with_details(Handle, (int) type, domain, code, GLib.Marshaller.StringToPtrGStrdup(text), GLib.Marshaller.StringToPtrGStrdup(debug), native_file, native_function, line, structure == null ? IntPtr.Zero : structure.Handle);
1839                         GLib.Marshaller.Free (native_file);
1840                         GLib.Marshaller.Free (native_function);
1841                 }
1842
1843                 public void MessageFullWithDetails(Gst.MessageType type, uint domain, int code, string file, string function, int line, Gst.Structure structure) {
1844                         MessageFullWithDetails (type, domain, code, null, null, file, function, line, structure);
1845                 }
1846
1847                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1848                 static extern void gst_element_no_more_pads(IntPtr raw);
1849
1850                 public void NoMorePads() {
1851                         gst_element_no_more_pads(Handle);
1852                 }
1853
1854                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1855                 static extern bool gst_element_post_message(IntPtr raw, IntPtr message);
1856
1857                 public bool PostMessage(Gst.Message message) {
1858                         message.Owned = false;
1859                         bool raw_ret = gst_element_post_message(Handle, message == null ? IntPtr.Zero : message.Handle);
1860                         bool ret = raw_ret;
1861                         return ret;
1862                 }
1863
1864                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1865                 static extern IntPtr gst_element_provide_clock(IntPtr raw);
1866
1867                 public Gst.Clock ProvideClock() {
1868                         IntPtr raw_ret = gst_element_provide_clock(Handle);
1869                         Gst.Clock ret = GLib.Object.GetObject(raw_ret, true) as Gst.Clock;
1870                         return ret;
1871                 }
1872
1873                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1874                 static extern bool gst_element_query(IntPtr raw, IntPtr query);
1875
1876                 public bool Query(Gst.Query query) {
1877                         bool raw_ret = gst_element_query(Handle, query == null ? IntPtr.Zero : query.Handle);
1878                         bool ret = raw_ret;
1879                         return ret;
1880                 }
1881
1882                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1883                 static extern bool gst_element_query_convert(IntPtr raw, int src_format, long src_val, int dest_format, out long dest_val);
1884
1885                 public bool QueryConvert(Gst.Format src_format, long src_val, Gst.Format dest_format, out long dest_val) {
1886                         bool raw_ret = gst_element_query_convert(Handle, (int) src_format, src_val, (int) dest_format, out dest_val);
1887                         bool ret = raw_ret;
1888                         return ret;
1889                 }
1890
1891                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1892                 static extern bool gst_element_query_duration(IntPtr raw, int format, out long duration);
1893
1894                 public bool QueryDuration(Gst.Format format, out long duration) {
1895                         bool raw_ret = gst_element_query_duration(Handle, (int) format, out duration);
1896                         bool ret = raw_ret;
1897                         return ret;
1898                 }
1899
1900                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1901                 static extern bool gst_element_query_position(IntPtr raw, int format, out long cur);
1902
1903                 public bool QueryPosition(Gst.Format format, out long cur) {
1904                         bool raw_ret = gst_element_query_position(Handle, (int) format, out cur);
1905                         bool ret = raw_ret;
1906                         return ret;
1907                 }
1908
1909                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1910                 static extern void gst_element_release_request_pad(IntPtr raw, IntPtr pad);
1911
1912                 public void ReleaseRequestPad(Gst.Pad pad) {
1913                         gst_element_release_request_pad(Handle, pad == null ? IntPtr.Zero : pad.Handle);
1914                 }
1915
1916                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1917                 static extern bool gst_element_remove_pad(IntPtr raw, IntPtr pad);
1918
1919                 public bool RemovePad(Gst.Pad pad) {
1920                         bool raw_ret = gst_element_remove_pad(Handle, pad == null ? IntPtr.Zero : pad.Handle);
1921                         bool ret = raw_ret;
1922                         return ret;
1923                 }
1924
1925                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1926                 static extern void gst_element_remove_property_notify_watch(IntPtr raw, UIntPtr watch_id);
1927
1928                 public void RemovePropertyNotifyWatch(ulong watch_id) {
1929                         gst_element_remove_property_notify_watch(Handle, new UIntPtr (watch_id));
1930                 }
1931
1932                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1933                 static extern IntPtr gst_element_request_pad(IntPtr raw, IntPtr templ, IntPtr name, IntPtr caps);
1934
1935                 public Gst.Pad RequestPad(Gst.PadTemplate templ, string name, Gst.Caps caps) {
1936                         IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
1937                         IntPtr raw_ret = gst_element_request_pad(Handle, templ == null ? IntPtr.Zero : templ.Handle, native_name, caps == null ? IntPtr.Zero : caps.Handle);
1938                         Gst.Pad ret = GLib.Object.GetObject(raw_ret, true) as Gst.Pad;
1939                         GLib.Marshaller.Free (native_name);
1940                         return ret;
1941                 }
1942
1943                 public Gst.Pad RequestPad(Gst.PadTemplate templ) {
1944                         return RequestPad (templ, null, null);
1945                 }
1946
1947                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1948                 static extern bool gst_element_seek(IntPtr raw, double rate, int format, int flags, int start_type, long start, int stop_type, long stop);
1949
1950                 public bool Seek(double rate, Gst.Format format, Gst.SeekFlags flags, Gst.SeekType start_type, long start, Gst.SeekType stop_type, long stop) {
1951                         bool raw_ret = gst_element_seek(Handle, rate, (int) format, (int) flags, (int) start_type, start, (int) stop_type, stop);
1952                         bool ret = raw_ret;
1953                         return ret;
1954                 }
1955
1956                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1957                 static extern bool gst_element_seek_simple(IntPtr raw, int format, int seek_flags, long seek_pos);
1958
1959                 public bool SeekSimple(Gst.Format format, Gst.SeekFlags seek_flags, long seek_pos) {
1960                         bool raw_ret = gst_element_seek_simple(Handle, (int) format, (int) seek_flags, seek_pos);
1961                         bool ret = raw_ret;
1962                         return ret;
1963                 }
1964
1965                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1966                 static extern bool gst_element_send_event(IntPtr raw, IntPtr evnt);
1967
1968                 public bool SendEvent(Gst.Event evnt) {
1969                         evnt.Owned = false;
1970                         bool raw_ret = gst_element_send_event(Handle, evnt == null ? IntPtr.Zero : evnt.Handle);
1971                         bool ret = raw_ret;
1972                         return ret;
1973                 }
1974
1975                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1976                 static extern bool gst_element_set_clock(IntPtr raw, IntPtr clock);
1977
1978                 public bool SetClock(Gst.Clock clock) {
1979                         bool raw_ret = gst_element_set_clock(Handle, clock == null ? IntPtr.Zero : clock.Handle);
1980                         bool ret = raw_ret;
1981                         return ret;
1982                 }
1983
1984                 public bool SetClock() {
1985                         return SetClock (null);
1986                 }
1987
1988                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1989                 static extern bool gst_element_set_locked_state(IntPtr raw, bool locked_state);
1990
1991                 public bool SetLockedState(bool locked_state) {
1992                         bool raw_ret = gst_element_set_locked_state(Handle, locked_state);
1993                         bool ret = raw_ret;
1994                         return ret;
1995                 }
1996
1997                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1998                 static extern int gst_element_set_state(IntPtr raw, int state);
1999
2000                 public Gst.StateChangeReturn SetState(Gst.State state) {
2001                         int raw_ret = gst_element_set_state(Handle, (int) state);
2002                         Gst.StateChangeReturn ret = (Gst.StateChangeReturn) raw_ret;
2003                         return ret;
2004                 }
2005
2006                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
2007                 static extern bool gst_element_sync_state_with_parent(IntPtr raw);
2008
2009                 public bool SyncStateWithParent() {
2010                         bool raw_ret = gst_element_sync_state_with_parent(Handle);
2011                         bool ret = raw_ret;
2012                         return ret;
2013                 }
2014
2015                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
2016                 static extern void gst_element_unlink(IntPtr raw, IntPtr dest);
2017
2018                 public void Unlink(Gst.Element dest) {
2019                         gst_element_unlink(Handle, dest == null ? IntPtr.Zero : dest.Handle);
2020                 }
2021
2022                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
2023                 static extern void gst_element_unlink_pads(IntPtr raw, IntPtr srcpadname, IntPtr dest, IntPtr destpadname);
2024
2025                 public void UnlinkPads(string srcpadname, Gst.Element dest, string destpadname) {
2026                         IntPtr native_srcpadname = GLib.Marshaller.StringToPtrGStrdup (srcpadname);
2027                         IntPtr native_destpadname = GLib.Marshaller.StringToPtrGStrdup (destpadname);
2028                         gst_element_unlink_pads(Handle, native_srcpadname, dest == null ? IntPtr.Zero : dest.Handle, native_destpadname);
2029                         GLib.Marshaller.Free (native_srcpadname);
2030                         GLib.Marshaller.Free (native_destpadname);
2031                 }
2032
2033
2034                 // Internal representation of the wrapped structure ABI.
2035                 static GLib.AbiStruct _abi_info = null;
2036                 static public new GLib.AbiStruct abi_info {
2037                         get {
2038                                 if (_abi_info == null)
2039                                         _abi_info = new GLib.AbiStruct (new List<GLib.AbiField>{ 
2040                                                 new GLib.AbiField("state_lock"
2041                                                         , Gst.Object.abi_info.Fields
2042                                                         , (uint) Marshal.SizeOf(typeof(GLib.RecMutex.ABI)) // state_lock
2043                                                         , null
2044                                                         , "state_cond"
2045                                                         , (long) Marshal.OffsetOf(typeof(GstElement_state_lockAlign), "state_lock")
2046                                                         , 0
2047                                                         ),
2048                                                 new GLib.AbiField("state_cond"
2049                                                         , -1
2050                                                         , (uint) Marshal.SizeOf(typeof(GLib.Cond.ABI)) // state_cond
2051                                                         , "state_lock"
2052                                                         , "state_cookie"
2053                                                         , (long) Marshal.OffsetOf(typeof(GstElement_state_condAlign), "state_cond")
2054                                                         , 0
2055                                                         ),
2056                                                 new GLib.AbiField("state_cookie"
2057                                                         , -1
2058                                                         , (uint) Marshal.SizeOf(typeof(uint)) // state_cookie
2059                                                         , "state_cond"
2060                                                         , "target_state"
2061                                                         , (long) Marshal.OffsetOf(typeof(GstElement_state_cookieAlign), "state_cookie")
2062                                                         , 0
2063                                                         ),
2064                                                 new GLib.AbiField("target_state"
2065                                                         , -1
2066                                                         , (uint) Marshal.SizeOf(System.Enum.GetUnderlyingType(typeof(Gst.State))) // target_state
2067                                                         , "state_cookie"
2068                                                         , "current_state"
2069                                                         , (long) Marshal.OffsetOf(typeof(GstElement_target_stateAlign), "target_state")
2070                                                         , 0
2071                                                         ),
2072                                                 new GLib.AbiField("current_state"
2073                                                         , -1
2074                                                         , (uint) Marshal.SizeOf(System.Enum.GetUnderlyingType(typeof(Gst.State))) // current_state
2075                                                         , "target_state"
2076                                                         , "next_state"
2077                                                         , (long) Marshal.OffsetOf(typeof(GstElement_current_stateAlign), "current_state")
2078                                                         , 0
2079                                                         ),
2080                                                 new GLib.AbiField("next_state"
2081                                                         , -1
2082                                                         , (uint) Marshal.SizeOf(System.Enum.GetUnderlyingType(typeof(Gst.State))) // next_state
2083                                                         , "current_state"
2084                                                         , "pending_state"
2085                                                         , (long) Marshal.OffsetOf(typeof(GstElement_next_stateAlign), "next_state")
2086                                                         , 0
2087                                                         ),
2088                                                 new GLib.AbiField("pending_state"
2089                                                         , -1
2090                                                         , (uint) Marshal.SizeOf(System.Enum.GetUnderlyingType(typeof(Gst.State))) // pending_state
2091                                                         , "next_state"
2092                                                         , "last_return"
2093                                                         , (long) Marshal.OffsetOf(typeof(GstElement_pending_stateAlign), "pending_state")
2094                                                         , 0
2095                                                         ),
2096                                                 new GLib.AbiField("last_return"
2097                                                         , -1
2098                                                         , (uint) Marshal.SizeOf(System.Enum.GetUnderlyingType(typeof(Gst.StateChangeReturn))) // last_return
2099                                                         , "pending_state"
2100                                                         , "bus"
2101                                                         , (long) Marshal.OffsetOf(typeof(GstElement_last_returnAlign), "last_return")
2102                                                         , 0
2103                                                         ),
2104                                                 new GLib.AbiField("bus"
2105                                                         , -1
2106                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // bus
2107                                                         , "last_return"
2108                                                         , "clock"
2109                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
2110                                                         , 0
2111                                                         ),
2112                                                 new GLib.AbiField("clock"
2113                                                         , -1
2114                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // clock
2115                                                         , "bus"
2116                                                         , "base_time"
2117                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
2118                                                         , 0
2119                                                         ),
2120                                                 new GLib.AbiField("base_time"
2121                                                         , -1
2122                                                         , (uint) Marshal.SizeOf(typeof(long)) // base_time
2123                                                         , "clock"
2124                                                         , "start_time"
2125                                                         , (long) Marshal.OffsetOf(typeof(GstElement_base_timeAlign), "base_time")
2126                                                         , 0
2127                                                         ),
2128                                                 new GLib.AbiField("start_time"
2129                                                         , -1
2130                                                         , (uint) Marshal.SizeOf(typeof(ulong)) // start_time
2131                                                         , "base_time"
2132                                                         , "numpads"
2133                                                         , (long) Marshal.OffsetOf(typeof(GstElement_start_timeAlign), "start_time")
2134                                                         , 0
2135                                                         ),
2136                                                 new GLib.AbiField("numpads"
2137                                                         , -1
2138                                                         , (uint) Marshal.SizeOf(typeof(ushort)) // numpads
2139                                                         , "start_time"
2140                                                         , "pads"
2141                                                         , (long) Marshal.OffsetOf(typeof(GstElement_numpadsAlign), "numpads")
2142                                                         , 0
2143                                                         ),
2144                                                 new GLib.AbiField("pads"
2145                                                         , -1
2146                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // pads
2147                                                         , "numpads"
2148                                                         , "numsrcpads"
2149                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
2150                                                         , 0
2151                                                         ),
2152                                                 new GLib.AbiField("numsrcpads"
2153                                                         , -1
2154                                                         , (uint) Marshal.SizeOf(typeof(ushort)) // numsrcpads
2155                                                         , "pads"
2156                                                         , "srcpads"
2157                                                         , (long) Marshal.OffsetOf(typeof(GstElement_numsrcpadsAlign), "numsrcpads")
2158                                                         , 0
2159                                                         ),
2160                                                 new GLib.AbiField("srcpads"
2161                                                         , -1
2162                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // srcpads
2163                                                         , "numsrcpads"
2164                                                         , "numsinkpads"
2165                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
2166                                                         , 0
2167                                                         ),
2168                                                 new GLib.AbiField("numsinkpads"
2169                                                         , -1
2170                                                         , (uint) Marshal.SizeOf(typeof(ushort)) // numsinkpads
2171                                                         , "srcpads"
2172                                                         , "sinkpads"
2173                                                         , (long) Marshal.OffsetOf(typeof(GstElement_numsinkpadsAlign), "numsinkpads")
2174                                                         , 0
2175                                                         ),
2176                                                 new GLib.AbiField("sinkpads"
2177                                                         , -1
2178                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // sinkpads
2179                                                         , "numsinkpads"
2180                                                         , "pads_cookie"
2181                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
2182                                                         , 0
2183                                                         ),
2184                                                 new GLib.AbiField("pads_cookie"
2185                                                         , -1
2186                                                         , (uint) Marshal.SizeOf(typeof(uint)) // pads_cookie
2187                                                         , "sinkpads"
2188                                                         , "contexts"
2189                                                         , (long) Marshal.OffsetOf(typeof(GstElement_pads_cookieAlign), "pads_cookie")
2190                                                         , 0
2191                                                         ),
2192                                                 new GLib.AbiField("contexts"
2193                                                         , -1
2194                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // contexts
2195                                                         , "pads_cookie"
2196                                                         , "_gst_reserved"
2197                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
2198                                                         , 0
2199                                                         ),
2200                                                 new GLib.AbiField("_gst_reserved"
2201                                                         , -1
2202                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) * 3 // _gst_reserved
2203                                                         , "contexts"
2204                                                         , null
2205                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
2206                                                         , 0
2207                                                         ),
2208                                         });
2209
2210                                 return _abi_info;
2211                         }
2212                 }
2213
2214                 [StructLayout(LayoutKind.Sequential)]
2215                 public struct GstElement_state_lockAlign
2216                 {
2217                         sbyte f1;
2218                         private GLib.RecMutex.ABI state_lock;
2219                 }
2220
2221                 [StructLayout(LayoutKind.Sequential)]
2222                 public struct GstElement_state_condAlign
2223                 {
2224                         sbyte f1;
2225                         private GLib.Cond.ABI state_cond;
2226                 }
2227
2228                 [StructLayout(LayoutKind.Sequential)]
2229                 public struct GstElement_state_cookieAlign
2230                 {
2231                         sbyte f1;
2232                         private uint state_cookie;
2233                 }
2234
2235                 [StructLayout(LayoutKind.Sequential)]
2236                 public struct GstElement_target_stateAlign
2237                 {
2238                         sbyte f1;
2239                         private Gst.State target_state;
2240                 }
2241
2242                 [StructLayout(LayoutKind.Sequential)]
2243                 public struct GstElement_current_stateAlign
2244                 {
2245                         sbyte f1;
2246                         private Gst.State current_state;
2247                 }
2248
2249                 [StructLayout(LayoutKind.Sequential)]
2250                 public struct GstElement_next_stateAlign
2251                 {
2252                         sbyte f1;
2253                         private Gst.State next_state;
2254                 }
2255
2256                 [StructLayout(LayoutKind.Sequential)]
2257                 public struct GstElement_pending_stateAlign
2258                 {
2259                         sbyte f1;
2260                         private Gst.State pending_state;
2261                 }
2262
2263                 [StructLayout(LayoutKind.Sequential)]
2264                 public struct GstElement_last_returnAlign
2265                 {
2266                         sbyte f1;
2267                         private Gst.StateChangeReturn last_return;
2268                 }
2269
2270                 [StructLayout(LayoutKind.Sequential)]
2271                 public struct GstElement_base_timeAlign
2272                 {
2273                         sbyte f1;
2274                         private ulong base_time;
2275                 }
2276
2277                 [StructLayout(LayoutKind.Sequential)]
2278                 public struct GstElement_start_timeAlign
2279                 {
2280                         sbyte f1;
2281                         private ulong start_time;
2282                 }
2283
2284                 [StructLayout(LayoutKind.Sequential)]
2285                 public struct GstElement_numpadsAlign
2286                 {
2287                         sbyte f1;
2288                         private ushort numpads;
2289                 }
2290
2291                 [StructLayout(LayoutKind.Sequential)]
2292                 public struct GstElement_numsrcpadsAlign
2293                 {
2294                         sbyte f1;
2295                         private ushort numsrcpads;
2296                 }
2297
2298                 [StructLayout(LayoutKind.Sequential)]
2299                 public struct GstElement_numsinkpadsAlign
2300                 {
2301                         sbyte f1;
2302                         private ushort numsinkpads;
2303                 }
2304
2305                 [StructLayout(LayoutKind.Sequential)]
2306                 public struct GstElement_pads_cookieAlign
2307                 {
2308                         sbyte f1;
2309                         private uint pads_cookie;
2310                 }
2311
2312
2313                 // End of the ABI representation.
2314
2315 #endregion
2316         }
2317 }