mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-01 06:01:04 +00:00
3a0a2898af
Original commit message from CVS: * ext/a52dec/gsta52dec.c: (gst_a52dec_channels), (gst_a52dec_push), (gst_a52dec_reneg), (gst_a52dec_loop), (plugin_init): * ext/alsa/gstalsa.c: (gst_alsa_get_caps): * ext/alsa/gstalsaplugin.c: (plugin_init): * ext/dts/gstdtsdec.c: (gst_dtsdec_channels), (gst_dtsdec_renegotiate), (gst_dtsdec_loop), (plugin_init): * ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_chanpos_from_gst), (gst_faad_chanpos_to_gst), (gst_faad_sinkconnect), (gst_faad_srcgetcaps), (gst_faad_srcconnect), (gst_faad_chain), (gst_faad_change_state), (plugin_init): * ext/faad/gstfaad.h: * ext/vorbis/vorbis.c: (plugin_init): * ext/vorbis/vorbisdec.c: (vorbis_dec_chain): * gst-libs/gst/audio/Makefile.am: * gst-libs/gst/audio/audio.c: (plugin_init): * gst-libs/gst/audio/multichannel.c: (gst_audio_check_channel_positions), (gst_audio_get_channel_positions), (gst_audio_set_channel_positions), (gst_audio_set_structure_channel_positions_list), (add_list_to_struct), (gst_audio_set_caps_channel_positions_list), (gst_audio_fixate_channel_positions): * gst-libs/gst/audio/multichannel.h: * gst-libs/gst/audio/testchannels.c: (main): * gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_class_init), (gst_audio_convert_init), (gst_audio_convert_dispose), (gst_audio_convert_getcaps), (gst_audio_convert_parse_caps), (gst_audio_convert_link), (gst_audio_convert_fixate), (gst_audio_convert_channels): * gst/audioconvert/plugin.c: (plugin_init): Surround sound support.
86 lines
3.2 KiB
C
86 lines
3.2 KiB
C
/* GStreamer Multichannel-Audio helper functions
|
|
* (c) 2004 Ronald Bultje <rbultje@ronald.bitfreak.net>
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Library General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2 of the License, or (at your option) any later version.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Library General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Library General Public
|
|
* License along with this library; if not, write to the
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
* Boston, MA 02111-1307, USA.
|
|
*/
|
|
|
|
#ifndef __GST_AUDIO_MULTICHANNEL_H__
|
|
#define __GST_AUDIO_MULTICHANNEL_H__
|
|
|
|
#include <gst/audio/audio.h>
|
|
#include <gst/audio/multichannel-enumtypes.h>
|
|
|
|
typedef enum {
|
|
GST_AUDIO_CHANNEL_POSITION_INVALID = -1,
|
|
|
|
/* Main front speakers. Mono and left/right are mututally exclusive! */
|
|
GST_AUDIO_CHANNEL_POSITION_FRONT_MONO,
|
|
GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
|
|
GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT,
|
|
|
|
/* rear. Left/right and center are mututally exclusive! */
|
|
GST_AUDIO_CHANNEL_POSITION_REAR_CENTER,
|
|
GST_AUDIO_CHANNEL_POSITION_REAR_LEFT,
|
|
GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT,
|
|
|
|
/* subwoofer/low-frequency */
|
|
GST_AUDIO_CHANNEL_POSITION_LFE,
|
|
|
|
/* Center front speakers. Center and left/right_of_center cannot be
|
|
* used together! */
|
|
GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER,
|
|
GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER,
|
|
GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER,
|
|
|
|
/* sides */
|
|
GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT,
|
|
GST_AUDIO_CHANNEL_POSITION_SIDE_RIGHT,
|
|
|
|
/* don't use - counter */
|
|
GST_AUDIO_CHANNEL_POSITION_NUM
|
|
} GstAudioChannelPosition;
|
|
|
|
/* Retrieves or sets the positions from/to a GstStructure. Only
|
|
* works with fixed caps, caller should check for that! Caller
|
|
* g_free()s result of the getter. */
|
|
GstAudioChannelPosition *
|
|
gst_audio_get_channel_positions (GstStructure *str);
|
|
void gst_audio_set_channel_positions (GstStructure *str,
|
|
const GstAudioChannelPosition *pos);
|
|
|
|
/* Sets a (non-fixed) list of possible audio channel positions
|
|
* on a structure (this requires the "channels" property to
|
|
* be fixed!) or on a caps (here, the "channels" property may be
|
|
* unfixed and the caps may even contain multiple structures). */
|
|
void gst_audio_set_structure_channel_positions_list
|
|
(GstStructure *str,
|
|
const GstAudioChannelPosition *pos,
|
|
gint num_positions);
|
|
void gst_audio_set_caps_channel_positions_list
|
|
(GstCaps *caps,
|
|
const GstAudioChannelPosition *pos,
|
|
gint num_positions);
|
|
|
|
/* Custom fixate function. Elements that implement some sort of
|
|
* channel conversion algorhithm should use this function for
|
|
* fixating on GstAudioChannelPosition properties. It will take
|
|
* care of equal channel positioning (left/right). Caller g_free()s
|
|
* the return value. The input properties may be (and are supposed
|
|
* to be) unfixed. */
|
|
GstAudioChannelPosition *
|
|
gst_audio_fixate_channel_positions (GstStructure *str);
|
|
|
|
#endif /* __GST_AUDIO_MULTICHANNEL_H__ */
|