Ejemplo n.º 1
0
        public static string AudioFormatToString(Gst.Audio.AudioFormat format)
        {
            IntPtr raw_ret = gst_audio_format_to_string((int)format);
            string ret     = GLib.Marshaller.Utf8PtrToString(raw_ret);

            return(ret);
        }
Ejemplo n.º 2
0
        public static Gst.Audio.AudioFormatInfo AudioFormatGetInfo(Gst.Audio.AudioFormat format)
        {
            IntPtr raw_ret = gst_audio_format_get_info((int)format);

            Gst.Audio.AudioFormatInfo ret = Gst.Audio.AudioFormatInfo.New(raw_ret);
            return(ret);
        }
Ejemplo n.º 3
0
        public static Gst.Audio.AudioFormat AudioFormatBuildInteger(bool sign, int endianness, int width, int depth)
        {
            int raw_ret = gst_audio_format_build_integer(sign, endianness, width, depth);

            Gst.Audio.AudioFormat ret = (Gst.Audio.AudioFormat)raw_ret;
            return(ret);
        }
Ejemplo n.º 4
0
        public static Gst.Audio.AudioFormat AudioFormatFromString(string format)
        {
            IntPtr native_format = GLib.Marshaller.StringToPtrGStrdup(format);
            int    raw_ret       = gst_audio_format_from_string(native_format);

            Gst.Audio.AudioFormat ret = (Gst.Audio.AudioFormat)raw_ret;
            GLib.Marshaller.Free(native_format);
            return(ret);
        }
Ejemplo n.º 5
0
        public void SetFormat(Gst.Audio.AudioFormat format, int rate, int channels, Gst.Audio.AudioChannelPosition[] position)
        {
            int cnt_position = position == null ? 0 : position.Length;

            int[] native_position = new int [cnt_position];
            for (int i = 0; i < cnt_position; i++)
            {
                native_position [i] = (int)position[i];
            }
            gst_audio_info_set_format(Handle, (int)format, rate, channels, native_position);
        }
Ejemplo n.º 6
0
        public static bool ReorderChannels(Gst.Buffer buffer, Gst.Audio.AudioFormat format, int channels, Gst.Audio.AudioChannelPosition[] from, Gst.Audio.AudioChannelPosition[] to)
        {
            int cnt_from = from == null ? 0 : from.Length;

            int[] native_from = new int [cnt_from];
            for (int i = 0; i < cnt_from; i++)
            {
                native_from [i] = (int)from[i];
            }
            int cnt_to = to == null ? 0 : to.Length;

            int[] native_to = new int [cnt_to];
            for (int i = 0; i < cnt_to; i++)
            {
                native_to [i] = (int)to[i];
            }
            bool raw_ret = gst_audio_buffer_reorder_channels(buffer == null ? IntPtr.Zero : buffer.Handle, (int)format, channels, native_from, native_to);
            bool ret     = raw_ret;

            return(ret);
        }
Ejemplo n.º 7
0
        public static bool AudioReorderChannels(byte[] data, Gst.Audio.AudioFormat format, int channels, Gst.Audio.AudioChannelPosition[] from, Gst.Audio.AudioChannelPosition[] to)
        {
            int cnt_from = from == null ? 0 : from.Length;

            int[] native_from = new int [cnt_from];
            for (int i = 0; i < cnt_from; i++)
            {
                native_from [i] = (int)from[i];
            }
            int cnt_to = to == null ? 0 : to.Length;

            int[] native_to = new int [cnt_to];
            for (int i = 0; i < cnt_to; i++)
            {
                native_to [i] = (int)to[i];
            }
            bool raw_ret = gst_audio_reorder_channels(data, new UIntPtr((ulong)(data == null ? 0 : data.Length)), (int)format, channels, native_from, native_to);
            bool ret     = raw_ret;

            return(ret);
        }
Ejemplo n.º 8
0
 public void SetFormat(Gst.Audio.AudioFormat format, int rate, int channels)
 {
     SetFormat(format, rate, channels, null);
 }
Ejemplo n.º 9
0
        public static Gst.Audio.AudioResampler New(Gst.Audio.AudioResamplerMethod method, Gst.Audio.AudioResamplerFlags flags, Gst.Audio.AudioFormat format, int channels, int in_rate, int out_rate, Gst.Structure options)
        {
            IntPtr raw_ret = gst_audio_resampler_new((int)method, (int)flags, (int)format, channels, in_rate, out_rate, options == null ? IntPtr.Zero : options.Handle);

            Gst.Audio.AudioResampler ret = raw_ret == IntPtr.Zero ? null : (Gst.Audio.AudioResampler)GLib.Opaque.GetOpaque(raw_ret, typeof(Gst.Audio.AudioResampler), true);
            return(ret);
        }