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 [StructLayout(LayoutKind.Sequential)]
13 public partial struct AudioConverter : IEquatable<AudioConverter> {
16 public static Gst.Audio.AudioConverter Zero = new Gst.Audio.AudioConverter ();
18 public static Gst.Audio.AudioConverter New(IntPtr raw) {
19 if (raw == IntPtr.Zero)
20 return Gst.Audio.AudioConverter.Zero;
21 return (Gst.Audio.AudioConverter) Marshal.PtrToStructure (raw, typeof (Gst.Audio.AudioConverter));
24 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
25 static extern IntPtr gst_audio_converter_new(int flags, IntPtr in_info, IntPtr out_info, IntPtr config);
27 public static AudioConverter New(Gst.Audio.AudioConverterFlags flags, Gst.Audio.AudioInfo in_info, Gst.Audio.AudioInfo out_info, Gst.Structure config)
30 AudioConverter result = AudioConverter.New (gst_audio_converter_new((int) flags, in_info == null ? IntPtr.Zero : in_info.Handle, out_info == null ? IntPtr.Zero : out_info.Handle, config == null ? IntPtr.Zero : config.Handle));
34 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
35 static extern IntPtr gst_audio_converter_get_type();
37 public static GLib.GType GType {
39 IntPtr raw_ret = gst_audio_converter_get_type();
40 GLib.GType ret = new GLib.GType(raw_ret);
45 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
46 static extern IntPtr gst_audio_converter_get_config(IntPtr raw, out int in_rate, out int out_rate);
48 public Gst.Structure GetConfig(out int in_rate, out int out_rate) {
49 IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
50 System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
51 IntPtr raw_ret = gst_audio_converter_get_config(this_as_native, out in_rate, out out_rate);
52 Gst.Structure ret = raw_ret == IntPtr.Zero ? null : (Gst.Structure) GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.Structure), false);
53 ReadNative (this_as_native, ref this);
54 System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
58 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
59 static extern UIntPtr gst_audio_converter_get_in_frames(IntPtr raw, UIntPtr out_frames);
61 public ulong GetInFrames(ulong out_frames) {
62 IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
63 System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
64 UIntPtr raw_ret = gst_audio_converter_get_in_frames(this_as_native, new UIntPtr (out_frames));
65 ulong ret = (ulong) raw_ret;
66 ReadNative (this_as_native, ref this);
67 System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
71 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
72 static extern UIntPtr gst_audio_converter_get_max_latency(IntPtr raw);
74 public ulong MaxLatency {
76 IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
77 System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
78 UIntPtr raw_ret = gst_audio_converter_get_max_latency(this_as_native);
79 ulong ret = (ulong) raw_ret;
80 ReadNative (this_as_native, ref this);
81 System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
86 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
87 static extern UIntPtr gst_audio_converter_get_out_frames(IntPtr raw, UIntPtr in_frames);
89 public ulong GetOutFrames(ulong in_frames) {
90 IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
91 System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
92 UIntPtr raw_ret = gst_audio_converter_get_out_frames(this_as_native, new UIntPtr (in_frames));
93 ulong ret = (ulong) raw_ret;
94 ReadNative (this_as_native, ref this);
95 System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
99 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
100 static extern bool gst_audio_converter_is_passthrough(IntPtr raw);
102 public bool IsPassthrough {
104 IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
105 System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
106 bool raw_ret = gst_audio_converter_is_passthrough(this_as_native);
108 ReadNative (this_as_native, ref this);
109 System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
114 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
115 static extern void gst_audio_converter_reset(IntPtr raw);
117 public void Reset() {
118 IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
119 System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
120 gst_audio_converter_reset(this_as_native);
121 ReadNative (this_as_native, ref this);
122 System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
125 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
126 static extern bool gst_audio_converter_samples(IntPtr raw, int flags, IntPtr in_param, UIntPtr in_frames, IntPtr out_param, UIntPtr out_frames);
128 public bool Samples(Gst.Audio.AudioConverterFlags flags, IntPtr in_param, ulong in_frames, IntPtr out_param, ulong out_frames) {
129 IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
130 System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
131 bool raw_ret = gst_audio_converter_samples(this_as_native, (int) flags, in_param, new UIntPtr (in_frames), out_param, new UIntPtr (out_frames));
133 ReadNative (this_as_native, ref this);
134 System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
138 public bool Samples(Gst.Audio.AudioConverterFlags flags, ulong in_frames, ulong out_frames) {
139 return Samples (flags, IntPtr.Zero, in_frames, IntPtr.Zero, out_frames);
142 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
143 static extern bool gst_audio_converter_supports_inplace(IntPtr raw);
145 public bool SupportsInplace() {
146 IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
147 System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
148 bool raw_ret = gst_audio_converter_supports_inplace(this_as_native);
150 ReadNative (this_as_native, ref this);
151 System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
155 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
156 static extern bool gst_audio_converter_update_config(IntPtr raw, int in_rate, int out_rate, IntPtr config);
158 public bool UpdateConfig(int in_rate, int out_rate, Gst.Structure config) {
159 IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
160 System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
161 config.Owned = false;
162 bool raw_ret = gst_audio_converter_update_config(this_as_native, in_rate, out_rate, config == null ? IntPtr.Zero : config.Handle);
164 ReadNative (this_as_native, ref this);
165 System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
169 public bool UpdateConfig(int in_rate, int out_rate) {
170 return UpdateConfig (in_rate, out_rate, null);
173 static void ReadNative (IntPtr native, ref Gst.Audio.AudioConverter target)
175 target = New (native);
178 public bool Equals (AudioConverter other)
183 public override bool Equals (object other)
185 return other is AudioConverter && Equals ((AudioConverter) other);
188 public override int GetHashCode ()
190 return this.GetType ().FullName.GetHashCode ();
193 public static explicit operator GLib.Value (Gst.Audio.AudioConverter boxed)
195 GLib.Value val = GLib.Value.Empty;
196 val.Init (Gst.Audio.AudioConverter.GType);
201 public static explicit operator Gst.Audio.AudioConverter (GLib.Value val)
203 return (Gst.Audio.AudioConverter) val.Val;