1 /* GStreamer Multichannel-Audio helper functions
2 * (c) 2004 Ronald Bultje <rbultje@ronald.bitfreak.net>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
20 #ifndef __GST_AUDIO_MULTICHANNEL_H__
21 #define __GST_AUDIO_MULTICHANNEL_H__
23 #include <gst/audio/audio.h>
24 #include <gst/audio/multichannel-enumtypes.h>
29 GST_AUDIO_CHANNEL_POSITION_INVALID = -1,
31 /* Main front speakers. Mono and left/right are mututally exclusive! */
32 GST_AUDIO_CHANNEL_POSITION_FRONT_MONO,
33 GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
34 GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT,
36 /* rear. Left/right and center are mututally exclusive! */
37 GST_AUDIO_CHANNEL_POSITION_REAR_CENTER,
38 GST_AUDIO_CHANNEL_POSITION_REAR_LEFT,
39 GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT,
41 /* subwoofer/low-frequency */
42 GST_AUDIO_CHANNEL_POSITION_LFE,
44 /* Center front speakers. Center and left/right_of_center cannot be
46 GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER,
47 GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER,
48 GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER,
51 GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT,
52 GST_AUDIO_CHANNEL_POSITION_SIDE_RIGHT,
54 /* don't use - counter */
55 GST_AUDIO_CHANNEL_POSITION_NUM
56 } GstAudioChannelPosition;
58 /* Retrieves or sets the positions from/to a GstStructure. Only
59 * works with fixed caps, caller should check for that! Caller
60 * g_free()s result of the getter. */
61 GstAudioChannelPosition *
62 gst_audio_get_channel_positions (GstStructure *str);
63 void gst_audio_set_channel_positions (GstStructure *str,
64 const GstAudioChannelPosition *pos);
66 /* Sets a (non-fixed) list of possible audio channel positions
67 * on a structure (this requires the "channels" property to
68 * be fixed!) or on a caps (here, the "channels" property may be
69 * unfixed and the caps may even contain multiple structures). */
70 void gst_audio_set_structure_channel_positions_list
72 const GstAudioChannelPosition *pos,
74 void gst_audio_set_caps_channel_positions_list
76 const GstAudioChannelPosition *pos,
79 /* Custom fixate function. Elements that implement some sort of
80 * channel conversion algorhithm should use this function for
81 * fixating on GstAudioChannelPosition properties. It will take
82 * care of equal channel positioning (left/right). Caller g_free()s
83 * the return value. The input properties may be (and are supposed
85 GstAudioChannelPosition *
86 gst_audio_fixate_channel_positions (GstStructure *str);
90 #endif /* __GST_AUDIO_MULTICHANNEL_H__ */