audio-channel-mixer.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* GStreamer
  2. * Copyright (C) 2004 Ronald Bultje <rbultje@ronald.bitfreak.net>
  3. * (C) 2015 Wim Taymans <wim.taymans@gmail.com>
  4. *
  5. * audio-channel-mixer.h: setup of channel conversion matrices
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Library General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Library General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Library General Public
  18. * License along with this library; if not, write to the
  19. * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
  20. * Boston, MA 02110-1301, USA.
  21. */
  22. #ifndef __GST_AUDIO_CHANNEL_MIXER_H__
  23. #define __GST_AUDIO_CHANNEL_MIXER_H__
  24. #include <gst/gst.h>
  25. #include <gst/audio/audio.h>
  26. typedef struct _GstAudioChannelMixer GstAudioChannelMixer;
  27. /**
  28. * GstAudioChannelMixerFlags:
  29. * @GST_AUDIO_CHANNEL_MIXER_FLAGS_NONE: no flag
  30. * @GST_AUDIO_CHANNEL_MIXER_FLAGS_NON_INTERLEAVED_IN: input channels are not interleaved
  31. * @GST_AUDIO_CHANNEL_MIXER_FLAGS_NON_INTERLEAVED_OUT: output channels are not interleaved
  32. * @GST_AUDIO_CHANNEL_MIXER_FLAGS_UNPOSITIONED_IN: input channels are explicitly unpositioned
  33. * @GST_AUDIO_CHANNEL_MIXER_FLAGS_UNPOSITIONED_OUT: output channels are explicitly unpositioned
  34. *
  35. * Flags passed to gst_audio_channel_mixer_new()
  36. */
  37. typedef enum {
  38. GST_AUDIO_CHANNEL_MIXER_FLAGS_NONE = 0,
  39. GST_AUDIO_CHANNEL_MIXER_FLAGS_NON_INTERLEAVED_IN = (1 << 0),
  40. GST_AUDIO_CHANNEL_MIXER_FLAGS_NON_INTERLEAVED_OUT = (1 << 1),
  41. GST_AUDIO_CHANNEL_MIXER_FLAGS_UNPOSITIONED_IN = (1 << 2),
  42. GST_AUDIO_CHANNEL_MIXER_FLAGS_UNPOSITIONED_OUT = (1 << 3)
  43. } GstAudioChannelMixerFlags;
  44. GstAudioChannelMixer * gst_audio_channel_mixer_new (GstAudioChannelMixerFlags flags,
  45. GstAudioFormat format,
  46. gint in_channels,
  47. GstAudioChannelPosition *in_position,
  48. gint out_channels,
  49. GstAudioChannelPosition *out_position);
  50. void gst_audio_channel_mixer_free (GstAudioChannelMixer *mix);
  51. /*
  52. * Checks for passthrough (= identity matrix).
  53. */
  54. gboolean gst_audio_channel_mixer_is_passthrough (GstAudioChannelMixer *mix);
  55. /*
  56. * Do actual mixing.
  57. */
  58. void gst_audio_channel_mixer_samples (GstAudioChannelMixer * mix,
  59. const gpointer in[],
  60. gpointer out[],
  61. gint samples);
  62. #endif /* __GST_AUDIO_CHANNEL_MIXER_H__ */