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 Global {
14 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
15 static extern IntPtr gst_audio_buffer_clip(IntPtr buffer, IntPtr segment, int rate, int bpf);
17 public static Gst.Buffer AudioBufferClip(Gst.Buffer buffer, Gst.Segment segment, int rate, int bpf) {
19 IntPtr native_segment = GLib.Marshaller.StructureToPtrAlloc (segment);
20 IntPtr raw_ret = gst_audio_buffer_clip(buffer == null ? IntPtr.Zero : buffer.Handle, native_segment, rate, bpf);
21 Gst.Buffer ret = raw_ret == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.Buffer), true);
22 Marshal.FreeHGlobal (native_segment);
26 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
27 static extern bool gst_audio_buffer_reorder_channels(IntPtr buffer, int format, int channels, int[] from, int[] to);
29 public static bool AudioBufferReorderChannels(Gst.Buffer buffer, Gst.Audio.AudioFormat format, int channels, Gst.Audio.AudioChannelPosition[] from, Gst.Audio.AudioChannelPosition[] to) {
30 int cnt_from = from == null ? 0 : from.Length;
31 int[] native_from = new int [cnt_from];
32 for (int i = 0; i < cnt_from; i++)
33 native_from [i] = (int) from[i];
34 int cnt_to = to == null ? 0 : to.Length;
35 int[] native_to = new int [cnt_to];
36 for (int i = 0; i < cnt_to; i++)
37 native_to [i] = (int) to[i];
38 bool raw_ret = gst_audio_buffer_reorder_channels(buffer == null ? IntPtr.Zero : buffer.Handle, (int) format, channels, native_from, native_to);
43 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
44 static extern IntPtr gst_audio_buffer_truncate(IntPtr buffer, int bpf, UIntPtr trim, UIntPtr samples);
46 public static Gst.Buffer AudioBufferTruncate(Gst.Buffer buffer, int bpf, ulong trim, ulong samples) {
48 IntPtr raw_ret = gst_audio_buffer_truncate(buffer == null ? IntPtr.Zero : buffer.Handle, bpf, new UIntPtr (trim), new UIntPtr (samples));
49 Gst.Buffer ret = raw_ret == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.Buffer), true);
53 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
54 static extern ulong gst_audio_channel_get_fallback_mask(int channels);
56 public static ulong AudioChannelGetFallbackMask(int channels) {
57 ulong raw_ret = gst_audio_channel_get_fallback_mask(channels);
62 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
63 static extern bool gst_audio_channel_positions_from_mask(int channels, ulong channel_mask, int[] position);
65 public static bool AudioChannelPositionsFromMask(int channels, ulong channel_mask, Gst.Audio.AudioChannelPosition[] position) {
66 int cnt_position = position == null ? 0 : position.Length;
67 int[] native_position = new int [cnt_position];
68 for (int i = 0; i < cnt_position; i++)
69 native_position [i] = (int) position[i];
70 bool raw_ret = gst_audio_channel_positions_from_mask(channels, channel_mask, native_position);
75 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
76 static extern bool gst_audio_channel_positions_to_mask(int[] position, int channels, bool force_order, out ulong channel_mask);
78 public static bool AudioChannelPositionsToMask(Gst.Audio.AudioChannelPosition[] position, int channels, bool force_order, out ulong channel_mask) {
79 int cnt_position = position == null ? 0 : position.Length;
80 int[] native_position = new int [cnt_position];
81 for (int i = 0; i < cnt_position; i++)
82 native_position [i] = (int) position[i];
83 bool raw_ret = gst_audio_channel_positions_to_mask(native_position, channels, force_order, out channel_mask);
88 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
89 static extern IntPtr gst_audio_channel_positions_to_string(int[] position, int channels);
91 public static string AudioChannelPositionsToString(Gst.Audio.AudioChannelPosition[] position, int channels) {
92 int cnt_position = position == null ? 0 : position.Length;
93 int[] native_position = new int [cnt_position];
94 for (int i = 0; i < cnt_position; i++)
95 native_position [i] = (int) position[i];
96 IntPtr raw_ret = gst_audio_channel_positions_to_string(native_position, channels);
97 string ret = GLib.Marshaller.PtrToStringGFree(raw_ret);
101 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
102 static extern bool gst_audio_channel_positions_to_valid_order(int[] position, int channels);
104 public static bool AudioChannelPositionsToValidOrder(Gst.Audio.AudioChannelPosition[] position, int channels) {
105 int cnt_position = position == null ? 0 : position.Length;
106 int[] native_position = new int [cnt_position];
107 for (int i = 0; i < cnt_position; i++)
108 native_position [i] = (int) position[i];
109 bool raw_ret = gst_audio_channel_positions_to_valid_order(native_position, channels);
114 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
115 static extern bool gst_audio_check_valid_channel_positions(int[] position, int channels, bool force_order);
117 public static bool AudioCheckValidChannelPositions(Gst.Audio.AudioChannelPosition[] position, int channels, bool force_order) {
118 int cnt_position = position == null ? 0 : position.Length;
119 int[] native_position = new int [cnt_position];
120 for (int i = 0; i < cnt_position; i++)
121 native_position [i] = (int) position[i];
122 bool raw_ret = gst_audio_check_valid_channel_positions(native_position, channels, force_order);
127 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
128 static extern IntPtr gst_audio_clipping_meta_api_get_type();
130 public static GLib.GType AudioClippingMetaApiGetType() {
131 IntPtr raw_ret = gst_audio_clipping_meta_api_get_type();
132 GLib.GType ret = new GLib.GType(raw_ret);
136 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
137 static extern IntPtr gst_audio_clipping_meta_get_info();
139 public static Gst.MetaInfo AudioClippingMetaGetInfo() {
140 IntPtr raw_ret = gst_audio_clipping_meta_get_info();
141 Gst.MetaInfo ret = Gst.MetaInfo.New (raw_ret);
145 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
146 static extern IntPtr gst_audio_downmix_meta_api_get_type();
148 public static GLib.GType AudioDownmixMetaApiGetType() {
149 IntPtr raw_ret = gst_audio_downmix_meta_api_get_type();
150 GLib.GType ret = new GLib.GType(raw_ret);
154 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
155 static extern IntPtr gst_audio_downmix_meta_get_info();
157 public static Gst.MetaInfo AudioDownmixMetaGetInfo() {
158 IntPtr raw_ret = gst_audio_downmix_meta_get_info();
159 Gst.MetaInfo ret = Gst.MetaInfo.New (raw_ret);
163 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
164 static extern int gst_audio_format_build_integer(bool sign, int endianness, int width, int depth);
166 public static Gst.Audio.AudioFormat AudioFormatBuildInteger(bool sign, int endianness, int width, int depth) {
167 int raw_ret = gst_audio_format_build_integer(sign, endianness, width, depth);
168 Gst.Audio.AudioFormat ret = (Gst.Audio.AudioFormat) raw_ret;
172 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
173 static extern void gst_audio_format_fill_silence(IntPtr info, byte[] dest, UIntPtr n_length);
175 public static void AudioFormatFillSilence(Gst.Audio.AudioFormatInfo info, byte[] dest) {
176 IntPtr native_info = GLib.Marshaller.StructureToPtrAlloc (info);
177 gst_audio_format_fill_silence(native_info, dest, new UIntPtr ((ulong) (dest == null ? 0 : dest.Length)));
178 Marshal.FreeHGlobal (native_info);
181 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
182 static extern int gst_audio_format_from_string(IntPtr format);
184 public static Gst.Audio.AudioFormat AudioFormatFromString(string format) {
185 IntPtr native_format = GLib.Marshaller.StringToPtrGStrdup (format);
186 int raw_ret = gst_audio_format_from_string(native_format);
187 Gst.Audio.AudioFormat ret = (Gst.Audio.AudioFormat) raw_ret;
188 GLib.Marshaller.Free (native_format);
192 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
193 static extern IntPtr gst_audio_format_get_info(int format);
195 public static Gst.Audio.AudioFormatInfo AudioFormatGetInfo(Gst.Audio.AudioFormat format) {
196 IntPtr raw_ret = gst_audio_format_get_info((int) format);
197 Gst.Audio.AudioFormatInfo ret = Gst.Audio.AudioFormatInfo.New (raw_ret);
201 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
202 static extern IntPtr gst_audio_format_info_get_type();
204 public static GLib.GType AudioFormatInfoGetType() {
205 IntPtr raw_ret = gst_audio_format_info_get_type();
206 GLib.GType ret = new GLib.GType(raw_ret);
210 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
211 static extern IntPtr gst_audio_format_to_string(int format);
213 public static string AudioFormatToString(Gst.Audio.AudioFormat format) {
214 IntPtr raw_ret = gst_audio_format_to_string((int) format);
215 string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
219 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
220 static extern bool gst_audio_get_channel_reorder_map(int channels, int[] from, int[] to, int[] reorder_map);
222 public static bool AudioGetChannelReorderMap(int channels, Gst.Audio.AudioChannelPosition[] from, Gst.Audio.AudioChannelPosition[] to, int[] reorder_map) {
223 int cnt_from = from == null ? 0 : from.Length;
224 int[] native_from = new int [cnt_from];
225 for (int i = 0; i < cnt_from; i++)
226 native_from [i] = (int) from[i];
227 int cnt_to = to == null ? 0 : to.Length;
228 int[] native_to = new int [cnt_to];
229 for (int i = 0; i < cnt_to; i++)
230 native_to [i] = (int) to[i];
231 bool raw_ret = gst_audio_get_channel_reorder_map(channels, native_from, native_to, reorder_map);
236 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
237 static extern uint gst_audio_iec61937_frame_size(IntPtr spec);
239 public static uint AudioIec61937FrameSize(Gst.Audio.AudioRingBufferSpec spec) {
240 uint raw_ret = gst_audio_iec61937_frame_size(spec == null ? IntPtr.Zero : spec.Handle);
245 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
246 static extern bool gst_audio_iec61937_payload(byte[] src, uint src_n, byte[] dst, uint dst_n, IntPtr spec, int endianness);
248 public static bool AudioIec61937Payload(byte[] src, uint src_n, byte[] dst, uint dst_n, Gst.Audio.AudioRingBufferSpec spec, int endianness) {
249 bool raw_ret = gst_audio_iec61937_payload(src, src_n, dst, dst_n, spec == null ? IntPtr.Zero : spec.Handle, endianness);
254 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
255 static extern IntPtr gst_audio_make_raw_caps(int[] formats, uint len, int layout);
257 public static Gst.Caps AudioMakeRawCaps(Gst.Audio.AudioFormat[] formats, uint len, Gst.Audio.AudioLayout layout) {
258 int cnt_formats = formats == null ? 0 : formats.Length;
259 int[] native_formats = new int [cnt_formats];
260 for (int i = 0; i < cnt_formats; i++)
261 native_formats [i] = (int) formats[i];
262 IntPtr raw_ret = gst_audio_make_raw_caps(native_formats, len, (int) layout);
263 Gst.Caps ret = raw_ret == IntPtr.Zero ? null : (Gst.Caps) GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.Caps), true);
267 public static Gst.Caps AudioMakeRawCaps(uint len, Gst.Audio.AudioLayout layout) {
268 return AudioMakeRawCaps (null, len, layout);
271 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
272 static extern IntPtr gst_audio_meta_api_get_type();
274 public static GLib.GType AudioMetaApiGetType() {
275 IntPtr raw_ret = gst_audio_meta_api_get_type();
276 GLib.GType ret = new GLib.GType(raw_ret);
280 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
281 static extern IntPtr gst_audio_meta_get_info();
283 public static Gst.MetaInfo AudioMetaGetInfo() {
284 IntPtr raw_ret = gst_audio_meta_get_info();
285 Gst.MetaInfo ret = Gst.MetaInfo.New (raw_ret);
289 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
290 static extern bool gst_audio_reorder_channels(byte[] data, UIntPtr n_length, int format, int channels, int[] from, int[] to);
292 public static bool AudioReorderChannels(byte[] data, Gst.Audio.AudioFormat format, int channels, Gst.Audio.AudioChannelPosition[] from, Gst.Audio.AudioChannelPosition[] to) {
293 int cnt_from = from == null ? 0 : from.Length;
294 int[] native_from = new int [cnt_from];
295 for (int i = 0; i < cnt_from; i++)
296 native_from [i] = (int) from[i];
297 int cnt_to = to == null ? 0 : to.Length;
298 int[] native_to = new int [cnt_to];
299 for (int i = 0; i < cnt_to; i++)
300 native_to [i] = (int) to[i];
301 bool raw_ret = gst_audio_reorder_channels(data, new UIntPtr ((ulong) (data == null ? 0 : data.Length)), (int) format, channels, native_from, native_to);
306 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
307 static extern IntPtr gst_audio_resampler_new(int method, int flags, int format, int channels, int in_rate, int out_rate, IntPtr options);
309 public static Gst.Audio.AudioResampler AudioResamplerNew(Gst.Audio.AudioResamplerMethod method, Gst.Audio.AudioResamplerFlags flags, Gst.Audio.AudioFormat format, int channels, int in_rate, int out_rate, Gst.Structure options) {
310 IntPtr raw_ret = gst_audio_resampler_new((int) method, (int) flags, (int) format, channels, in_rate, out_rate, options == null ? IntPtr.Zero : options.Handle);
311 Gst.Audio.AudioResampler ret = raw_ret == IntPtr.Zero ? null : (Gst.Audio.AudioResampler) GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.Audio.AudioResampler), true);
315 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
316 static extern void gst_audio_resampler_options_set_quality(int method, uint quality, int in_rate, int out_rate, IntPtr options);
318 public static void AudioResamplerOptionsSetQuality(Gst.Audio.AudioResamplerMethod method, uint quality, int in_rate, int out_rate, Gst.Structure options) {
319 gst_audio_resampler_options_set_quality((int) method, quality, in_rate, out_rate, options == null ? IntPtr.Zero : options.Handle);
322 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
323 static extern IntPtr gst_buffer_add_audio_clipping_meta(IntPtr buffer, int format, ulong start, ulong end);
325 public static Gst.Audio.AudioClippingMeta BufferAddAudioClippingMeta(Gst.Buffer buffer, Gst.Format format, ulong start, ulong end) {
326 IntPtr raw_ret = gst_buffer_add_audio_clipping_meta(buffer == null ? IntPtr.Zero : buffer.Handle, (int) format, start, end);
327 Gst.Audio.AudioClippingMeta ret = Gst.Audio.AudioClippingMeta.New (raw_ret);
331 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
332 static extern IntPtr gst_buffer_add_audio_downmix_meta(IntPtr buffer, int[] from_position, int from_channels, int[] to_position, int to_channels, float matrix);
334 public static Gst.Audio.AudioDownmixMeta BufferAddAudioDownmixMeta(Gst.Buffer buffer, Gst.Audio.AudioChannelPosition[] from_position, int from_channels, Gst.Audio.AudioChannelPosition[] to_position, int to_channels, float matrix) {
335 int cnt_from_position = from_position == null ? 0 : from_position.Length;
336 int[] native_from_position = new int [cnt_from_position];
337 for (int i = 0; i < cnt_from_position; i++)
338 native_from_position [i] = (int) from_position[i];
339 int cnt_to_position = to_position == null ? 0 : to_position.Length;
340 int[] native_to_position = new int [cnt_to_position];
341 for (int i = 0; i < cnt_to_position; i++)
342 native_to_position [i] = (int) to_position[i];
343 IntPtr raw_ret = gst_buffer_add_audio_downmix_meta(buffer == null ? IntPtr.Zero : buffer.Handle, native_from_position, from_channels, native_to_position, to_channels, matrix);
344 Gst.Audio.AudioDownmixMeta ret = Gst.Audio.AudioDownmixMeta.New (raw_ret);
348 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
349 static extern IntPtr gst_buffer_add_audio_meta(IntPtr buffer, IntPtr info, UIntPtr samples, UIntPtr offsets);
351 public static Gst.Audio.AudioMeta BufferAddAudioMeta(Gst.Buffer buffer, Gst.Audio.AudioInfo info, ulong samples, ulong offsets) {
352 IntPtr raw_ret = gst_buffer_add_audio_meta(buffer == null ? IntPtr.Zero : buffer.Handle, info == null ? IntPtr.Zero : info.Handle, new UIntPtr (samples), new UIntPtr (offsets));
353 Gst.Audio.AudioMeta ret = Gst.Audio.AudioMeta.New (raw_ret);
357 public static Gst.Audio.AudioMeta BufferAddAudioMeta(Gst.Buffer buffer, Gst.Audio.AudioInfo info, ulong samples) {
358 return BufferAddAudioMeta (buffer, info, samples, 0);
361 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
362 static extern IntPtr gst_buffer_get_audio_downmix_meta_for_channels(IntPtr buffer, int[] to_position, int to_channels);
364 public static Gst.Audio.AudioDownmixMeta BufferGetAudioDownmixMetaForChannels(Gst.Buffer buffer, Gst.Audio.AudioChannelPosition[] to_position, int to_channels) {
365 int cnt_to_position = to_position == null ? 0 : to_position.Length;
366 int[] native_to_position = new int [cnt_to_position];
367 for (int i = 0; i < cnt_to_position; i++)
368 native_to_position [i] = (int) to_position[i];
369 IntPtr raw_ret = gst_buffer_get_audio_downmix_meta_for_channels(buffer == null ? IntPtr.Zero : buffer.Handle, native_to_position, to_channels);
370 Gst.Audio.AudioDownmixMeta ret = Gst.Audio.AudioDownmixMeta.New (raw_ret);
374 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
375 static extern double gst_stream_volume_convert_volume(int from, int to, double val);
377 public static double StreamVolumeConvertVolume(Gst.Audio.StreamVolumeFormat from, Gst.Audio.StreamVolumeFormat to, double val) {
378 double raw_ret = gst_stream_volume_convert_volume((int) from, (int) to, val);
379 double ret = raw_ret;