1 // This file was generated by the Gtk# code generator.
2 // Any changes made will be lost if regenerated.
7 using System.Collections;
8 using System.Collections.Generic;
9 using System.Runtime.InteropServices;
11 #region Autogenerated code
12 public partial class AudioEncoder : Gst.Element, Gst.IPreset {
14 protected AudioEncoder (IntPtr raw) : base(raw) {}
16 protected AudioEncoder() : base(IntPtr.Zero)
18 CreateNativeObject (new string [0], new GLib.Value [0]);
21 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
22 static extern bool gst_audio_encoder_get_hard_resync(IntPtr raw);
24 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
25 static extern void gst_audio_encoder_set_hard_resync(IntPtr raw, bool enabled);
27 [GLib.Property ("hard-resync")]
28 public bool HardResync {
30 bool raw_ret = gst_audio_encoder_get_hard_resync(Handle);
35 gst_audio_encoder_set_hard_resync(Handle, value);
39 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
40 static extern bool gst_audio_encoder_get_mark_granule(IntPtr raw);
42 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
43 static extern void gst_audio_encoder_set_mark_granule(IntPtr raw, bool enabled);
45 [GLib.Property ("mark-granule")]
46 public bool MarkGranule {
48 bool raw_ret = gst_audio_encoder_get_mark_granule(Handle);
53 gst_audio_encoder_set_mark_granule(Handle, value);
57 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
58 static extern bool gst_audio_encoder_get_perfect_timestamp(IntPtr raw);
60 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
61 static extern void gst_audio_encoder_set_perfect_timestamp(IntPtr raw, bool enabled);
63 [GLib.Property ("perfect-timestamp")]
64 public bool PerfectTimestamp {
66 bool raw_ret = gst_audio_encoder_get_perfect_timestamp(Handle);
71 gst_audio_encoder_set_perfect_timestamp(Handle, value);
75 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
76 static extern ulong gst_audio_encoder_get_tolerance(IntPtr raw);
78 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
79 static extern void gst_audio_encoder_set_tolerance(IntPtr raw, ulong tolerance);
81 [GLib.Property ("tolerance")]
82 public ulong Tolerance {
84 ulong raw_ret = gst_audio_encoder_get_tolerance(Handle);
89 gst_audio_encoder_set_tolerance(Handle, value);
93 public Gst.Pad Sinkpad {
96 IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("sinkpad"));
97 return GLib.Object.GetObject((*raw_ptr)) as Gst.Pad;
102 public Gst.Pad Srcpad {
105 IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("srcpad"));
106 return GLib.Object.GetObject((*raw_ptr)) as Gst.Pad;
111 public GLib.RecMutex StreamLock {
114 IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("stream_lock"));
115 return new GLib.RecMutex((*raw_ptr));
120 public Gst.Segment InputSegment {
123 IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("input_segment"));
124 return Gst.Segment.New ((*raw_ptr));
129 public Gst.Segment OutputSegment {
132 IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("output_segment"));
133 return Gst.Segment.New ((*raw_ptr));
138 static StartNativeDelegate Start_cb_delegate;
139 static StartNativeDelegate StartVMCallback {
141 if (Start_cb_delegate == null)
142 Start_cb_delegate = new StartNativeDelegate (Start_cb);
143 return Start_cb_delegate;
147 static void OverrideStart (GLib.GType gtype)
149 OverrideStart (gtype, StartVMCallback);
152 static void OverrideStart (GLib.GType gtype, StartNativeDelegate callback)
155 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("start"));
156 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
160 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
161 delegate bool StartNativeDelegate (IntPtr inst);
163 static bool Start_cb (IntPtr inst)
166 AudioEncoder __obj = GLib.Object.GetObject (inst, false) as AudioEncoder;
168 __result = __obj.OnStart ();
170 } catch (Exception e) {
171 GLib.ExceptionManager.RaiseUnhandledException (e, true);
172 // NOTREACHED: above call does not return.
177 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioEncoder), ConnectionMethod="OverrideStart")]
178 protected virtual bool OnStart ()
180 return InternalStart ();
183 private bool InternalStart ()
185 StartNativeDelegate unmanaged = null;
187 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("start"));
188 unmanaged = (StartNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(StartNativeDelegate));
190 if (unmanaged == null) return false;
192 bool __result = unmanaged (this.Handle);
196 static StopNativeDelegate Stop_cb_delegate;
197 static StopNativeDelegate StopVMCallback {
199 if (Stop_cb_delegate == null)
200 Stop_cb_delegate = new StopNativeDelegate (Stop_cb);
201 return Stop_cb_delegate;
205 static void OverrideStop (GLib.GType gtype)
207 OverrideStop (gtype, StopVMCallback);
210 static void OverrideStop (GLib.GType gtype, StopNativeDelegate callback)
213 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("stop"));
214 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
218 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
219 delegate bool StopNativeDelegate (IntPtr inst);
221 static bool Stop_cb (IntPtr inst)
224 AudioEncoder __obj = GLib.Object.GetObject (inst, false) as AudioEncoder;
226 __result = __obj.OnStop ();
228 } catch (Exception e) {
229 GLib.ExceptionManager.RaiseUnhandledException (e, true);
230 // NOTREACHED: above call does not return.
235 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioEncoder), ConnectionMethod="OverrideStop")]
236 protected virtual bool OnStop ()
238 return InternalStop ();
241 private bool InternalStop ()
243 StopNativeDelegate unmanaged = null;
245 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("stop"));
246 unmanaged = (StopNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(StopNativeDelegate));
248 if (unmanaged == null) return false;
250 bool __result = unmanaged (this.Handle);
254 static SetFormatNativeDelegate SetFormat_cb_delegate;
255 static SetFormatNativeDelegate SetFormatVMCallback {
257 if (SetFormat_cb_delegate == null)
258 SetFormat_cb_delegate = new SetFormatNativeDelegate (SetFormat_cb);
259 return SetFormat_cb_delegate;
263 static void OverrideSetFormat (GLib.GType gtype)
265 OverrideSetFormat (gtype, SetFormatVMCallback);
268 static void OverrideSetFormat (GLib.GType gtype, SetFormatNativeDelegate callback)
271 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("set_format"));
272 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
276 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
277 delegate bool SetFormatNativeDelegate (IntPtr inst, IntPtr info);
279 static bool SetFormat_cb (IntPtr inst, IntPtr info)
282 AudioEncoder __obj = GLib.Object.GetObject (inst, false) as AudioEncoder;
284 __result = __obj.OnSetFormat (info == IntPtr.Zero ? null : (Gst.Audio.AudioInfo) GLib.Opaque.GetOpaque (info, typeof (Gst.Audio.AudioInfo), false));
286 } catch (Exception e) {
287 GLib.ExceptionManager.RaiseUnhandledException (e, true);
288 // NOTREACHED: above call does not return.
293 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioEncoder), ConnectionMethod="OverrideSetFormat")]
294 protected virtual bool OnSetFormat (Gst.Audio.AudioInfo info)
296 return InternalSetFormat (info);
299 private bool InternalSetFormat (Gst.Audio.AudioInfo info)
301 SetFormatNativeDelegate unmanaged = null;
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));
306 if (unmanaged == null) return false;
308 bool __result = unmanaged (this.Handle, info == null ? IntPtr.Zero : info.Handle);
312 static HandleFrameNativeDelegate HandleFrame_cb_delegate;
313 static HandleFrameNativeDelegate HandleFrameVMCallback {
315 if (HandleFrame_cb_delegate == null)
316 HandleFrame_cb_delegate = new HandleFrameNativeDelegate (HandleFrame_cb);
317 return HandleFrame_cb_delegate;
321 static void OverrideHandleFrame (GLib.GType gtype)
323 OverrideHandleFrame (gtype, HandleFrameVMCallback);
326 static void OverrideHandleFrame (GLib.GType gtype, HandleFrameNativeDelegate callback)
329 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("handle_frame"));
330 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
334 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
335 delegate int HandleFrameNativeDelegate (IntPtr inst, IntPtr buffer);
337 static int HandleFrame_cb (IntPtr inst, IntPtr buffer)
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.
351 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioEncoder), ConnectionMethod="OverrideHandleFrame")]
352 protected virtual Gst.FlowReturn OnHandleFrame (Gst.Buffer buffer)
354 return InternalHandleFrame (buffer);
357 private Gst.FlowReturn InternalHandleFrame (Gst.Buffer buffer)
359 HandleFrameNativeDelegate unmanaged = null;
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));
364 if (unmanaged == null) return (Gst.FlowReturn) 0;
366 int __result = unmanaged (this.Handle, buffer == null ? IntPtr.Zero : buffer.Handle);
367 return (Gst.FlowReturn) __result;
370 static FlushNativeDelegate Flush_cb_delegate;
371 static FlushNativeDelegate FlushVMCallback {
373 if (Flush_cb_delegate == null)
374 Flush_cb_delegate = new FlushNativeDelegate (Flush_cb);
375 return Flush_cb_delegate;
379 static void OverrideFlush (GLib.GType gtype)
381 OverrideFlush (gtype, FlushVMCallback);
384 static void OverrideFlush (GLib.GType gtype, FlushNativeDelegate callback)
387 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("flush"));
388 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
392 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
393 delegate void FlushNativeDelegate (IntPtr inst);
395 static void Flush_cb (IntPtr inst)
398 AudioEncoder __obj = GLib.Object.GetObject (inst, false) as AudioEncoder;
400 } catch (Exception e) {
401 GLib.ExceptionManager.RaiseUnhandledException (e, false);
405 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioEncoder), ConnectionMethod="OverrideFlush")]
406 protected virtual void OnFlush ()
411 private void InternalFlush ()
413 FlushNativeDelegate unmanaged = null;
415 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("flush"));
416 unmanaged = (FlushNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(FlushNativeDelegate));
418 if (unmanaged == null) return;
420 unmanaged (this.Handle);
423 static PrePushNativeDelegate PrePush_cb_delegate;
424 static PrePushNativeDelegate PrePushVMCallback {
426 if (PrePush_cb_delegate == null)
427 PrePush_cb_delegate = new PrePushNativeDelegate (PrePush_cb);
428 return PrePush_cb_delegate;
432 static void OverridePrePush (GLib.GType gtype)
434 OverridePrePush (gtype, PrePushVMCallback);
437 static void OverridePrePush (GLib.GType gtype, PrePushNativeDelegate callback)
440 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("pre_push"));
441 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
445 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
446 delegate int PrePushNativeDelegate (IntPtr inst, IntPtr buffer);
448 static int PrePush_cb (IntPtr inst, IntPtr buffer)
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.
462 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioEncoder), ConnectionMethod="OverridePrePush")]
463 protected virtual Gst.FlowReturn OnPrePush (Gst.Buffer buffer)
465 return InternalPrePush (buffer);
468 private Gst.FlowReturn InternalPrePush (Gst.Buffer buffer)
470 PrePushNativeDelegate unmanaged = null;
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));
475 if (unmanaged == null) return (Gst.FlowReturn) 0;
477 int __result = unmanaged (this.Handle, buffer == null ? IntPtr.Zero : buffer.Handle);
478 return (Gst.FlowReturn) __result;
481 static SinkEventNativeDelegate SinkEvent_cb_delegate;
482 static SinkEventNativeDelegate SinkEventVMCallback {
484 if (SinkEvent_cb_delegate == null)
485 SinkEvent_cb_delegate = new SinkEventNativeDelegate (SinkEvent_cb);
486 return SinkEvent_cb_delegate;
490 static void OverrideSinkEvent (GLib.GType gtype)
492 OverrideSinkEvent (gtype, SinkEventVMCallback);
495 static void OverrideSinkEvent (GLib.GType gtype, SinkEventNativeDelegate callback)
498 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("sink_event"));
499 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
503 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
504 delegate bool SinkEventNativeDelegate (IntPtr inst, IntPtr evnt);
506 static bool SinkEvent_cb (IntPtr inst, IntPtr evnt)
509 AudioEncoder __obj = GLib.Object.GetObject (inst, false) as AudioEncoder;
511 __result = __obj.OnSinkEvent (evnt == IntPtr.Zero ? null : (Gst.Event) GLib.Opaque.GetOpaque (evnt, typeof (Gst.Event), false));
513 } catch (Exception e) {
514 GLib.ExceptionManager.RaiseUnhandledException (e, true);
515 // NOTREACHED: above call does not return.
520 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioEncoder), ConnectionMethod="OverrideSinkEvent")]
521 protected virtual bool OnSinkEvent (Gst.Event evnt)
523 return InternalSinkEvent (evnt);
526 private bool InternalSinkEvent (Gst.Event evnt)
528 SinkEventNativeDelegate unmanaged = null;
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));
533 if (unmanaged == null) return false;
535 bool __result = unmanaged (this.Handle, evnt == null ? IntPtr.Zero : evnt.Handle);
539 static SrcEventNativeDelegate SrcEvent_cb_delegate;
540 static SrcEventNativeDelegate SrcEventVMCallback {
542 if (SrcEvent_cb_delegate == null)
543 SrcEvent_cb_delegate = new SrcEventNativeDelegate (SrcEvent_cb);
544 return SrcEvent_cb_delegate;
548 static void OverrideSrcEvent (GLib.GType gtype)
550 OverrideSrcEvent (gtype, SrcEventVMCallback);
553 static void OverrideSrcEvent (GLib.GType gtype, SrcEventNativeDelegate callback)
556 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("src_event"));
557 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
561 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
562 delegate bool SrcEventNativeDelegate (IntPtr inst, IntPtr evnt);
564 static bool SrcEvent_cb (IntPtr inst, IntPtr evnt)
567 AudioEncoder __obj = GLib.Object.GetObject (inst, false) as AudioEncoder;
569 __result = __obj.OnSrcEvent (evnt == IntPtr.Zero ? null : (Gst.Event) GLib.Opaque.GetOpaque (evnt, typeof (Gst.Event), false));
571 } catch (Exception e) {
572 GLib.ExceptionManager.RaiseUnhandledException (e, true);
573 // NOTREACHED: above call does not return.
578 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioEncoder), ConnectionMethod="OverrideSrcEvent")]
579 protected virtual bool OnSrcEvent (Gst.Event evnt)
581 return InternalSrcEvent (evnt);
584 private bool InternalSrcEvent (Gst.Event evnt)
586 SrcEventNativeDelegate unmanaged = null;
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));
591 if (unmanaged == null) return false;
593 bool __result = unmanaged (this.Handle, evnt == null ? IntPtr.Zero : evnt.Handle);
597 static GetcapsNativeDelegate Getcaps_cb_delegate;
598 static GetcapsNativeDelegate GetcapsVMCallback {
600 if (Getcaps_cb_delegate == null)
601 Getcaps_cb_delegate = new GetcapsNativeDelegate (Getcaps_cb);
602 return Getcaps_cb_delegate;
606 static void OverrideGetcaps (GLib.GType gtype)
608 OverrideGetcaps (gtype, GetcapsVMCallback);
611 static void OverrideGetcaps (GLib.GType gtype, GetcapsNativeDelegate callback)
614 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("getcaps"));
615 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
619 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
620 delegate IntPtr GetcapsNativeDelegate (IntPtr inst, IntPtr filter);
622 static IntPtr Getcaps_cb (IntPtr inst, IntPtr filter)
625 AudioEncoder __obj = GLib.Object.GetObject (inst, false) as AudioEncoder;
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.
636 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioEncoder), ConnectionMethod="OverrideGetcaps")]
637 protected virtual Gst.Caps OnGetcaps (Gst.Caps filter)
639 return InternalGetcaps (filter);
642 private Gst.Caps InternalGetcaps (Gst.Caps filter)
644 GetcapsNativeDelegate unmanaged = null;
646 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("getcaps"));
647 unmanaged = (GetcapsNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(GetcapsNativeDelegate));
649 if (unmanaged == null) return null;
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);
655 static OpenNativeDelegate Open_cb_delegate;
656 static OpenNativeDelegate OpenVMCallback {
658 if (Open_cb_delegate == null)
659 Open_cb_delegate = new OpenNativeDelegate (Open_cb);
660 return Open_cb_delegate;
664 static void OverrideOpen (GLib.GType gtype)
666 OverrideOpen (gtype, OpenVMCallback);
669 static void OverrideOpen (GLib.GType gtype, OpenNativeDelegate callback)
672 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("open"));
673 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
677 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
678 delegate bool OpenNativeDelegate (IntPtr inst);
680 static bool Open_cb (IntPtr inst)
683 AudioEncoder __obj = GLib.Object.GetObject (inst, false) as AudioEncoder;
685 __result = __obj.OnOpen ();
687 } catch (Exception e) {
688 GLib.ExceptionManager.RaiseUnhandledException (e, true);
689 // NOTREACHED: above call does not return.
694 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioEncoder), ConnectionMethod="OverrideOpen")]
695 protected virtual bool OnOpen ()
697 return InternalOpen ();
700 private bool InternalOpen ()
702 OpenNativeDelegate unmanaged = null;
704 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("open"));
705 unmanaged = (OpenNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(OpenNativeDelegate));
707 if (unmanaged == null) return false;
709 bool __result = unmanaged (this.Handle);
713 static CloseNativeDelegate Close_cb_delegate;
714 static CloseNativeDelegate CloseVMCallback {
716 if (Close_cb_delegate == null)
717 Close_cb_delegate = new CloseNativeDelegate (Close_cb);
718 return Close_cb_delegate;
722 static void OverrideClose (GLib.GType gtype)
724 OverrideClose (gtype, CloseVMCallback);
727 static void OverrideClose (GLib.GType gtype, CloseNativeDelegate callback)
730 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("close"));
731 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
735 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
736 delegate bool CloseNativeDelegate (IntPtr inst);
738 static bool Close_cb (IntPtr inst)
741 AudioEncoder __obj = GLib.Object.GetObject (inst, false) as AudioEncoder;
743 __result = __obj.OnClose ();
745 } catch (Exception e) {
746 GLib.ExceptionManager.RaiseUnhandledException (e, true);
747 // NOTREACHED: above call does not return.
752 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioEncoder), ConnectionMethod="OverrideClose")]
753 protected virtual bool OnClose ()
755 return InternalClose ();
758 private bool InternalClose ()
760 CloseNativeDelegate unmanaged = null;
762 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("close"));
763 unmanaged = (CloseNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(CloseNativeDelegate));
765 if (unmanaged == null) return false;
767 bool __result = unmanaged (this.Handle);
771 static NegotiateNativeDelegate Negotiate_cb_delegate;
772 static NegotiateNativeDelegate NegotiateVMCallback {
774 if (Negotiate_cb_delegate == null)
775 Negotiate_cb_delegate = new NegotiateNativeDelegate (Negotiate_cb);
776 return Negotiate_cb_delegate;
780 static void OverrideNegotiate (GLib.GType gtype)
782 OverrideNegotiate (gtype, NegotiateVMCallback);
785 static void OverrideNegotiate (GLib.GType gtype, NegotiateNativeDelegate callback)
788 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("negotiate"));
789 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
793 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
794 delegate bool NegotiateNativeDelegate (IntPtr inst);
796 static bool Negotiate_cb (IntPtr inst)
799 AudioEncoder __obj = GLib.Object.GetObject (inst, false) as AudioEncoder;
801 __result = __obj.OnNegotiate ();
803 } catch (Exception e) {
804 GLib.ExceptionManager.RaiseUnhandledException (e, true);
805 // NOTREACHED: above call does not return.
810 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioEncoder), ConnectionMethod="OverrideNegotiate")]
811 protected virtual bool OnNegotiate ()
813 return InternalNegotiate ();
816 private bool InternalNegotiate ()
818 NegotiateNativeDelegate unmanaged = null;
820 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("negotiate"));
821 unmanaged = (NegotiateNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(NegotiateNativeDelegate));
823 if (unmanaged == null) return false;
825 bool __result = unmanaged (this.Handle);
829 static DecideAllocationNativeDelegate DecideAllocation_cb_delegate;
830 static DecideAllocationNativeDelegate DecideAllocationVMCallback {
832 if (DecideAllocation_cb_delegate == null)
833 DecideAllocation_cb_delegate = new DecideAllocationNativeDelegate (DecideAllocation_cb);
834 return DecideAllocation_cb_delegate;
838 static void OverrideDecideAllocation (GLib.GType gtype)
840 OverrideDecideAllocation (gtype, DecideAllocationVMCallback);
843 static void OverrideDecideAllocation (GLib.GType gtype, DecideAllocationNativeDelegate callback)
846 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("decide_allocation"));
847 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
851 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
852 delegate bool DecideAllocationNativeDelegate (IntPtr inst, IntPtr query);
854 static bool DecideAllocation_cb (IntPtr inst, IntPtr query)
857 AudioEncoder __obj = GLib.Object.GetObject (inst, false) as AudioEncoder;
859 __result = __obj.OnDecideAllocation (query == IntPtr.Zero ? null : (Gst.Query) GLib.Opaque.GetOpaque (query, typeof (Gst.Query), false));
861 } catch (Exception e) {
862 GLib.ExceptionManager.RaiseUnhandledException (e, true);
863 // NOTREACHED: above call does not return.
868 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioEncoder), ConnectionMethod="OverrideDecideAllocation")]
869 protected virtual bool OnDecideAllocation (Gst.Query query)
871 return InternalDecideAllocation (query);
874 private bool InternalDecideAllocation (Gst.Query query)
876 DecideAllocationNativeDelegate unmanaged = null;
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));
881 if (unmanaged == null) return false;
883 bool __result = unmanaged (this.Handle, query == null ? IntPtr.Zero : query.Handle);
887 static ProposeAllocationNativeDelegate ProposeAllocation_cb_delegate;
888 static ProposeAllocationNativeDelegate ProposeAllocationVMCallback {
890 if (ProposeAllocation_cb_delegate == null)
891 ProposeAllocation_cb_delegate = new ProposeAllocationNativeDelegate (ProposeAllocation_cb);
892 return ProposeAllocation_cb_delegate;
896 static void OverrideProposeAllocation (GLib.GType gtype)
898 OverrideProposeAllocation (gtype, ProposeAllocationVMCallback);
901 static void OverrideProposeAllocation (GLib.GType gtype, ProposeAllocationNativeDelegate callback)
904 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("propose_allocation"));
905 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
909 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
910 delegate bool ProposeAllocationNativeDelegate (IntPtr inst, IntPtr query);
912 static bool ProposeAllocation_cb (IntPtr inst, IntPtr query)
915 AudioEncoder __obj = GLib.Object.GetObject (inst, false) as AudioEncoder;
917 __result = __obj.OnProposeAllocation (query == IntPtr.Zero ? null : (Gst.Query) GLib.Opaque.GetOpaque (query, typeof (Gst.Query), false));
919 } catch (Exception e) {
920 GLib.ExceptionManager.RaiseUnhandledException (e, true);
921 // NOTREACHED: above call does not return.
926 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioEncoder), ConnectionMethod="OverrideProposeAllocation")]
927 protected virtual bool OnProposeAllocation (Gst.Query query)
929 return InternalProposeAllocation (query);
932 private bool InternalProposeAllocation (Gst.Query query)
934 ProposeAllocationNativeDelegate unmanaged = null;
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));
939 if (unmanaged == null) return false;
941 bool __result = unmanaged (this.Handle, query == null ? IntPtr.Zero : query.Handle);
945 static TransformMetaNativeDelegate TransformMeta_cb_delegate;
946 static TransformMetaNativeDelegate TransformMetaVMCallback {
948 if (TransformMeta_cb_delegate == null)
949 TransformMeta_cb_delegate = new TransformMetaNativeDelegate (TransformMeta_cb);
950 return TransformMeta_cb_delegate;
954 static void OverrideTransformMeta (GLib.GType gtype)
956 OverrideTransformMeta (gtype, TransformMetaVMCallback);
959 static void OverrideTransformMeta (GLib.GType gtype, TransformMetaNativeDelegate callback)
962 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("transform_meta"));
963 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
967 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
968 delegate bool TransformMetaNativeDelegate (IntPtr inst, IntPtr outbuf, IntPtr meta, IntPtr inbuf);
970 static bool TransformMeta_cb (IntPtr inst, IntPtr outbuf, IntPtr meta, IntPtr inbuf)
973 AudioEncoder __obj = GLib.Object.GetObject (inst, false) as AudioEncoder;
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));
977 } catch (Exception e) {
978 GLib.ExceptionManager.RaiseUnhandledException (e, true);
979 // NOTREACHED: above call does not return.
984 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioEncoder), ConnectionMethod="OverrideTransformMeta")]
985 protected virtual bool OnTransformMeta (Gst.Buffer outbuf, Gst.Meta meta, Gst.Buffer inbuf)
987 return InternalTransformMeta (outbuf, meta, inbuf);
990 private bool InternalTransformMeta (Gst.Buffer outbuf, Gst.Meta meta, Gst.Buffer inbuf)
992 TransformMetaNativeDelegate unmanaged = null;
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));
997 if (unmanaged == null) return false;
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);
1005 static SinkQueryNativeDelegate SinkQuery_cb_delegate;
1006 static SinkQueryNativeDelegate SinkQueryVMCallback {
1008 if (SinkQuery_cb_delegate == null)
1009 SinkQuery_cb_delegate = new SinkQueryNativeDelegate (SinkQuery_cb);
1010 return SinkQuery_cb_delegate;
1014 static void OverrideSinkQuery (GLib.GType gtype)
1016 OverrideSinkQuery (gtype, SinkQueryVMCallback);
1019 static void OverrideSinkQuery (GLib.GType gtype, SinkQueryNativeDelegate callback)
1022 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("sink_query"));
1023 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
1027 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
1028 delegate bool SinkQueryNativeDelegate (IntPtr inst, IntPtr query);
1030 static bool SinkQuery_cb (IntPtr inst, IntPtr query)
1033 AudioEncoder __obj = GLib.Object.GetObject (inst, false) as AudioEncoder;
1035 __result = __obj.OnSinkQuery (query == IntPtr.Zero ? null : (Gst.Query) GLib.Opaque.GetOpaque (query, typeof (Gst.Query), false));
1037 } catch (Exception e) {
1038 GLib.ExceptionManager.RaiseUnhandledException (e, true);
1039 // NOTREACHED: above call does not return.
1044 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioEncoder), ConnectionMethod="OverrideSinkQuery")]
1045 protected virtual bool OnSinkQuery (Gst.Query query)
1047 return InternalSinkQuery (query);
1050 private bool InternalSinkQuery (Gst.Query query)
1052 SinkQueryNativeDelegate unmanaged = null;
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));
1057 if (unmanaged == null) return false;
1059 bool __result = unmanaged (this.Handle, query == null ? IntPtr.Zero : query.Handle);
1063 static SrcQueryNativeDelegate SrcQuery_cb_delegate;
1064 static SrcQueryNativeDelegate SrcQueryVMCallback {
1066 if (SrcQuery_cb_delegate == null)
1067 SrcQuery_cb_delegate = new SrcQueryNativeDelegate (SrcQuery_cb);
1068 return SrcQuery_cb_delegate;
1072 static void OverrideSrcQuery (GLib.GType gtype)
1074 OverrideSrcQuery (gtype, SrcQueryVMCallback);
1077 static void OverrideSrcQuery (GLib.GType gtype, SrcQueryNativeDelegate callback)
1080 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("src_query"));
1081 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
1085 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
1086 delegate bool SrcQueryNativeDelegate (IntPtr inst, IntPtr query);
1088 static bool SrcQuery_cb (IntPtr inst, IntPtr query)
1091 AudioEncoder __obj = GLib.Object.GetObject (inst, false) as AudioEncoder;
1093 __result = __obj.OnSrcQuery (query == IntPtr.Zero ? null : (Gst.Query) GLib.Opaque.GetOpaque (query, typeof (Gst.Query), false));
1095 } catch (Exception e) {
1096 GLib.ExceptionManager.RaiseUnhandledException (e, true);
1097 // NOTREACHED: above call does not return.
1102 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioEncoder), ConnectionMethod="OverrideSrcQuery")]
1103 protected virtual bool OnSrcQuery (Gst.Query query)
1105 return InternalSrcQuery (query);
1108 private bool InternalSrcQuery (Gst.Query query)
1110 SrcQueryNativeDelegate unmanaged = null;
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));
1115 if (unmanaged == null) return false;
1117 bool __result = unmanaged (this.Handle, query == null ? IntPtr.Zero : query.Handle);
1122 // Internal representation of the wrapped structure ABI.
1123 static GLib.AbiStruct _class_abi = null;
1124 static public new GLib.AbiStruct class_abi {
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
1133 , (uint) Marshal.SizeOf(typeof(IntPtr))
1136 new GLib.AbiField("stop"
1138 , (uint) Marshal.SizeOf(typeof(IntPtr)) // stop
1141 , (uint) Marshal.SizeOf(typeof(IntPtr))
1144 new GLib.AbiField("set_format"
1146 , (uint) Marshal.SizeOf(typeof(IntPtr)) // set_format
1149 , (uint) Marshal.SizeOf(typeof(IntPtr))
1152 new GLib.AbiField("handle_frame"
1154 , (uint) Marshal.SizeOf(typeof(IntPtr)) // handle_frame
1157 , (uint) Marshal.SizeOf(typeof(IntPtr))
1160 new GLib.AbiField("flush"
1162 , (uint) Marshal.SizeOf(typeof(IntPtr)) // flush
1165 , (uint) Marshal.SizeOf(typeof(IntPtr))
1168 new GLib.AbiField("pre_push"
1170 , (uint) Marshal.SizeOf(typeof(IntPtr)) // pre_push
1173 , (uint) Marshal.SizeOf(typeof(IntPtr))
1176 new GLib.AbiField("sink_event"
1178 , (uint) Marshal.SizeOf(typeof(IntPtr)) // sink_event
1181 , (uint) Marshal.SizeOf(typeof(IntPtr))
1184 new GLib.AbiField("src_event"
1186 , (uint) Marshal.SizeOf(typeof(IntPtr)) // src_event
1189 , (uint) Marshal.SizeOf(typeof(IntPtr))
1192 new GLib.AbiField("getcaps"
1194 , (uint) Marshal.SizeOf(typeof(IntPtr)) // getcaps
1197 , (uint) Marshal.SizeOf(typeof(IntPtr))
1200 new GLib.AbiField("open"
1202 , (uint) Marshal.SizeOf(typeof(IntPtr)) // open
1205 , (uint) Marshal.SizeOf(typeof(IntPtr))
1208 new GLib.AbiField("close"
1210 , (uint) Marshal.SizeOf(typeof(IntPtr)) // close
1213 , (uint) Marshal.SizeOf(typeof(IntPtr))
1216 new GLib.AbiField("negotiate"
1218 , (uint) Marshal.SizeOf(typeof(IntPtr)) // negotiate
1220 , "decide_allocation"
1221 , (uint) Marshal.SizeOf(typeof(IntPtr))
1224 new GLib.AbiField("decide_allocation"
1226 , (uint) Marshal.SizeOf(typeof(IntPtr)) // decide_allocation
1228 , "propose_allocation"
1229 , (uint) Marshal.SizeOf(typeof(IntPtr))
1232 new GLib.AbiField("propose_allocation"
1234 , (uint) Marshal.SizeOf(typeof(IntPtr)) // propose_allocation
1235 , "decide_allocation"
1237 , (uint) Marshal.SizeOf(typeof(IntPtr))
1240 new GLib.AbiField("transform_meta"
1242 , (uint) Marshal.SizeOf(typeof(IntPtr)) // transform_meta
1243 , "propose_allocation"
1245 , (uint) Marshal.SizeOf(typeof(IntPtr))
1248 new GLib.AbiField("sink_query"
1250 , (uint) Marshal.SizeOf(typeof(IntPtr)) // sink_query
1253 , (uint) Marshal.SizeOf(typeof(IntPtr))
1256 new GLib.AbiField("src_query"
1258 , (uint) Marshal.SizeOf(typeof(IntPtr)) // src_query
1261 , (uint) Marshal.SizeOf(typeof(IntPtr))
1264 new GLib.AbiField("_gst_reserved"
1266 , (uint) Marshal.SizeOf(typeof(IntPtr)) * 17 // _gst_reserved
1269 , (uint) Marshal.SizeOf(typeof(IntPtr))
1279 // End of the ABI representation.
1281 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1282 static extern IntPtr gst_audio_encoder_get_type();
1284 public static new GLib.GType GType {
1286 IntPtr raw_ret = gst_audio_encoder_get_type();
1287 GLib.GType ret = new GLib.GType(raw_ret);
1292 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1293 static extern IntPtr gst_audio_encoder_allocate_output_buffer(IntPtr raw, UIntPtr size);
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);
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);
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;
1311 public Gst.FlowReturn FinishFrame(int samples) {
1312 return FinishFrame (null, samples);
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);
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);
1327 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1328 static extern IntPtr gst_audio_encoder_get_audio_info(IntPtr raw);
1330 public Gst.Audio.AudioInfo AudioInfo {
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);
1338 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1339 static extern bool gst_audio_encoder_get_drainable(IntPtr raw);
1341 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1342 static extern void gst_audio_encoder_set_drainable(IntPtr raw, bool enabled);
1344 public bool Drainable {
1346 bool raw_ret = gst_audio_encoder_get_drainable(Handle);
1351 gst_audio_encoder_set_drainable(Handle, value);
1355 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1356 static extern int gst_audio_encoder_get_frame_max(IntPtr raw);
1358 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1359 static extern void gst_audio_encoder_set_frame_max(IntPtr raw, int num);
1361 public int FrameMax {
1363 int raw_ret = gst_audio_encoder_get_frame_max(Handle);
1368 gst_audio_encoder_set_frame_max(Handle, value);
1372 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1373 static extern int gst_audio_encoder_get_frame_samples_max(IntPtr raw);
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);
1378 public int FrameSamplesMax {
1380 int raw_ret = gst_audio_encoder_get_frame_samples_max(Handle);
1385 gst_audio_encoder_set_frame_samples_max(Handle, value);
1389 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1390 static extern int gst_audio_encoder_get_frame_samples_min(IntPtr raw);
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);
1395 public int FrameSamplesMin {
1397 int raw_ret = gst_audio_encoder_get_frame_samples_min(Handle);
1402 gst_audio_encoder_set_frame_samples_min(Handle, value);
1406 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1407 static extern bool gst_audio_encoder_get_hard_min(IntPtr raw);
1409 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1410 static extern void gst_audio_encoder_set_hard_min(IntPtr raw, bool enabled);
1412 public bool HardMin {
1414 bool raw_ret = gst_audio_encoder_get_hard_min(Handle);
1419 gst_audio_encoder_set_hard_min(Handle, value);
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);
1426 public void GetLatency(out ulong min, out ulong max) {
1427 gst_audio_encoder_get_latency(Handle, out min, out max);
1430 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1431 static extern int gst_audio_encoder_get_lookahead(IntPtr raw);
1433 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1434 static extern void gst_audio_encoder_set_lookahead(IntPtr raw, int num);
1436 public int Lookahead {
1438 int raw_ret = gst_audio_encoder_get_lookahead(Handle);
1443 gst_audio_encoder_set_lookahead(Handle, value);
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);
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);
1454 public void MergeTags(Gst.TagMergeMode mode) {
1455 MergeTags (null, mode);
1458 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1459 static extern bool gst_audio_encoder_negotiate(IntPtr raw);
1461 public bool Negotiate() {
1462 bool raw_ret = gst_audio_encoder_negotiate(Handle);
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);
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);
1476 public Gst.Caps ProxyGetcaps() {
1477 return ProxyGetcaps (null, null);
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);
1483 public Gst.Caps AllocationCaps {
1485 gst_audio_encoder_set_allocation_caps(Handle, value == null ? IntPtr.Zero : value.Handle);
1489 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1490 static extern void gst_audio_encoder_set_headers(IntPtr raw, IntPtr headers);
1492 public GLib.List Headers {
1494 gst_audio_encoder_set_headers(Handle, value == null ? IntPtr.Zero : value.Handle);
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);
1501 public void SetLatency(ulong min, ulong max) {
1502 gst_audio_encoder_set_latency(Handle, min, max);
1505 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1506 static extern bool gst_audio_encoder_set_output_format(IntPtr raw, IntPtr caps);
1508 public bool SetOutputFormat(Gst.Caps caps) {
1509 bool raw_ret = gst_audio_encoder_set_output_format(Handle, caps == null ? IntPtr.Zero : caps.Handle);
1514 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1515 static extern bool gst_preset_delete_preset(IntPtr raw, IntPtr name);
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);
1521 GLib.Marshaller.Free (native_name);
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);
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);
1534 GLib.Marshaller.Free (native_name);
1535 GLib.Marshaller.Free (native_tag);
1536 value = GLib.Marshaller.PtrToStringGFree(native_value);
1540 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1541 static extern IntPtr gst_preset_get_preset_names(IntPtr raw);
1543 public string[] PresetNames {
1545 IntPtr raw_ret = gst_preset_get_preset_names(Handle);
1546 string[] ret = GLib.Marshaller.NullTermPtrToStringArray (raw_ret, true);
1551 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1552 static extern IntPtr gst_preset_get_property_names(IntPtr raw);
1554 public string[] PropertyNames {
1556 IntPtr raw_ret = gst_preset_get_property_names(Handle);
1557 string[] ret = GLib.Marshaller.NullTermPtrToStringArray (raw_ret, true);
1562 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1563 static extern bool gst_preset_is_editable(IntPtr raw);
1565 public bool IsEditable {
1567 bool raw_ret = gst_preset_is_editable(Handle);
1573 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1574 static extern bool gst_preset_load_preset(IntPtr raw, IntPtr name);
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);
1580 GLib.Marshaller.Free (native_name);
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);
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);
1592 GLib.Marshaller.Free (native_old_name);
1593 GLib.Marshaller.Free (native_new_name);
1597 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1598 static extern bool gst_preset_save_preset(IntPtr raw, IntPtr name);
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);
1604 GLib.Marshaller.Free (native_name);
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);
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);
1617 GLib.Marshaller.Free (native_name);
1618 GLib.Marshaller.Free (native_tag);
1619 GLib.Marshaller.Free (native_value);
1623 public bool SetMeta(string name, string tag) {
1624 return SetMeta (name, tag, null);
1628 static AudioEncoder ()
1630 GtkSharp.GstreamerSharp.ObjectManager.Initialize ();
1633 // Internal representation of the wrapped structure ABI.
1634 static GLib.AbiStruct _abi_info = null;
1635 static public new GLib.AbiStruct abi_info {
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
1644 , (uint) Marshal.SizeOf(typeof(IntPtr))
1647 new GLib.AbiField("srcpad"
1649 , (uint) Marshal.SizeOf(typeof(IntPtr)) // srcpad
1652 , (uint) Marshal.SizeOf(typeof(IntPtr))
1655 new GLib.AbiField("stream_lock"
1657 , (uint) Marshal.SizeOf(typeof(GLib.RecMutex.ABI)) // stream_lock
1660 , (long) Marshal.OffsetOf(typeof(GstAudioEncoder_stream_lockAlign), "stream_lock")
1663 new GLib.AbiField("input_segment"
1665 , (uint) Marshal.SizeOf(typeof(Gst.Segment)) // input_segment
1668 , (long) Marshal.OffsetOf(typeof(GstAudioEncoder_input_segmentAlign), "input_segment")
1671 new GLib.AbiField("output_segment"
1673 , (uint) Marshal.SizeOf(typeof(Gst.Segment)) // output_segment
1676 , (long) Marshal.OffsetOf(typeof(GstAudioEncoder_output_segmentAlign), "output_segment")
1679 new GLib.AbiField("priv"
1681 , (uint) Marshal.SizeOf(typeof(IntPtr)) // priv
1684 , (uint) Marshal.SizeOf(typeof(IntPtr))
1687 new GLib.AbiField("_gst_reserved"
1689 , (uint) Marshal.SizeOf(typeof(IntPtr)) * 20 // _gst_reserved
1692 , (uint) Marshal.SizeOf(typeof(IntPtr))
1701 [StructLayout(LayoutKind.Sequential)]
1702 public struct GstAudioEncoder_stream_lockAlign
1705 private GLib.RecMutex.ABI stream_lock;
1708 [StructLayout(LayoutKind.Sequential)]
1709 public struct GstAudioEncoder_input_segmentAlign
1712 private Gst.Segment input_segment;
1715 [StructLayout(LayoutKind.Sequential)]
1716 public struct GstAudioEncoder_output_segmentAlign
1719 private Gst.Segment output_segment;
1723 // End of the ABI representation.