|
1 /* GStreamer Multichannel-Audio helper functions |
|
2 * (c) 2004 Ronald Bultje <rbultje@ronald.bitfreak.net> |
|
3 * |
|
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. |
|
8 * |
|
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. |
|
13 * |
|
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. |
|
18 */ |
|
19 |
|
20 #ifndef __GST_AUDIO_MULTICHANNEL_H__ |
|
21 #define __GST_AUDIO_MULTICHANNEL_H__ |
|
22 |
|
23 #include <gst/audio/audio.h> |
|
24 #include <gst/audio/multichannel-enumtypes.h> |
|
25 |
|
26 G_BEGIN_DECLS |
|
27 |
|
28 typedef enum { |
|
29 GST_AUDIO_CHANNEL_POSITION_INVALID = -1, |
|
30 |
|
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, |
|
35 |
|
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, |
|
40 |
|
41 /* subwoofer/low-frequency */ |
|
42 GST_AUDIO_CHANNEL_POSITION_LFE, |
|
43 |
|
44 /* Center front speakers. Center and left/right_of_center cannot be |
|
45 * used together! */ |
|
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, |
|
49 |
|
50 /* sides */ |
|
51 GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT, |
|
52 GST_AUDIO_CHANNEL_POSITION_SIDE_RIGHT, |
|
53 |
|
54 /* for multi-channel input and output with more than 8 channels, |
|
55 * incompatible with all other positions, either all positions |
|
56 * are defined or all positions are undefined, but can't mix'n'match */ |
|
57 GST_AUDIO_CHANNEL_POSITION_NONE, |
|
58 |
|
59 /* don't use - counter */ |
|
60 GST_AUDIO_CHANNEL_POSITION_NUM |
|
61 } GstAudioChannelPosition; |
|
62 |
|
63 /* Retrieves or sets the positions from/to a GstStructure. Only |
|
64 * works with fixed caps, caller should check for that! Caller |
|
65 * g_free()s result of the getter. */ |
|
66 #ifdef __SYMBIAN32__ |
|
67 IMPORT_C |
|
68 #endif |
|
69 |
|
70 GstAudioChannelPosition * |
|
71 gst_audio_get_channel_positions (GstStructure *str); |
|
72 #ifdef __SYMBIAN32__ |
|
73 IMPORT_C |
|
74 #endif |
|
75 |
|
76 void gst_audio_set_channel_positions (GstStructure *str, |
|
77 const GstAudioChannelPosition *pos); |
|
78 |
|
79 /* Sets a (non-fixed) list of possible audio channel positions |
|
80 * on a structure (this requires the "channels" property to |
|
81 * be fixed!) or on a caps (here, the "channels" property may be |
|
82 * unfixed and the caps may even contain multiple structures). */ |
|
83 #ifdef __SYMBIAN32__ |
|
84 IMPORT_C |
|
85 #endif |
|
86 |
|
87 void gst_audio_set_structure_channel_positions_list |
|
88 (GstStructure *str, |
|
89 const GstAudioChannelPosition *pos, |
|
90 gint num_positions); |
|
91 #ifdef __SYMBIAN32__ |
|
92 IMPORT_C |
|
93 #endif |
|
94 |
|
95 void gst_audio_set_caps_channel_positions_list |
|
96 (GstCaps *caps, |
|
97 const GstAudioChannelPosition *pos, |
|
98 gint num_positions); |
|
99 |
|
100 /* Custom fixate function. Elements that implement some sort of |
|
101 * channel conversion algorhithm should use this function for |
|
102 * fixating on GstAudioChannelPosition properties. It will take |
|
103 * care of equal channel positioning (left/right). Caller g_free()s |
|
104 * the return value. The input properties may be (and are supposed |
|
105 * to be) unfixed. */ |
|
106 #ifdef __SYMBIAN32__ |
|
107 IMPORT_C |
|
108 #endif |
|
109 |
|
110 GstAudioChannelPosition * |
|
111 gst_audio_fixate_channel_positions (GstStructure *str); |
|
112 |
|
113 G_END_DECLS |
|
114 |
|
115 #endif /* __GST_AUDIO_MULTICHANNEL_H__ */ |