Release 1.22.7
[platform/upstream/gstreamer.git] / subprojects / gstreamer-sharp / sources / generated / Gst.Audio / AudioEncoder.cs
1 // This file was generated by the Gtk# code generator.
2 // Any changes made will be lost if regenerated.
3
4 namespace Gst.Audio {
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 AudioEncoder : Gst.Element, Gst.IPreset {
13
14                 protected AudioEncoder (IntPtr raw) : base(raw) {}
15
16                 protected AudioEncoder() : base(IntPtr.Zero)
17                 {
18                         CreateNativeObject (new string [0], new GLib.Value [0]);
19                 }
20
21                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
22                 static extern bool gst_audio_encoder_get_hard_resync(IntPtr raw);
23
24                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
25                 static extern void gst_audio_encoder_set_hard_resync(IntPtr raw, bool enabled);
26
27                 [GLib.Property ("hard-resync")]
28                 public bool HardResync {
29                         get  {
30                                 bool raw_ret = gst_audio_encoder_get_hard_resync(Handle);
31                                 bool ret = raw_ret;
32                                 return ret;
33                         }
34                         set  {
35                                 gst_audio_encoder_set_hard_resync(Handle, value);
36                         }
37                 }
38
39                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
40                 static extern bool gst_audio_encoder_get_mark_granule(IntPtr raw);
41
42                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
43                 static extern void gst_audio_encoder_set_mark_granule(IntPtr raw, bool enabled);
44
45                 [GLib.Property ("mark-granule")]
46                 public bool MarkGranule {
47                         get  {
48                                 bool raw_ret = gst_audio_encoder_get_mark_granule(Handle);
49                                 bool ret = raw_ret;
50                                 return ret;
51                         }
52                         set  {
53                                 gst_audio_encoder_set_mark_granule(Handle, value);
54                         }
55                 }
56
57                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
58                 static extern bool gst_audio_encoder_get_perfect_timestamp(IntPtr raw);
59
60                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
61                 static extern void gst_audio_encoder_set_perfect_timestamp(IntPtr raw, bool enabled);
62
63                 [GLib.Property ("perfect-timestamp")]
64                 public bool PerfectTimestamp {
65                         get  {
66                                 bool raw_ret = gst_audio_encoder_get_perfect_timestamp(Handle);
67                                 bool ret = raw_ret;
68                                 return ret;
69                         }
70                         set  {
71                                 gst_audio_encoder_set_perfect_timestamp(Handle, value);
72                         }
73                 }
74
75                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
76                 static extern ulong gst_audio_encoder_get_tolerance(IntPtr raw);
77
78                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
79                 static extern void gst_audio_encoder_set_tolerance(IntPtr raw, ulong tolerance);
80
81                 [GLib.Property ("tolerance")]
82                 public ulong Tolerance {
83                         get  {
84                                 ulong raw_ret = gst_audio_encoder_get_tolerance(Handle);
85                                 ulong ret = raw_ret;
86                                 return ret;
87                         }
88                         set  {
89                                 gst_audio_encoder_set_tolerance(Handle, value);
90                         }
91                 }
92
93                 public Gst.Pad Sinkpad {
94                         get {
95                                 unsafe {
96                                         IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("sinkpad"));
97                                         return GLib.Object.GetObject((*raw_ptr)) as Gst.Pad;
98                                 }
99                         }
100                 }
101
102                 public Gst.Pad Srcpad {
103                         get {
104                                 unsafe {
105                                         IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("srcpad"));
106                                         return GLib.Object.GetObject((*raw_ptr)) as Gst.Pad;
107                                 }
108                         }
109                 }
110
111                 public GLib.RecMutex StreamLock {
112                         get {
113                                 unsafe {
114                                         IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("stream_lock"));
115                                         return new GLib.RecMutex((*raw_ptr));
116                                 }
117                         }
118                 }
119
120                 public Gst.Segment InputSegment {
121                         get {
122                                 unsafe {
123                                         IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("input_segment"));
124                                         return Gst.Segment.New ((*raw_ptr));
125                                 }
126                         }
127                 }
128
129                 public Gst.Segment OutputSegment {
130                         get {
131                                 unsafe {
132                                         IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("output_segment"));
133                                         return Gst.Segment.New ((*raw_ptr));
134                                 }
135                         }
136                 }
137
138                 static StartNativeDelegate Start_cb_delegate;
139                 static StartNativeDelegate StartVMCallback {
140                         get {
141                                 if (Start_cb_delegate == null)
142                                         Start_cb_delegate = new StartNativeDelegate (Start_cb);
143                                 return Start_cb_delegate;
144                         }
145                 }
146
147                 static void OverrideStart (GLib.GType gtype)
148                 {
149                         OverrideStart (gtype, StartVMCallback);
150                 }
151
152                 static void OverrideStart (GLib.GType gtype, StartNativeDelegate callback)
153                 {
154                         unsafe {
155                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("start"));
156                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
157                         }
158                 }
159
160                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
161                 delegate bool StartNativeDelegate (IntPtr inst);
162
163                 static bool Start_cb (IntPtr inst)
164                 {
165                         try {
166                                 AudioEncoder __obj = GLib.Object.GetObject (inst, false) as AudioEncoder;
167                                 bool __result;
168                                 __result = __obj.OnStart ();
169                                 return __result;
170                         } catch (Exception e) {
171                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
172                                 // NOTREACHED: above call does not return.
173                                 throw e;
174                         }
175                 }
176
177                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioEncoder), ConnectionMethod="OverrideStart")]
178                 protected virtual bool OnStart ()
179                 {
180                         return InternalStart ();
181                 }
182
183                 private bool InternalStart ()
184                 {
185                         StartNativeDelegate unmanaged = null;
186                         unsafe {
187                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("start"));
188                                 unmanaged = (StartNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(StartNativeDelegate));
189                         }
190                         if (unmanaged == null) return false;
191
192                         bool __result = unmanaged (this.Handle);
193                         return __result;
194                 }
195
196                 static StopNativeDelegate Stop_cb_delegate;
197                 static StopNativeDelegate StopVMCallback {
198                         get {
199                                 if (Stop_cb_delegate == null)
200                                         Stop_cb_delegate = new StopNativeDelegate (Stop_cb);
201                                 return Stop_cb_delegate;
202                         }
203                 }
204
205                 static void OverrideStop (GLib.GType gtype)
206                 {
207                         OverrideStop (gtype, StopVMCallback);
208                 }
209
210                 static void OverrideStop (GLib.GType gtype, StopNativeDelegate callback)
211                 {
212                         unsafe {
213                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("stop"));
214                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
215                         }
216                 }
217
218                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
219                 delegate bool StopNativeDelegate (IntPtr inst);
220
221                 static bool Stop_cb (IntPtr inst)
222                 {
223                         try {
224                                 AudioEncoder __obj = GLib.Object.GetObject (inst, false) as AudioEncoder;
225                                 bool __result;
226                                 __result = __obj.OnStop ();
227                                 return __result;
228                         } catch (Exception e) {
229                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
230                                 // NOTREACHED: above call does not return.
231                                 throw e;
232                         }
233                 }
234
235                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioEncoder), ConnectionMethod="OverrideStop")]
236                 protected virtual bool OnStop ()
237                 {
238                         return InternalStop ();
239                 }
240
241                 private bool InternalStop ()
242                 {
243                         StopNativeDelegate unmanaged = null;
244                         unsafe {
245                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("stop"));
246                                 unmanaged = (StopNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(StopNativeDelegate));
247                         }
248                         if (unmanaged == null) return false;
249
250                         bool __result = unmanaged (this.Handle);
251                         return __result;
252                 }
253
254                 static SetFormatNativeDelegate SetFormat_cb_delegate;
255                 static SetFormatNativeDelegate SetFormatVMCallback {
256                         get {
257                                 if (SetFormat_cb_delegate == null)
258                                         SetFormat_cb_delegate = new SetFormatNativeDelegate (SetFormat_cb);
259                                 return SetFormat_cb_delegate;
260                         }
261                 }
262
263                 static void OverrideSetFormat (GLib.GType gtype)
264                 {
265                         OverrideSetFormat (gtype, SetFormatVMCallback);
266                 }
267
268                 static void OverrideSetFormat (GLib.GType gtype, SetFormatNativeDelegate callback)
269                 {
270                         unsafe {
271                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("set_format"));
272                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
273                         }
274                 }
275
276                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
277                 delegate bool SetFormatNativeDelegate (IntPtr inst, IntPtr info);
278
279                 static bool SetFormat_cb (IntPtr inst, IntPtr info)
280                 {
281                         try {
282                                 AudioEncoder __obj = GLib.Object.GetObject (inst, false) as AudioEncoder;
283                                 bool __result;
284                                 __result = __obj.OnSetFormat (info == IntPtr.Zero ? null : (Gst.Audio.AudioInfo) GLib.Opaque.GetOpaque (info, typeof (Gst.Audio.AudioInfo), false));
285                                 return __result;
286                         } catch (Exception e) {
287                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
288                                 // NOTREACHED: above call does not return.
289                                 throw e;
290                         }
291                 }
292
293                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioEncoder), ConnectionMethod="OverrideSetFormat")]
294                 protected virtual bool OnSetFormat (Gst.Audio.AudioInfo info)
295                 {
296                         return InternalSetFormat (info);
297                 }
298
299                 private bool InternalSetFormat (Gst.Audio.AudioInfo info)
300                 {
301                         SetFormatNativeDelegate unmanaged = null;
302                         unsafe {
303                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("set_format"));
304                                 unmanaged = (SetFormatNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(SetFormatNativeDelegate));
305                         }
306                         if (unmanaged == null) return false;
307
308                         bool __result = unmanaged (this.Handle, info == null ? IntPtr.Zero : info.Handle);
309                         return __result;
310                 }
311
312                 static HandleFrameNativeDelegate HandleFrame_cb_delegate;
313                 static HandleFrameNativeDelegate HandleFrameVMCallback {
314                         get {
315                                 if (HandleFrame_cb_delegate == null)
316                                         HandleFrame_cb_delegate = new HandleFrameNativeDelegate (HandleFrame_cb);
317                                 return HandleFrame_cb_delegate;
318                         }
319                 }
320
321                 static void OverrideHandleFrame (GLib.GType gtype)
322                 {
323                         OverrideHandleFrame (gtype, HandleFrameVMCallback);
324                 }
325
326                 static void OverrideHandleFrame (GLib.GType gtype, HandleFrameNativeDelegate callback)
327                 {
328                         unsafe {
329                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("handle_frame"));
330                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
331                         }
332                 }
333
334                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
335                 delegate int HandleFrameNativeDelegate (IntPtr inst, IntPtr buffer);
336
337                 static int HandleFrame_cb (IntPtr inst, IntPtr buffer)
338                 {
339                         try {
340                                 AudioEncoder __obj = GLib.Object.GetObject (inst, false) as AudioEncoder;
341                                 Gst.FlowReturn __result;
342                                 __result = __obj.OnHandleFrame (buffer == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (buffer, typeof (Gst.Buffer), false));
343                                 return (int) __result;
344                         } catch (Exception e) {
345                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
346                                 // NOTREACHED: above call does not return.
347                                 throw e;
348                         }
349                 }
350
351                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioEncoder), ConnectionMethod="OverrideHandleFrame")]
352                 protected virtual Gst.FlowReturn OnHandleFrame (Gst.Buffer buffer)
353                 {
354                         return InternalHandleFrame (buffer);
355                 }
356
357                 private Gst.FlowReturn InternalHandleFrame (Gst.Buffer buffer)
358                 {
359                         HandleFrameNativeDelegate unmanaged = null;
360                         unsafe {
361                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("handle_frame"));
362                                 unmanaged = (HandleFrameNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(HandleFrameNativeDelegate));
363                         }
364                         if (unmanaged == null) return (Gst.FlowReturn) 0;
365
366                         int __result = unmanaged (this.Handle, buffer == null ? IntPtr.Zero : buffer.Handle);
367                         return (Gst.FlowReturn) __result;
368                 }
369
370                 static FlushNativeDelegate Flush_cb_delegate;
371                 static FlushNativeDelegate FlushVMCallback {
372                         get {
373                                 if (Flush_cb_delegate == null)
374                                         Flush_cb_delegate = new FlushNativeDelegate (Flush_cb);
375                                 return Flush_cb_delegate;
376                         }
377                 }
378
379                 static void OverrideFlush (GLib.GType gtype)
380                 {
381                         OverrideFlush (gtype, FlushVMCallback);
382                 }
383
384                 static void OverrideFlush (GLib.GType gtype, FlushNativeDelegate callback)
385                 {
386                         unsafe {
387                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("flush"));
388                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
389                         }
390                 }
391
392                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
393                 delegate void FlushNativeDelegate (IntPtr inst);
394
395                 static void Flush_cb (IntPtr inst)
396                 {
397                         try {
398                                 AudioEncoder __obj = GLib.Object.GetObject (inst, false) as AudioEncoder;
399                                 __obj.OnFlush ();
400                         } catch (Exception e) {
401                                 GLib.ExceptionManager.RaiseUnhandledException (e, false);
402                         }
403                 }
404
405                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioEncoder), ConnectionMethod="OverrideFlush")]
406                 protected virtual void OnFlush ()
407                 {
408                         InternalFlush ();
409                 }
410
411                 private void InternalFlush ()
412                 {
413                         FlushNativeDelegate unmanaged = null;
414                         unsafe {
415                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("flush"));
416                                 unmanaged = (FlushNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(FlushNativeDelegate));
417                         }
418                         if (unmanaged == null) return;
419
420                         unmanaged (this.Handle);
421                 }
422
423                 static PrePushNativeDelegate PrePush_cb_delegate;
424                 static PrePushNativeDelegate PrePushVMCallback {
425                         get {
426                                 if (PrePush_cb_delegate == null)
427                                         PrePush_cb_delegate = new PrePushNativeDelegate (PrePush_cb);
428                                 return PrePush_cb_delegate;
429                         }
430                 }
431
432                 static void OverridePrePush (GLib.GType gtype)
433                 {
434                         OverridePrePush (gtype, PrePushVMCallback);
435                 }
436
437                 static void OverridePrePush (GLib.GType gtype, PrePushNativeDelegate callback)
438                 {
439                         unsafe {
440                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("pre_push"));
441                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
442                         }
443                 }
444
445                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
446                 delegate int PrePushNativeDelegate (IntPtr inst, IntPtr buffer);
447
448                 static int PrePush_cb (IntPtr inst, IntPtr buffer)
449                 {
450                         try {
451                                 AudioEncoder __obj = GLib.Object.GetObject (inst, false) as AudioEncoder;
452                                 Gst.FlowReturn __result;
453                                 __result = __obj.OnPrePush (buffer == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (buffer, typeof (Gst.Buffer), false));
454                                 return (int) __result;
455                         } catch (Exception e) {
456                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
457                                 // NOTREACHED: above call does not return.
458                                 throw e;
459                         }
460                 }
461
462                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioEncoder), ConnectionMethod="OverridePrePush")]
463                 protected virtual Gst.FlowReturn OnPrePush (Gst.Buffer buffer)
464                 {
465                         return InternalPrePush (buffer);
466                 }
467
468                 private Gst.FlowReturn InternalPrePush (Gst.Buffer buffer)
469                 {
470                         PrePushNativeDelegate unmanaged = null;
471                         unsafe {
472                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("pre_push"));
473                                 unmanaged = (PrePushNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(PrePushNativeDelegate));
474                         }
475                         if (unmanaged == null) return (Gst.FlowReturn) 0;
476
477                         int __result = unmanaged (this.Handle, buffer == null ? IntPtr.Zero : buffer.Handle);
478                         return (Gst.FlowReturn) __result;
479                 }
480
481                 static SinkEventNativeDelegate SinkEvent_cb_delegate;
482                 static SinkEventNativeDelegate SinkEventVMCallback {
483                         get {
484                                 if (SinkEvent_cb_delegate == null)
485                                         SinkEvent_cb_delegate = new SinkEventNativeDelegate (SinkEvent_cb);
486                                 return SinkEvent_cb_delegate;
487                         }
488                 }
489
490                 static void OverrideSinkEvent (GLib.GType gtype)
491                 {
492                         OverrideSinkEvent (gtype, SinkEventVMCallback);
493                 }
494
495                 static void OverrideSinkEvent (GLib.GType gtype, SinkEventNativeDelegate callback)
496                 {
497                         unsafe {
498                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("sink_event"));
499                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
500                         }
501                 }
502
503                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
504                 delegate bool SinkEventNativeDelegate (IntPtr inst, IntPtr evnt);
505
506                 static bool SinkEvent_cb (IntPtr inst, IntPtr evnt)
507                 {
508                         try {
509                                 AudioEncoder __obj = GLib.Object.GetObject (inst, false) as AudioEncoder;
510                                 bool __result;
511                                 __result = __obj.OnSinkEvent (evnt == IntPtr.Zero ? null : (Gst.Event) GLib.Opaque.GetOpaque (evnt, typeof (Gst.Event), false));
512                                 return __result;
513                         } catch (Exception e) {
514                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
515                                 // NOTREACHED: above call does not return.
516                                 throw e;
517                         }
518                 }
519
520                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioEncoder), ConnectionMethod="OverrideSinkEvent")]
521                 protected virtual bool OnSinkEvent (Gst.Event evnt)
522                 {
523                         return InternalSinkEvent (evnt);
524                 }
525
526                 private bool InternalSinkEvent (Gst.Event evnt)
527                 {
528                         SinkEventNativeDelegate unmanaged = null;
529                         unsafe {
530                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("sink_event"));
531                                 unmanaged = (SinkEventNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(SinkEventNativeDelegate));
532                         }
533                         if (unmanaged == null) return false;
534
535                         bool __result = unmanaged (this.Handle, evnt == null ? IntPtr.Zero : evnt.Handle);
536                         return __result;
537                 }
538
539                 static SrcEventNativeDelegate SrcEvent_cb_delegate;
540                 static SrcEventNativeDelegate SrcEventVMCallback {
541                         get {
542                                 if (SrcEvent_cb_delegate == null)
543                                         SrcEvent_cb_delegate = new SrcEventNativeDelegate (SrcEvent_cb);
544                                 return SrcEvent_cb_delegate;
545                         }
546                 }
547
548                 static void OverrideSrcEvent (GLib.GType gtype)
549                 {
550                         OverrideSrcEvent (gtype, SrcEventVMCallback);
551                 }
552
553                 static void OverrideSrcEvent (GLib.GType gtype, SrcEventNativeDelegate callback)
554                 {
555                         unsafe {
556                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("src_event"));
557                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
558                         }
559                 }
560
561                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
562                 delegate bool SrcEventNativeDelegate (IntPtr inst, IntPtr evnt);
563
564                 static bool SrcEvent_cb (IntPtr inst, IntPtr evnt)
565                 {
566                         try {
567                                 AudioEncoder __obj = GLib.Object.GetObject (inst, false) as AudioEncoder;
568                                 bool __result;
569                                 __result = __obj.OnSrcEvent (evnt == IntPtr.Zero ? null : (Gst.Event) GLib.Opaque.GetOpaque (evnt, typeof (Gst.Event), false));
570                                 return __result;
571                         } catch (Exception e) {
572                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
573                                 // NOTREACHED: above call does not return.
574                                 throw e;
575                         }
576                 }
577
578                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioEncoder), ConnectionMethod="OverrideSrcEvent")]
579                 protected virtual bool OnSrcEvent (Gst.Event evnt)
580                 {
581                         return InternalSrcEvent (evnt);
582                 }
583
584                 private bool InternalSrcEvent (Gst.Event evnt)
585                 {
586                         SrcEventNativeDelegate unmanaged = null;
587                         unsafe {
588                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("src_event"));
589                                 unmanaged = (SrcEventNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(SrcEventNativeDelegate));
590                         }
591                         if (unmanaged == null) return false;
592
593                         bool __result = unmanaged (this.Handle, evnt == null ? IntPtr.Zero : evnt.Handle);
594                         return __result;
595                 }
596
597                 static GetcapsNativeDelegate Getcaps_cb_delegate;
598                 static GetcapsNativeDelegate GetcapsVMCallback {
599                         get {
600                                 if (Getcaps_cb_delegate == null)
601                                         Getcaps_cb_delegate = new GetcapsNativeDelegate (Getcaps_cb);
602                                 return Getcaps_cb_delegate;
603                         }
604                 }
605
606                 static void OverrideGetcaps (GLib.GType gtype)
607                 {
608                         OverrideGetcaps (gtype, GetcapsVMCallback);
609                 }
610
611                 static void OverrideGetcaps (GLib.GType gtype, GetcapsNativeDelegate callback)
612                 {
613                         unsafe {
614                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("getcaps"));
615                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
616                         }
617                 }
618
619                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
620                 delegate IntPtr GetcapsNativeDelegate (IntPtr inst, IntPtr filter);
621
622                 static IntPtr Getcaps_cb (IntPtr inst, IntPtr filter)
623                 {
624                         try {
625                                 AudioEncoder __obj = GLib.Object.GetObject (inst, false) as AudioEncoder;
626                                 Gst.Caps __result;
627                                 __result = __obj.OnGetcaps (filter == IntPtr.Zero ? null : (Gst.Caps) GLib.Opaque.GetOpaque (filter, typeof (Gst.Caps), false));
628                                 return __result == null ? IntPtr.Zero : __result.OwnedCopy;
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.Audio.AudioEncoder), ConnectionMethod="OverrideGetcaps")]
637                 protected virtual Gst.Caps OnGetcaps (Gst.Caps filter)
638                 {
639                         return InternalGetcaps (filter);
640                 }
641
642                 private Gst.Caps InternalGetcaps (Gst.Caps filter)
643                 {
644                         GetcapsNativeDelegate unmanaged = null;
645                         unsafe {
646                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("getcaps"));
647                                 unmanaged = (GetcapsNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(GetcapsNativeDelegate));
648                         }
649                         if (unmanaged == null) return null;
650
651                         IntPtr __result = unmanaged (this.Handle, filter == null ? IntPtr.Zero : filter.Handle);
652                         return __result == IntPtr.Zero ? null : (Gst.Caps) GLib.Opaque.GetOpaque (__result, typeof (Gst.Caps), true);
653                 }
654
655                 static OpenNativeDelegate Open_cb_delegate;
656                 static OpenNativeDelegate OpenVMCallback {
657                         get {
658                                 if (Open_cb_delegate == null)
659                                         Open_cb_delegate = new OpenNativeDelegate (Open_cb);
660                                 return Open_cb_delegate;
661                         }
662                 }
663
664                 static void OverrideOpen (GLib.GType gtype)
665                 {
666                         OverrideOpen (gtype, OpenVMCallback);
667                 }
668
669                 static void OverrideOpen (GLib.GType gtype, OpenNativeDelegate callback)
670                 {
671                         unsafe {
672                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("open"));
673                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
674                         }
675                 }
676
677                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
678                 delegate bool OpenNativeDelegate (IntPtr inst);
679
680                 static bool Open_cb (IntPtr inst)
681                 {
682                         try {
683                                 AudioEncoder __obj = GLib.Object.GetObject (inst, false) as AudioEncoder;
684                                 bool __result;
685                                 __result = __obj.OnOpen ();
686                                 return __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.Audio.AudioEncoder), ConnectionMethod="OverrideOpen")]
695                 protected virtual bool OnOpen ()
696                 {
697                         return InternalOpen ();
698                 }
699
700                 private bool InternalOpen ()
701                 {
702                         OpenNativeDelegate unmanaged = null;
703                         unsafe {
704                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("open"));
705                                 unmanaged = (OpenNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(OpenNativeDelegate));
706                         }
707                         if (unmanaged == null) return false;
708
709                         bool __result = unmanaged (this.Handle);
710                         return __result;
711                 }
712
713                 static CloseNativeDelegate Close_cb_delegate;
714                 static CloseNativeDelegate CloseVMCallback {
715                         get {
716                                 if (Close_cb_delegate == null)
717                                         Close_cb_delegate = new CloseNativeDelegate (Close_cb);
718                                 return Close_cb_delegate;
719                         }
720                 }
721
722                 static void OverrideClose (GLib.GType gtype)
723                 {
724                         OverrideClose (gtype, CloseVMCallback);
725                 }
726
727                 static void OverrideClose (GLib.GType gtype, CloseNativeDelegate callback)
728                 {
729                         unsafe {
730                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("close"));
731                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
732                         }
733                 }
734
735                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
736                 delegate bool CloseNativeDelegate (IntPtr inst);
737
738                 static bool Close_cb (IntPtr inst)
739                 {
740                         try {
741                                 AudioEncoder __obj = GLib.Object.GetObject (inst, false) as AudioEncoder;
742                                 bool __result;
743                                 __result = __obj.OnClose ();
744                                 return __result;
745                         } catch (Exception e) {
746                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
747                                 // NOTREACHED: above call does not return.
748                                 throw e;
749                         }
750                 }
751
752                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioEncoder), ConnectionMethod="OverrideClose")]
753                 protected virtual bool OnClose ()
754                 {
755                         return InternalClose ();
756                 }
757
758                 private bool InternalClose ()
759                 {
760                         CloseNativeDelegate unmanaged = null;
761                         unsafe {
762                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("close"));
763                                 unmanaged = (CloseNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(CloseNativeDelegate));
764                         }
765                         if (unmanaged == null) return false;
766
767                         bool __result = unmanaged (this.Handle);
768                         return __result;
769                 }
770
771                 static NegotiateNativeDelegate Negotiate_cb_delegate;
772                 static NegotiateNativeDelegate NegotiateVMCallback {
773                         get {
774                                 if (Negotiate_cb_delegate == null)
775                                         Negotiate_cb_delegate = new NegotiateNativeDelegate (Negotiate_cb);
776                                 return Negotiate_cb_delegate;
777                         }
778                 }
779
780                 static void OverrideNegotiate (GLib.GType gtype)
781                 {
782                         OverrideNegotiate (gtype, NegotiateVMCallback);
783                 }
784
785                 static void OverrideNegotiate (GLib.GType gtype, NegotiateNativeDelegate callback)
786                 {
787                         unsafe {
788                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("negotiate"));
789                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
790                         }
791                 }
792
793                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
794                 delegate bool NegotiateNativeDelegate (IntPtr inst);
795
796                 static bool Negotiate_cb (IntPtr inst)
797                 {
798                         try {
799                                 AudioEncoder __obj = GLib.Object.GetObject (inst, false) as AudioEncoder;
800                                 bool __result;
801                                 __result = __obj.OnNegotiate ();
802                                 return __result;
803                         } catch (Exception e) {
804                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
805                                 // NOTREACHED: above call does not return.
806                                 throw e;
807                         }
808                 }
809
810                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioEncoder), ConnectionMethod="OverrideNegotiate")]
811                 protected virtual bool OnNegotiate ()
812                 {
813                         return InternalNegotiate ();
814                 }
815
816                 private bool InternalNegotiate ()
817                 {
818                         NegotiateNativeDelegate unmanaged = null;
819                         unsafe {
820                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("negotiate"));
821                                 unmanaged = (NegotiateNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(NegotiateNativeDelegate));
822                         }
823                         if (unmanaged == null) return false;
824
825                         bool __result = unmanaged (this.Handle);
826                         return __result;
827                 }
828
829                 static DecideAllocationNativeDelegate DecideAllocation_cb_delegate;
830                 static DecideAllocationNativeDelegate DecideAllocationVMCallback {
831                         get {
832                                 if (DecideAllocation_cb_delegate == null)
833                                         DecideAllocation_cb_delegate = new DecideAllocationNativeDelegate (DecideAllocation_cb);
834                                 return DecideAllocation_cb_delegate;
835                         }
836                 }
837
838                 static void OverrideDecideAllocation (GLib.GType gtype)
839                 {
840                         OverrideDecideAllocation (gtype, DecideAllocationVMCallback);
841                 }
842
843                 static void OverrideDecideAllocation (GLib.GType gtype, DecideAllocationNativeDelegate callback)
844                 {
845                         unsafe {
846                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("decide_allocation"));
847                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
848                         }
849                 }
850
851                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
852                 delegate bool DecideAllocationNativeDelegate (IntPtr inst, IntPtr query);
853
854                 static bool DecideAllocation_cb (IntPtr inst, IntPtr query)
855                 {
856                         try {
857                                 AudioEncoder __obj = GLib.Object.GetObject (inst, false) as AudioEncoder;
858                                 bool __result;
859                                 __result = __obj.OnDecideAllocation (query == IntPtr.Zero ? null : (Gst.Query) GLib.Opaque.GetOpaque (query, typeof (Gst.Query), false));
860                                 return __result;
861                         } catch (Exception e) {
862                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
863                                 // NOTREACHED: above call does not return.
864                                 throw e;
865                         }
866                 }
867
868                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioEncoder), ConnectionMethod="OverrideDecideAllocation")]
869                 protected virtual bool OnDecideAllocation (Gst.Query query)
870                 {
871                         return InternalDecideAllocation (query);
872                 }
873
874                 private bool InternalDecideAllocation (Gst.Query query)
875                 {
876                         DecideAllocationNativeDelegate unmanaged = null;
877                         unsafe {
878                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("decide_allocation"));
879                                 unmanaged = (DecideAllocationNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(DecideAllocationNativeDelegate));
880                         }
881                         if (unmanaged == null) return false;
882
883                         bool __result = unmanaged (this.Handle, query == null ? IntPtr.Zero : query.Handle);
884                         return __result;
885                 }
886
887                 static ProposeAllocationNativeDelegate ProposeAllocation_cb_delegate;
888                 static ProposeAllocationNativeDelegate ProposeAllocationVMCallback {
889                         get {
890                                 if (ProposeAllocation_cb_delegate == null)
891                                         ProposeAllocation_cb_delegate = new ProposeAllocationNativeDelegate (ProposeAllocation_cb);
892                                 return ProposeAllocation_cb_delegate;
893                         }
894                 }
895
896                 static void OverrideProposeAllocation (GLib.GType gtype)
897                 {
898                         OverrideProposeAllocation (gtype, ProposeAllocationVMCallback);
899                 }
900
901                 static void OverrideProposeAllocation (GLib.GType gtype, ProposeAllocationNativeDelegate callback)
902                 {
903                         unsafe {
904                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("propose_allocation"));
905                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
906                         }
907                 }
908
909                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
910                 delegate bool ProposeAllocationNativeDelegate (IntPtr inst, IntPtr query);
911
912                 static bool ProposeAllocation_cb (IntPtr inst, IntPtr query)
913                 {
914                         try {
915                                 AudioEncoder __obj = GLib.Object.GetObject (inst, false) as AudioEncoder;
916                                 bool __result;
917                                 __result = __obj.OnProposeAllocation (query == IntPtr.Zero ? null : (Gst.Query) GLib.Opaque.GetOpaque (query, typeof (Gst.Query), false));
918                                 return __result;
919                         } catch (Exception e) {
920                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
921                                 // NOTREACHED: above call does not return.
922                                 throw e;
923                         }
924                 }
925
926                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioEncoder), ConnectionMethod="OverrideProposeAllocation")]
927                 protected virtual bool OnProposeAllocation (Gst.Query query)
928                 {
929                         return InternalProposeAllocation (query);
930                 }
931
932                 private bool InternalProposeAllocation (Gst.Query query)
933                 {
934                         ProposeAllocationNativeDelegate unmanaged = null;
935                         unsafe {
936                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("propose_allocation"));
937                                 unmanaged = (ProposeAllocationNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(ProposeAllocationNativeDelegate));
938                         }
939                         if (unmanaged == null) return false;
940
941                         bool __result = unmanaged (this.Handle, query == null ? IntPtr.Zero : query.Handle);
942                         return __result;
943                 }
944
945                 static TransformMetaNativeDelegate TransformMeta_cb_delegate;
946                 static TransformMetaNativeDelegate TransformMetaVMCallback {
947                         get {
948                                 if (TransformMeta_cb_delegate == null)
949                                         TransformMeta_cb_delegate = new TransformMetaNativeDelegate (TransformMeta_cb);
950                                 return TransformMeta_cb_delegate;
951                         }
952                 }
953
954                 static void OverrideTransformMeta (GLib.GType gtype)
955                 {
956                         OverrideTransformMeta (gtype, TransformMetaVMCallback);
957                 }
958
959                 static void OverrideTransformMeta (GLib.GType gtype, TransformMetaNativeDelegate callback)
960                 {
961                         unsafe {
962                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("transform_meta"));
963                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
964                         }
965                 }
966
967                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
968                 delegate bool TransformMetaNativeDelegate (IntPtr inst, IntPtr outbuf, IntPtr meta, IntPtr inbuf);
969
970                 static bool TransformMeta_cb (IntPtr inst, IntPtr outbuf, IntPtr meta, IntPtr inbuf)
971                 {
972                         try {
973                                 AudioEncoder __obj = GLib.Object.GetObject (inst, false) as AudioEncoder;
974                                 bool __result;
975                                 __result = __obj.OnTransformMeta (outbuf == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (outbuf, typeof (Gst.Buffer), false), Gst.Meta.New (meta), inbuf == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (inbuf, typeof (Gst.Buffer), false));
976                                 return __result;
977                         } catch (Exception e) {
978                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
979                                 // NOTREACHED: above call does not return.
980                                 throw e;
981                         }
982                 }
983
984                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioEncoder), ConnectionMethod="OverrideTransformMeta")]
985                 protected virtual bool OnTransformMeta (Gst.Buffer outbuf, Gst.Meta meta, Gst.Buffer inbuf)
986                 {
987                         return InternalTransformMeta (outbuf, meta, inbuf);
988                 }
989
990                 private bool InternalTransformMeta (Gst.Buffer outbuf, Gst.Meta meta, Gst.Buffer inbuf)
991                 {
992                         TransformMetaNativeDelegate unmanaged = null;
993                         unsafe {
994                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("transform_meta"));
995                                 unmanaged = (TransformMetaNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(TransformMetaNativeDelegate));
996                         }
997                         if (unmanaged == null) return false;
998
999                         IntPtr native_meta = GLib.Marshaller.StructureToPtrAlloc (meta);
1000                         bool __result = unmanaged (this.Handle, outbuf == null ? IntPtr.Zero : outbuf.Handle, native_meta, inbuf == null ? IntPtr.Zero : inbuf.Handle);
1001                         Marshal.FreeHGlobal (native_meta);
1002                         return __result;
1003                 }
1004
1005                 static SinkQueryNativeDelegate SinkQuery_cb_delegate;
1006                 static SinkQueryNativeDelegate SinkQueryVMCallback {
1007                         get {
1008                                 if (SinkQuery_cb_delegate == null)
1009                                         SinkQuery_cb_delegate = new SinkQueryNativeDelegate (SinkQuery_cb);
1010                                 return SinkQuery_cb_delegate;
1011                         }
1012                 }
1013
1014                 static void OverrideSinkQuery (GLib.GType gtype)
1015                 {
1016                         OverrideSinkQuery (gtype, SinkQueryVMCallback);
1017                 }
1018
1019                 static void OverrideSinkQuery (GLib.GType gtype, SinkQueryNativeDelegate callback)
1020                 {
1021                         unsafe {
1022                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("sink_query"));
1023                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
1024                         }
1025                 }
1026
1027                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
1028                 delegate bool SinkQueryNativeDelegate (IntPtr inst, IntPtr query);
1029
1030                 static bool SinkQuery_cb (IntPtr inst, IntPtr query)
1031                 {
1032                         try {
1033                                 AudioEncoder __obj = GLib.Object.GetObject (inst, false) as AudioEncoder;
1034                                 bool __result;
1035                                 __result = __obj.OnSinkQuery (query == IntPtr.Zero ? null : (Gst.Query) GLib.Opaque.GetOpaque (query, typeof (Gst.Query), false));
1036                                 return __result;
1037                         } catch (Exception e) {
1038                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
1039                                 // NOTREACHED: above call does not return.
1040                                 throw e;
1041                         }
1042                 }
1043
1044                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioEncoder), ConnectionMethod="OverrideSinkQuery")]
1045                 protected virtual bool OnSinkQuery (Gst.Query query)
1046                 {
1047                         return InternalSinkQuery (query);
1048                 }
1049
1050                 private bool InternalSinkQuery (Gst.Query query)
1051                 {
1052                         SinkQueryNativeDelegate unmanaged = null;
1053                         unsafe {
1054                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("sink_query"));
1055                                 unmanaged = (SinkQueryNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(SinkQueryNativeDelegate));
1056                         }
1057                         if (unmanaged == null) return false;
1058
1059                         bool __result = unmanaged (this.Handle, query == null ? IntPtr.Zero : query.Handle);
1060                         return __result;
1061                 }
1062
1063                 static SrcQueryNativeDelegate SrcQuery_cb_delegate;
1064                 static SrcQueryNativeDelegate SrcQueryVMCallback {
1065                         get {
1066                                 if (SrcQuery_cb_delegate == null)
1067                                         SrcQuery_cb_delegate = new SrcQueryNativeDelegate (SrcQuery_cb);
1068                                 return SrcQuery_cb_delegate;
1069                         }
1070                 }
1071
1072                 static void OverrideSrcQuery (GLib.GType gtype)
1073                 {
1074                         OverrideSrcQuery (gtype, SrcQueryVMCallback);
1075                 }
1076
1077                 static void OverrideSrcQuery (GLib.GType gtype, SrcQueryNativeDelegate callback)
1078                 {
1079                         unsafe {
1080                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("src_query"));
1081                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
1082                         }
1083                 }
1084
1085                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
1086                 delegate bool SrcQueryNativeDelegate (IntPtr inst, IntPtr query);
1087
1088                 static bool SrcQuery_cb (IntPtr inst, IntPtr query)
1089                 {
1090                         try {
1091                                 AudioEncoder __obj = GLib.Object.GetObject (inst, false) as AudioEncoder;
1092                                 bool __result;
1093                                 __result = __obj.OnSrcQuery (query == IntPtr.Zero ? null : (Gst.Query) GLib.Opaque.GetOpaque (query, typeof (Gst.Query), false));
1094                                 return __result;
1095                         } catch (Exception e) {
1096                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
1097                                 // NOTREACHED: above call does not return.
1098                                 throw e;
1099                         }
1100                 }
1101
1102                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioEncoder), ConnectionMethod="OverrideSrcQuery")]
1103                 protected virtual bool OnSrcQuery (Gst.Query query)
1104                 {
1105                         return InternalSrcQuery (query);
1106                 }
1107
1108                 private bool InternalSrcQuery (Gst.Query query)
1109                 {
1110                         SrcQueryNativeDelegate unmanaged = null;
1111                         unsafe {
1112                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("src_query"));
1113                                 unmanaged = (SrcQueryNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(SrcQueryNativeDelegate));
1114                         }
1115                         if (unmanaged == null) return false;
1116
1117                         bool __result = unmanaged (this.Handle, query == null ? IntPtr.Zero : query.Handle);
1118                         return __result;
1119                 }
1120
1121
1122                 // Internal representation of the wrapped structure ABI.
1123                 static GLib.AbiStruct _class_abi = null;
1124                 static public new GLib.AbiStruct class_abi {
1125                         get {
1126                                 if (_class_abi == null)
1127                                         _class_abi = new GLib.AbiStruct (new List<GLib.AbiField>{ 
1128                                                 new GLib.AbiField("start"
1129                                                         , Gst.Element.class_abi.Fields
1130                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // start
1131                                                         , null
1132                                                         , "stop"
1133                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1134                                                         , 0
1135                                                         ),
1136                                                 new GLib.AbiField("stop"
1137                                                         , -1
1138                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // stop
1139                                                         , "start"
1140                                                         , "set_format"
1141                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1142                                                         , 0
1143                                                         ),
1144                                                 new GLib.AbiField("set_format"
1145                                                         , -1
1146                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // set_format
1147                                                         , "stop"
1148                                                         , "handle_frame"
1149                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1150                                                         , 0
1151                                                         ),
1152                                                 new GLib.AbiField("handle_frame"
1153                                                         , -1
1154                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // handle_frame
1155                                                         , "set_format"
1156                                                         , "flush"
1157                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1158                                                         , 0
1159                                                         ),
1160                                                 new GLib.AbiField("flush"
1161                                                         , -1
1162                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // flush
1163                                                         , "handle_frame"
1164                                                         , "pre_push"
1165                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1166                                                         , 0
1167                                                         ),
1168                                                 new GLib.AbiField("pre_push"
1169                                                         , -1
1170                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // pre_push
1171                                                         , "flush"
1172                                                         , "sink_event"
1173                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1174                                                         , 0
1175                                                         ),
1176                                                 new GLib.AbiField("sink_event"
1177                                                         , -1
1178                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // sink_event
1179                                                         , "pre_push"
1180                                                         , "src_event"
1181                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1182                                                         , 0
1183                                                         ),
1184                                                 new GLib.AbiField("src_event"
1185                                                         , -1
1186                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // src_event
1187                                                         , "sink_event"
1188                                                         , "getcaps"
1189                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1190                                                         , 0
1191                                                         ),
1192                                                 new GLib.AbiField("getcaps"
1193                                                         , -1
1194                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // getcaps
1195                                                         , "src_event"
1196                                                         , "open"
1197                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1198                                                         , 0
1199                                                         ),
1200                                                 new GLib.AbiField("open"
1201                                                         , -1
1202                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // open
1203                                                         , "getcaps"
1204                                                         , "close"
1205                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1206                                                         , 0
1207                                                         ),
1208                                                 new GLib.AbiField("close"
1209                                                         , -1
1210                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // close
1211                                                         , "open"
1212                                                         , "negotiate"
1213                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1214                                                         , 0
1215                                                         ),
1216                                                 new GLib.AbiField("negotiate"
1217                                                         , -1
1218                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // negotiate
1219                                                         , "close"
1220                                                         , "decide_allocation"
1221                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1222                                                         , 0
1223                                                         ),
1224                                                 new GLib.AbiField("decide_allocation"
1225                                                         , -1
1226                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // decide_allocation
1227                                                         , "negotiate"
1228                                                         , "propose_allocation"
1229                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1230                                                         , 0
1231                                                         ),
1232                                                 new GLib.AbiField("propose_allocation"
1233                                                         , -1
1234                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // propose_allocation
1235                                                         , "decide_allocation"
1236                                                         , "transform_meta"
1237                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1238                                                         , 0
1239                                                         ),
1240                                                 new GLib.AbiField("transform_meta"
1241                                                         , -1
1242                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // transform_meta
1243                                                         , "propose_allocation"
1244                                                         , "sink_query"
1245                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1246                                                         , 0
1247                                                         ),
1248                                                 new GLib.AbiField("sink_query"
1249                                                         , -1
1250                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // sink_query
1251                                                         , "transform_meta"
1252                                                         , "src_query"
1253                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1254                                                         , 0
1255                                                         ),
1256                                                 new GLib.AbiField("src_query"
1257                                                         , -1
1258                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // src_query
1259                                                         , "sink_query"
1260                                                         , "_gst_reserved"
1261                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1262                                                         , 0
1263                                                         ),
1264                                                 new GLib.AbiField("_gst_reserved"
1265                                                         , -1
1266                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) * 17 // _gst_reserved
1267                                                         , "src_query"
1268                                                         , null
1269                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1270                                                         , 0
1271                                                         ),
1272                                         });
1273
1274                                 return _class_abi;
1275                         }
1276                 }
1277
1278
1279                 // End of the ABI representation.
1280
1281                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1282                 static extern IntPtr gst_audio_encoder_get_type();
1283
1284                 public static new GLib.GType GType { 
1285                         get {
1286                                 IntPtr raw_ret = gst_audio_encoder_get_type();
1287                                 GLib.GType ret = new GLib.GType(raw_ret);
1288                                 return ret;
1289                         }
1290                 }
1291
1292                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1293                 static extern IntPtr gst_audio_encoder_allocate_output_buffer(IntPtr raw, UIntPtr size);
1294
1295                 public Gst.Buffer AllocateOutputBuffer(ulong size) {
1296                         IntPtr raw_ret = gst_audio_encoder_allocate_output_buffer(Handle, new UIntPtr (size));
1297                         Gst.Buffer ret = raw_ret == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.Buffer), true);
1298                         return ret;
1299                 }
1300
1301                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1302                 static extern int gst_audio_encoder_finish_frame(IntPtr raw, IntPtr buffer, int samples);
1303
1304                 public Gst.FlowReturn FinishFrame(Gst.Buffer buffer, int samples) {
1305                         buffer.Owned = false;
1306                         int raw_ret = gst_audio_encoder_finish_frame(Handle, buffer == null ? IntPtr.Zero : buffer.Handle, samples);
1307                         Gst.FlowReturn ret = (Gst.FlowReturn) raw_ret;
1308                         return ret;
1309                 }
1310
1311                 public Gst.FlowReturn FinishFrame(int samples) {
1312                         return FinishFrame (null, samples);
1313                 }
1314
1315                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1316                 static extern void gst_audio_encoder_get_allocator(IntPtr raw, out IntPtr allocator, IntPtr parms);
1317
1318                 public void GetAllocator(out Gst.Allocator allocator, out Gst.AllocationParams parms) {
1319                         IntPtr native_allocator;
1320                         IntPtr native_parms = Marshal.AllocHGlobal (Marshal.SizeOf (typeof (Gst.AllocationParams)));
1321                         gst_audio_encoder_get_allocator(Handle, out native_allocator, native_parms);
1322                         allocator = GLib.Object.GetObject(native_allocator, true) as Gst.Allocator;
1323                         parms = Gst.AllocationParams.New (native_parms);
1324                         Marshal.FreeHGlobal (native_parms);
1325                 }
1326
1327                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1328                 static extern IntPtr gst_audio_encoder_get_audio_info(IntPtr raw);
1329
1330                 public Gst.Audio.AudioInfo AudioInfo { 
1331                         get {
1332                                 IntPtr raw_ret = gst_audio_encoder_get_audio_info(Handle);
1333                                 Gst.Audio.AudioInfo ret = raw_ret == IntPtr.Zero ? null : (Gst.Audio.AudioInfo) GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.Audio.AudioInfo), true);
1334                                 return ret;
1335                         }
1336                 }
1337
1338                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1339                 static extern bool gst_audio_encoder_get_drainable(IntPtr raw);
1340
1341                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1342                 static extern void gst_audio_encoder_set_drainable(IntPtr raw, bool enabled);
1343
1344                 public bool Drainable { 
1345                         get {
1346                                 bool raw_ret = gst_audio_encoder_get_drainable(Handle);
1347                                 bool ret = raw_ret;
1348                                 return ret;
1349                         }
1350                         set {
1351                                 gst_audio_encoder_set_drainable(Handle, value);
1352                         }
1353                 }
1354
1355                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1356                 static extern int gst_audio_encoder_get_frame_max(IntPtr raw);
1357
1358                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1359                 static extern void gst_audio_encoder_set_frame_max(IntPtr raw, int num);
1360
1361                 public int FrameMax { 
1362                         get {
1363                                 int raw_ret = gst_audio_encoder_get_frame_max(Handle);
1364                                 int ret = raw_ret;
1365                                 return ret;
1366                         }
1367                         set {
1368                                 gst_audio_encoder_set_frame_max(Handle, value);
1369                         }
1370                 }
1371
1372                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1373                 static extern int gst_audio_encoder_get_frame_samples_max(IntPtr raw);
1374
1375                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1376                 static extern void gst_audio_encoder_set_frame_samples_max(IntPtr raw, int num);
1377
1378                 public int FrameSamplesMax { 
1379                         get {
1380                                 int raw_ret = gst_audio_encoder_get_frame_samples_max(Handle);
1381                                 int ret = raw_ret;
1382                                 return ret;
1383                         }
1384                         set {
1385                                 gst_audio_encoder_set_frame_samples_max(Handle, value);
1386                         }
1387                 }
1388
1389                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1390                 static extern int gst_audio_encoder_get_frame_samples_min(IntPtr raw);
1391
1392                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1393                 static extern void gst_audio_encoder_set_frame_samples_min(IntPtr raw, int num);
1394
1395                 public int FrameSamplesMin { 
1396                         get {
1397                                 int raw_ret = gst_audio_encoder_get_frame_samples_min(Handle);
1398                                 int ret = raw_ret;
1399                                 return ret;
1400                         }
1401                         set {
1402                                 gst_audio_encoder_set_frame_samples_min(Handle, value);
1403                         }
1404                 }
1405
1406                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1407                 static extern bool gst_audio_encoder_get_hard_min(IntPtr raw);
1408
1409                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1410                 static extern void gst_audio_encoder_set_hard_min(IntPtr raw, bool enabled);
1411
1412                 public bool HardMin { 
1413                         get {
1414                                 bool raw_ret = gst_audio_encoder_get_hard_min(Handle);
1415                                 bool ret = raw_ret;
1416                                 return ret;
1417                         }
1418                         set {
1419                                 gst_audio_encoder_set_hard_min(Handle, value);
1420                         }
1421                 }
1422
1423                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1424                 static extern void gst_audio_encoder_get_latency(IntPtr raw, out ulong min, out ulong max);
1425
1426                 public void GetLatency(out ulong min, out ulong max) {
1427                         gst_audio_encoder_get_latency(Handle, out min, out max);
1428                 }
1429
1430                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1431                 static extern int gst_audio_encoder_get_lookahead(IntPtr raw);
1432
1433                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1434                 static extern void gst_audio_encoder_set_lookahead(IntPtr raw, int num);
1435
1436                 public int Lookahead { 
1437                         get {
1438                                 int raw_ret = gst_audio_encoder_get_lookahead(Handle);
1439                                 int ret = raw_ret;
1440                                 return ret;
1441                         }
1442                         set {
1443                                 gst_audio_encoder_set_lookahead(Handle, value);
1444                         }
1445                 }
1446
1447                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1448                 static extern void gst_audio_encoder_merge_tags(IntPtr raw, IntPtr tags, int mode);
1449
1450                 public void MergeTags(Gst.TagList tags, Gst.TagMergeMode mode) {
1451                         gst_audio_encoder_merge_tags(Handle, tags == null ? IntPtr.Zero : tags.Handle, (int) mode);
1452                 }
1453
1454                 public void MergeTags(Gst.TagMergeMode mode) {
1455                         MergeTags (null, mode);
1456                 }
1457
1458                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1459                 static extern bool gst_audio_encoder_negotiate(IntPtr raw);
1460
1461                 public bool Negotiate() {
1462                         bool raw_ret = gst_audio_encoder_negotiate(Handle);
1463                         bool ret = raw_ret;
1464                         return ret;
1465                 }
1466
1467                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1468                 static extern IntPtr gst_audio_encoder_proxy_getcaps(IntPtr raw, IntPtr caps, IntPtr filter);
1469
1470                 public Gst.Caps ProxyGetcaps(Gst.Caps caps, Gst.Caps filter) {
1471                         IntPtr raw_ret = gst_audio_encoder_proxy_getcaps(Handle, caps == null ? IntPtr.Zero : caps.Handle, filter == null ? IntPtr.Zero : filter.Handle);
1472                         Gst.Caps ret = raw_ret == IntPtr.Zero ? null : (Gst.Caps) GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.Caps), true);
1473                         return ret;
1474                 }
1475
1476                 public Gst.Caps ProxyGetcaps() {
1477                         return ProxyGetcaps (null, null);
1478                 }
1479
1480                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1481                 static extern void gst_audio_encoder_set_allocation_caps(IntPtr raw, IntPtr allocation_caps);
1482
1483                 public Gst.Caps AllocationCaps { 
1484                         set {
1485                                 gst_audio_encoder_set_allocation_caps(Handle, value == null ? IntPtr.Zero : value.Handle);
1486                         }
1487                 }
1488
1489                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1490                 static extern void gst_audio_encoder_set_headers(IntPtr raw, IntPtr headers);
1491
1492                 public GLib.List Headers { 
1493                         set {
1494                                 gst_audio_encoder_set_headers(Handle, value == null ? IntPtr.Zero : value.Handle);
1495                         }
1496                 }
1497
1498                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1499                 static extern void gst_audio_encoder_set_latency(IntPtr raw, ulong min, ulong max);
1500
1501                 public void SetLatency(ulong min, ulong max) {
1502                         gst_audio_encoder_set_latency(Handle, min, max);
1503                 }
1504
1505                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1506                 static extern bool gst_audio_encoder_set_output_format(IntPtr raw, IntPtr caps);
1507
1508                 public bool SetOutputFormat(Gst.Caps caps) {
1509                         bool raw_ret = gst_audio_encoder_set_output_format(Handle, caps == null ? IntPtr.Zero : caps.Handle);
1510                         bool ret = raw_ret;
1511                         return ret;
1512                 }
1513
1514                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1515                 static extern bool gst_preset_delete_preset(IntPtr raw, IntPtr name);
1516
1517                 public bool DeletePreset(string name) {
1518                         IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
1519                         bool raw_ret = gst_preset_delete_preset(Handle, native_name);
1520                         bool ret = raw_ret;
1521                         GLib.Marshaller.Free (native_name);
1522                         return ret;
1523                 }
1524
1525                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1526                 static extern bool gst_preset_get_meta(IntPtr raw, IntPtr name, IntPtr tag, out IntPtr value);
1527
1528                 public bool GetMeta(string name, string tag, out string value) {
1529                         IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
1530                         IntPtr native_tag = GLib.Marshaller.StringToPtrGStrdup (tag);
1531                         IntPtr native_value;
1532                         bool raw_ret = gst_preset_get_meta(Handle, native_name, native_tag, out native_value);
1533                         bool ret = raw_ret;
1534                         GLib.Marshaller.Free (native_name);
1535                         GLib.Marshaller.Free (native_tag);
1536                         value = GLib.Marshaller.PtrToStringGFree(native_value);
1537                         return ret;
1538                 }
1539
1540                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1541                 static extern IntPtr gst_preset_get_preset_names(IntPtr raw);
1542
1543                 public string[] PresetNames { 
1544                         get {
1545                                 IntPtr raw_ret = gst_preset_get_preset_names(Handle);
1546                                 string[] ret = GLib.Marshaller.NullTermPtrToStringArray (raw_ret, true);
1547                                 return ret;
1548                         }
1549                 }
1550
1551                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1552                 static extern IntPtr gst_preset_get_property_names(IntPtr raw);
1553
1554                 public string[] PropertyNames { 
1555                         get {
1556                                 IntPtr raw_ret = gst_preset_get_property_names(Handle);
1557                                 string[] ret = GLib.Marshaller.NullTermPtrToStringArray (raw_ret, true);
1558                                 return ret;
1559                         }
1560                 }
1561
1562                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1563                 static extern bool gst_preset_is_editable(IntPtr raw);
1564
1565                 public bool IsEditable { 
1566                         get {
1567                                 bool raw_ret = gst_preset_is_editable(Handle);
1568                                 bool ret = raw_ret;
1569                                 return ret;
1570                         }
1571                 }
1572
1573                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1574                 static extern bool gst_preset_load_preset(IntPtr raw, IntPtr name);
1575
1576                 public bool LoadPreset(string name) {
1577                         IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
1578                         bool raw_ret = gst_preset_load_preset(Handle, native_name);
1579                         bool ret = raw_ret;
1580                         GLib.Marshaller.Free (native_name);
1581                         return ret;
1582                 }
1583
1584                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1585                 static extern bool gst_preset_rename_preset(IntPtr raw, IntPtr old_name, IntPtr new_name);
1586
1587                 public bool RenamePreset(string old_name, string new_name) {
1588                         IntPtr native_old_name = GLib.Marshaller.StringToPtrGStrdup (old_name);
1589                         IntPtr native_new_name = GLib.Marshaller.StringToPtrGStrdup (new_name);
1590                         bool raw_ret = gst_preset_rename_preset(Handle, native_old_name, native_new_name);
1591                         bool ret = raw_ret;
1592                         GLib.Marshaller.Free (native_old_name);
1593                         GLib.Marshaller.Free (native_new_name);
1594                         return ret;
1595                 }
1596
1597                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1598                 static extern bool gst_preset_save_preset(IntPtr raw, IntPtr name);
1599
1600                 public bool SavePreset(string name) {
1601                         IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
1602                         bool raw_ret = gst_preset_save_preset(Handle, native_name);
1603                         bool ret = raw_ret;
1604                         GLib.Marshaller.Free (native_name);
1605                         return ret;
1606                 }
1607
1608                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1609                 static extern bool gst_preset_set_meta(IntPtr raw, IntPtr name, IntPtr tag, IntPtr value);
1610
1611                 public bool SetMeta(string name, string tag, string value) {
1612                         IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
1613                         IntPtr native_tag = GLib.Marshaller.StringToPtrGStrdup (tag);
1614                         IntPtr native_value = GLib.Marshaller.StringToPtrGStrdup (value);
1615                         bool raw_ret = gst_preset_set_meta(Handle, native_name, native_tag, native_value);
1616                         bool ret = raw_ret;
1617                         GLib.Marshaller.Free (native_name);
1618                         GLib.Marshaller.Free (native_tag);
1619                         GLib.Marshaller.Free (native_value);
1620                         return ret;
1621                 }
1622
1623                 public bool SetMeta(string name, string tag) {
1624                         return SetMeta (name, tag, null);
1625                 }
1626
1627
1628                 static AudioEncoder ()
1629                 {
1630                         GtkSharp.GstreamerSharp.ObjectManager.Initialize ();
1631                 }
1632
1633                 // Internal representation of the wrapped structure ABI.
1634                 static GLib.AbiStruct _abi_info = null;
1635                 static public new GLib.AbiStruct abi_info {
1636                         get {
1637                                 if (_abi_info == null)
1638                                         _abi_info = new GLib.AbiStruct (new List<GLib.AbiField>{ 
1639                                                 new GLib.AbiField("sinkpad"
1640                                                         , Gst.Element.abi_info.Fields
1641                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // sinkpad
1642                                                         , null
1643                                                         , "srcpad"
1644                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1645                                                         , 0
1646                                                         ),
1647                                                 new GLib.AbiField("srcpad"
1648                                                         , -1
1649                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // srcpad
1650                                                         , "sinkpad"
1651                                                         , "stream_lock"
1652                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1653                                                         , 0
1654                                                         ),
1655                                                 new GLib.AbiField("stream_lock"
1656                                                         , -1
1657                                                         , (uint) Marshal.SizeOf(typeof(GLib.RecMutex.ABI)) // stream_lock
1658                                                         , "srcpad"
1659                                                         , "input_segment"
1660                                                         , (long) Marshal.OffsetOf(typeof(GstAudioEncoder_stream_lockAlign), "stream_lock")
1661                                                         , 0
1662                                                         ),
1663                                                 new GLib.AbiField("input_segment"
1664                                                         , -1
1665                                                         , (uint) Marshal.SizeOf(typeof(Gst.Segment)) // input_segment
1666                                                         , "stream_lock"
1667                                                         , "output_segment"
1668                                                         , (long) Marshal.OffsetOf(typeof(GstAudioEncoder_input_segmentAlign), "input_segment")
1669                                                         , 0
1670                                                         ),
1671                                                 new GLib.AbiField("output_segment"
1672                                                         , -1
1673                                                         , (uint) Marshal.SizeOf(typeof(Gst.Segment)) // output_segment
1674                                                         , "input_segment"
1675                                                         , "priv"
1676                                                         , (long) Marshal.OffsetOf(typeof(GstAudioEncoder_output_segmentAlign), "output_segment")
1677                                                         , 0
1678                                                         ),
1679                                                 new GLib.AbiField("priv"
1680                                                         , -1
1681                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // priv
1682                                                         , "output_segment"
1683                                                         , "_gst_reserved"
1684                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1685                                                         , 0
1686                                                         ),
1687                                                 new GLib.AbiField("_gst_reserved"
1688                                                         , -1
1689                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) * 20 // _gst_reserved
1690                                                         , "priv"
1691                                                         , null
1692                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1693                                                         , 0
1694                                                         ),
1695                                         });
1696
1697                                 return _abi_info;
1698                         }
1699                 }
1700
1701                 [StructLayout(LayoutKind.Sequential)]
1702                 public struct GstAudioEncoder_stream_lockAlign
1703                 {
1704                         sbyte f1;
1705                         private GLib.RecMutex.ABI stream_lock;
1706                 }
1707
1708                 [StructLayout(LayoutKind.Sequential)]
1709                 public struct GstAudioEncoder_input_segmentAlign
1710                 {
1711                         sbyte f1;
1712                         private Gst.Segment input_segment;
1713                 }
1714
1715                 [StructLayout(LayoutKind.Sequential)]
1716                 public struct GstAudioEncoder_output_segmentAlign
1717                 {
1718                         sbyte f1;
1719                         private Gst.Segment output_segment;
1720                 }
1721
1722
1723                 // End of the ABI representation.
1724
1725 #endregion
1726         }
1727 }