PipeWire  0.3.29
audio/raw.h
Go to the documentation of this file.
1 /* Simple Plugin API
2  *
3  * Copyright © 2018 Wim Taymans
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice (including the next
13  * paragraph) shall be included in all copies or substantial portions of the
14  * Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  * DEALINGS IN THE SOFTWARE.
23  */
24 
25 #ifndef SPA_AUDIO_RAW_H
26 #define SPA_AUDIO_RAW_H
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 #include <stdint.h>
33 
34 #ifndef __FreeBSD__
35 #include <endian.h>
36 #endif
37 
43 #define SPA_AUDIO_MAX_CHANNELS 64u
44 
48 
49  /* interleaved formats */
81 
82  /* planar formats */
92 
93  /* other formats start here */
95 
96  /* Aliases */
97 
98  /* DSP formats */
102 
103  /* native endian */
104 #if __BYTE_ORDER == __BIG_ENDIAN
133 #elif __BYTE_ORDER == __LITTLE_ENDIAN
162 #endif
163 };
164 
165 #define SPA_AUDIO_FORMAT_IS_INTERLEAVED(fmt) ((fmt) > SPA_AUDIO_FORMAT_START_Interleaved && (fmt) < SPA_AUDIO_FORMAT_START_Planar)
166 #define SPA_AUDIO_FORMAT_IS_PLANAR(fmt) ((fmt) > SPA_AUDIO_FORMAT_START_Planar && (fmt) < SPA_AUDIO_FORMAT_START_Other)
167 
211 };
212 
214 #define SPA_AUDIO_FLAG_NONE (0) /*< no valid flag */
215 #define SPA_AUDIO_FLAG_UNPOSITIONED (1 << 0) /*< the position array explicitly
216  * contains unpositioned channels. */
217 
219  enum spa_audio_format format; /*< format, one of enum spa_audio_format */
220  uint32_t flags; /*< extra flags */
221  uint32_t rate; /*< sample rate */
222  uint32_t channels; /*< number of channels */
223  uint32_t position[SPA_AUDIO_MAX_CHANNELS]; /*< channel position from enum spa_audio_channel */
224 };
225 
226 #define SPA_AUDIO_INFO_RAW_INIT(...) (struct spa_audio_info_raw) { __VA_ARGS__ }
227 
228 #define SPA_KEY_AUDIO_FORMAT "audio.format"
230 #define SPA_KEY_AUDIO_CHANNEL "audio.channel"
232 #define SPA_KEY_AUDIO_CHANNELS "audio.channels"
233 #define SPA_KEY_AUDIO_RATE "audio.rate"
234 #define SPA_KEY_AUDIO_POSITION "audio.position"
237 struct spa_audio_info_dsp {
238  enum spa_audio_format format; /*< format, one of the DSP formats in enum spa_audio_format_dsp */
239 };
241 #define SPA_AUDIO_INFO_DSP_INIT(...) (struct spa_audio_info_dsp) { __VA_ARGS__ }
242 
247 #ifdef __cplusplus
248 } /* extern "C" */
249 #endif
250 
251 #endif /* SPA_AUDIO_RAW_H */
Definition: audio/raw.h:89
front left wide
Definition: audio/raw.h:194
top front right
Definition: audio/raw.h:188
Definition: audio/raw.h:67
front left high
Definition: audio/raw.h:197
top rear left
Definition: audio/raw.h:189
Definition: audio/raw.h:126
Definition: audio/raw.h:115
Definition: audio/raw.h:125
Definition: audio/raw.h:75
bottom center
Definition: audio/raw.h:206
Definition: audio/raw.h:99
top front center
Definition: audio/raw.h:187
top front left
Definition: audio/raw.h:186
Definition: audio/raw.h:74
top center
Definition: audio/raw.h:185
Definition: audio/raw.h:114
Definition: audio/raw.h:91
Audio information description.
Definition: audio/raw.h:218
Definition: audio/raw.h:132
Definition: audio/raw.h:210
spa_audio_format
Definition: audio/raw.h:45
Definition: audio/raw.h:87
Definition: audio/raw.h:129
uint32_t rate
Definition: audio/raw.h:221
Definition: audio/raw.h:54
top front right center
Definition: audio/raw.h:201
enum spa_audio_format format
Definition: audio/raw.h:219
front center high
Definition: audio/raw.h:198
front right wide
Definition: audio/raw.h:195
Definition: audio/raw.h:130
Definition: audio/raw.h:62
Definition: audio/raw.h:63
Definition: audio/raw.h:100
Definition: audio/raw.h:94
rear right
Definition: audio/raw.h:184
mono stream
Definition: audio/raw.h:172
Definition: audio/raw.h:68
LFE.
Definition: audio/raw.h:177
Definition: audio/raw.h:80
N/A, silent.
Definition: audio/raw.h:170
left LFE
Definition: audio/raw.h:204
Definition: audio/raw.h:52
Definition: audio/raw.h:58
Definition: audio/raw.h:127
#define SPA_AUDIO_MAX_CHANNELS
Definition: audio/raw.h:43
Definition: audio/raw.h:47
Definition: audio/raw.h:77
Definition: audio/raw.h:106
spa_audio_channel
Definition: audio/raw.h:168
uint32_t flags
Definition: audio/raw.h:220
Definition: audio/raw.h:121
Definition: audio/raw.h:60
Definition: audio/raw.h:50
Definition: audio/raw.h:124
Definition: audio/raw.h:108
Definition: audio/raw.h:111
Definition: audio/raw.h:66
top side left
Definition: audio/raw.h:202
Definition: audio/raw.h:61
rear right center
Definition: audio/raw.h:193
Definition: audio/raw.h:70
Definition: audio/raw.h:78
front left center
Definition: audio/raw.h:180
Definition: audio/raw.h:90
bottom left center
Definition: audio/raw.h:207
Definition: audio/raw.h:105
Definition: audio/raw.h:56
Definition: audio/raw.h:55
Definition: audio/raw.h:107
Definition: audio/raw.h:116
uint32_t position[SPA_AUDIO_MAX_CHANNELS]
Definition: audio/raw.h:223
Definition: audio/raw.h:71
Definition: audio/raw.h:46
rear left center
Definition: audio/raw.h:192
Definition: audio/raw.h:88
Definition: audio/raw.h:79
Definition: audio/raw.h:118
Definition: audio/raw.h:83
Definition: audio/raw.h:101
LFE 2.
Definition: audio/raw.h:196
rear center
Definition: audio/raw.h:182
top rear center
Definition: audio/raw.h:190
front left
Definition: audio/raw.h:174
Definition: audio/raw.h:117
bottom right center
Definition: audio/raw.h:208
Definition: audio/raw.h:122
Definition: audio/raw.h:57
Definition: audio/raw.h:51
top side right
Definition: audio/raw.h:203
Definition: audio/raw.h:131
side right
Definition: audio/raw.h:179
Definition: audio/raw.h:123
unspecified
Definition: audio/raw.h:169
Definition: audio/raw.h:110
front right high
Definition: audio/raw.h:199
front right center
Definition: audio/raw.h:181
Definition: audio/raw.h:64
rear left
Definition: audio/raw.h:183
Definition: audio/raw.h:59
Definition: audio/raw.h:65
Definition: audio/raw.h:128
Definition: audio/raw.h:119
Definition: audio/raw.h:73
Definition: audio/raw.h:69
top front left center
Definition: audio/raw.h:200
front center
Definition: audio/raw.h:176
front right
Definition: audio/raw.h:175
Definition: audio/raw.h:86
Definition: audio/raw.h:120
top rear right
Definition: audio/raw.h:191
Definition: audio/raw.h:72
Definition: audio/raw.h:113
Definition: audio/raw.h:109
Definition: audio/raw.h:112
right LFE
Definition: audio/raw.h:205
side left
Definition: audio/raw.h:178
Definition: audio/raw.h:85
Definition: audio/raw.h:84
uint32_t channels
Definition: audio/raw.h:222
Definition: audio/raw.h:76
Definition: audio/raw.h:53