2 * Copyright (C) <2008> Wim Taymans <wim.taymans@gmail.com>
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.
23 #include <gst/audio/audio.h>
25 #ifndef __GST_RTP_CHANNELS_H__
26 #define __GST_RTP_CHANNELS_H__
32 const GstAudioChannelPosition *pos;
35 static const GstAudioChannelPosition pos_4_1[] = {
36 GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
37 GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT,
38 GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT,
39 GST_AUDIO_CHANNEL_POSITION_SIDE_RIGHT
42 static const GstAudioChannelPosition pos_4_2[] = {
43 GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
44 GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT,
45 GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER,
46 GST_AUDIO_CHANNEL_POSITION_LFE1
49 static const GstAudioChannelPosition pos_4_3[] = {
50 GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
51 GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT,
52 GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER,
53 GST_AUDIO_CHANNEL_POSITION_LFE1
56 static const GstAudioChannelPosition pos_5_1[] = {
57 GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
58 GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT,
59 GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT,
60 GST_AUDIO_CHANNEL_POSITION_SIDE_RIGHT,
61 GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER
64 static const GstAudioChannelPosition pos_6_1[] = {
65 GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
66 GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT,
67 GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT,
68 GST_AUDIO_CHANNEL_POSITION_SIDE_RIGHT,
69 GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER,
70 GST_AUDIO_CHANNEL_POSITION_LFE1
73 static const GstAudioChannelPosition pos_6_2[] = {
74 GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
75 GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT,
76 GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER,
77 GST_AUDIO_CHANNEL_POSITION_LFE1,
78 GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT,
79 GST_AUDIO_CHANNEL_POSITION_SIDE_RIGHT
82 static const GstAudioChannelPosition pos_8_1[] = {
83 GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
84 GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT,
85 GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER,
86 GST_AUDIO_CHANNEL_POSITION_LFE1,
87 GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT,
88 GST_AUDIO_CHANNEL_POSITION_SIDE_RIGHT,
89 GST_AUDIO_CHANNEL_POSITION_REAR_LEFT,
90 GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT
93 static const GstAudioChannelPosition pos_8_2[] = {
94 GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
95 GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT,
96 GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER,
97 GST_AUDIO_CHANNEL_POSITION_LFE1,
98 GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT,
99 GST_AUDIO_CHANNEL_POSITION_SIDE_RIGHT,
100 GST_AUDIO_CHANNEL_POSITION_REAR_LEFT,
101 GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT
104 static const GstAudioChannelPosition pos_8_3[] = {
105 GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
106 GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT,
107 GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER,
108 GST_AUDIO_CHANNEL_POSITION_LFE1,
109 GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT,
110 GST_AUDIO_CHANNEL_POSITION_SIDE_RIGHT,
111 GST_AUDIO_CHANNEL_POSITION_REAR_LEFT,
112 GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT
115 static const GstAudioChannelPosition pos_def_1[] = {
116 GST_AUDIO_CHANNEL_POSITION_MONO
119 static const GstAudioChannelPosition pos_def_2[] = {
120 GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
121 GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT
124 static const GstAudioChannelPosition pos_def_3[] = {
125 GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
126 GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT,
127 GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER
130 static const GstAudioChannelPosition pos_def_4[] = {
131 GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
132 GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER,
133 GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT,
134 GST_AUDIO_CHANNEL_POSITION_LFE1
137 static const GstAudioChannelPosition pos_def_5[] = {
138 GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
139 GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT,
140 GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER,
141 GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT,
142 GST_AUDIO_CHANNEL_POSITION_SIDE_RIGHT
145 static const GstAudioChannelPosition pos_def_6[] = {
146 GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT,
147 GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
148 GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER,
149 GST_AUDIO_CHANNEL_POSITION_SIDE_RIGHT,
150 GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT,
151 GST_AUDIO_CHANNEL_POSITION_LFE1
154 static const GstRTPChannelOrder channel_orders[] =
157 { "DV.LRLsRs", 4, pos_4_1 },
158 { "DV.LRCS", 4, pos_4_2 },
159 { "DV.LRCWo", 4, pos_4_3 },
161 { "DV.LRLsRsC", 5, pos_5_1 },
163 { "DV.LRLsRsCS", 6, pos_6_1 },
164 { "DV.LmixRmixTWoQ1Q2", 6, pos_6_2 },
166 { "DV.LRCWoLsRsLmixRmix", 8, pos_8_1 },
167 { "DV.LRCWoLs1Rs1Ls2Rs2", 8, pos_8_2 },
168 { "DV.LRCWoLsRsLcRc", 8, pos_8_3 },
170 /* default layouts */
171 { NULL, 1, pos_def_1 },
172 { NULL, 2, pos_def_2 },
173 { NULL, 3, pos_def_3 },
174 { NULL, 4, pos_def_4 },
175 { NULL, 5, pos_def_5 },
176 { NULL, 6, pos_def_6 },
178 /* terminator, invalid entry */
182 const GstRTPChannelOrder * gst_rtp_channels_get_by_pos (gint channels,
183 const GstAudioChannelPosition *pos);
184 const GstRTPChannelOrder * gst_rtp_channels_get_by_order (gint channels,
186 const GstRTPChannelOrder * gst_rtp_channels_get_by_index (gint channels, guint idx);
188 void gst_rtp_channels_create_default (gint channels, GstAudioChannelPosition *pos);
190 #endif /* __GST_RTP_CHANNELS_H__ */