PipeWire: spa/param/audio/layout.h Source File

PipeWire 1.6.5

Loading...
Searching...
No Matches
layout.h
Go to the documentation of this file.
1/* Simple Plugin API */
2/* SPDX-FileCopyrightText: Copyright © 2018 Wim Taymans */
3/* SPDX-License-Identifier: MIT */
4
5#ifndef SPA_AUDIO_LAYOUT_H
6#define SPA_AUDIO_LAYOUT_H
7
8#include <spa/utils/endian.h>
9
10#include <spa/param/audio/raw.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
20
21struct spa_audio_layout_info {
22 uint32_t n_channels;
23 uint32_t position[SPA_AUDIO_MAX_CHANNELS];
24 /* padding may follow to allow more channels */
25};
26
27#define SPA_AUDIO_LAYOUT_INFO_MAX_POSITION(size) (((size)-offsetof(struct spa_audio_layout_info,position))/sizeof(uint32_t))
28
29#define SPA_AUDIO_LAYOUT_Mono 1, { SPA_AUDIO_CHANNEL_MONO, }
30#define SPA_AUDIO_LAYOUT_Stereo 2, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR, }
31#define SPA_AUDIO_LAYOUT_Quad 4, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR, \
32 SPA_AUDIO_CHANNEL_RL, SPA_AUDIO_CHANNEL_RR, }
33#define SPA_AUDIO_LAYOUT_Pentagonal 5, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR, \
34 SPA_AUDIO_CHANNEL_RL, SPA_AUDIO_CHANNEL_RR, \
35 SPA_AUDIO_CHANNEL_FC, }
36#define SPA_AUDIO_LAYOUT_Hexagonal 6, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR, \
37 SPA_AUDIO_CHANNEL_RL, SPA_AUDIO_CHANNEL_RR, \
38 SPA_AUDIO_CHANNEL_FC, SPA_AUDIO_CHANNEL_RC, }
39#define SPA_AUDIO_LAYOUT_Octagonal 8, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR, \
40 SPA_AUDIO_CHANNEL_RL, SPA_AUDIO_CHANNEL_RR, \
41 SPA_AUDIO_CHANNEL_FC, SPA_AUDIO_CHANNEL_RC, \
42 SPA_AUDIO_CHANNEL_SL, SPA_AUDIO_CHANNEL_SR, }
43#define SPA_AUDIO_LAYOUT_Cube 8, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR, \
44 SPA_AUDIO_CHANNEL_RL, SPA_AUDIO_CHANNEL_RR, \
45 SPA_AUDIO_CHANNEL_TFL, SPA_AUDIO_CHANNEL_TFR, \
46 SPA_AUDIO_CHANNEL_TRL, SPA_AUDIO_CHANNEL_TRR, }
47
48
49#define SPA_AUDIO_LAYOUT_MPEG_1_0 SPA_AUDIO_LAYOUT_Mono
50#define SPA_AUDIO_LAYOUT_MPEG_2_0 SPA_AUDIO_LAYOUT_Stereo
51#define SPA_AUDIO_LAYOUT_MPEG_3_0A 3, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR, \
52 SPA_AUDIO_CHANNEL_FC, }
53#define SPA_AUDIO_LAYOUT_MPEG_3_0B 3, { SPA_AUDIO_CHANNEL_FC, SPA_AUDIO_CHANNEL_FL, \
54 SPA_AUDIO_CHANNEL_FR, }
55#define SPA_AUDIO_LAYOUT_MPEG_4_0A 4, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR, \
56 SPA_AUDIO_CHANNEL_FC, SPA_AUDIO_CHANNEL_RC, }
57#define SPA_AUDIO_LAYOUT_MPEG_4_0B 4, { SPA_AUDIO_CHANNEL_FC, SPA_AUDIO_CHANNEL_FL, \
58 SPA_AUDIO_CHANNEL_FR, SPA_AUDIO_CHANNEL_RC, }
59#define SPA_AUDIO_LAYOUT_MPEG_5_0A 5, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR, \
60 SPA_AUDIO_CHANNEL_FC, SPA_AUDIO_CHANNEL_SL, \
61 SPA_AUDIO_CHANNEL_SR, }
62#define SPA_AUDIO_LAYOUT_MPEG_5_0B 5, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR, \
63 SPA_AUDIO_CHANNEL_SL, SPA_AUDIO_CHANNEL_SR, \
64 SPA_AUDIO_CHANNEL_FC, }
65#define SPA_AUDIO_LAYOUT_MPEG_5_0C 5, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FC, \
66 SPA_AUDIO_CHANNEL_FR, SPA_AUDIO_CHANNEL_SL, \
67 SPA_AUDIO_CHANNEL_SR, }
68#define SPA_AUDIO_LAYOUT_MPEG_5_0D 5, { SPA_AUDIO_CHANNEL_FC, SPA_AUDIO_CHANNEL_FL, \
69 SPA_AUDIO_CHANNEL_FR, SPA_AUDIO_CHANNEL_SL, \
70 SPA_AUDIO_CHANNEL_SR, }
71#define SPA_AUDIO_LAYOUT_MPEG_5_1A 6, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR, \
72 SPA_AUDIO_CHANNEL_FC, SPA_AUDIO_CHANNEL_LFE, \
73 SPA_AUDIO_CHANNEL_SL, SPA_AUDIO_CHANNEL_SR, }
74#define SPA_AUDIO_LAYOUT_MPEG_5_1B 6, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR, \
75 SPA_AUDIO_CHANNEL_SL, SPA_AUDIO_CHANNEL_SR, \
76 SPA_AUDIO_CHANNEL_FC, SPA_AUDIO_CHANNEL_LFE, }
77#define SPA_AUDIO_LAYOUT_MPEG_5_1C 6, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FC, \
78 SPA_AUDIO_CHANNEL_FR, SPA_AUDIO_CHANNEL_SL, \
79 SPA_AUDIO_CHANNEL_SR, SPA_AUDIO_CHANNEL_LFE, }
80#define SPA_AUDIO_LAYOUT_MPEG_5_1D 6, { SPA_AUDIO_CHANNEL_FC, SPA_AUDIO_CHANNEL_FL, \
81 SPA_AUDIO_CHANNEL_FR, SPA_AUDIO_CHANNEL_SL, \
82 SPA_AUDIO_CHANNEL_SR, SPA_AUDIO_CHANNEL_LFE, }
83#define SPA_AUDIO_LAYOUT_MPEG_6_1A 7, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR, \
84 SPA_AUDIO_CHANNEL_FC, SPA_AUDIO_CHANNEL_LFE, \
85 SPA_AUDIO_CHANNEL_SL, SPA_AUDIO_CHANNEL_SR, \
86 SPA_AUDIO_CHANNEL_RC, }
87#define SPA_AUDIO_LAYOUT_MPEG_7_1A 8, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR, \
88 SPA_AUDIO_CHANNEL_FC, SPA_AUDIO_CHANNEL_LFE, \
89 SPA_AUDIO_CHANNEL_RL, SPA_AUDIO_CHANNEL_RR, \
90 SPA_AUDIO_CHANNEL_SL, SPA_AUDIO_CHANNEL_SR, }
91#define SPA_AUDIO_LAYOUT_MPEG_7_1B 8, { SPA_AUDIO_CHANNEL_FC, SPA_AUDIO_CHANNEL_SL, \
92 SPA_AUDIO_CHANNEL_SR, SPA_AUDIO_CHANNEL_FL, \
93 SPA_AUDIO_CHANNEL_FR, SPA_AUDIO_CHANNEL_RL, \
94 SPA_AUDIO_CHANNEL_RR, SPA_AUDIO_CHANNEL_LFE, }
95#define SPA_AUDIO_LAYOUT_MPEG_7_1C 8, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR, \
96 SPA_AUDIO_CHANNEL_FC, SPA_AUDIO_CHANNEL_LFE, \
97 SPA_AUDIO_CHANNEL_SL, SPA_AUDIO_CHANNEL_SR, \
98 SPA_AUDIO_CHANNEL_RL, SPA_AUDIO_CHANNEL_RR, }
99
100
101#define SPA_AUDIO_LAYOUT_2_1 3, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR, \
102 SPA_AUDIO_CHANNEL_LFE, }
103
104#define SPA_AUDIO_LAYOUT_2RC 3, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR, \
105 SPA_AUDIO_CHANNEL_RC, }
106#define SPA_AUDIO_LAYOUT_2FC 3, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR, \
107 SPA_AUDIO_CHANNEL_FC, }
108
109#define SPA_AUDIO_LAYOUT_3_1 4, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR, \
110 SPA_AUDIO_CHANNEL_FC, SPA_AUDIO_CHANNEL_LFE, }
111#define SPA_AUDIO_LAYOUT_4_0 4, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR, \
112 SPA_AUDIO_CHANNEL_FC, SPA_AUDIO_CHANNEL_RC, }
113#define SPA_AUDIO_LAYOUT_2_2 4, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR, \
114 SPA_AUDIO_CHANNEL_SL, SPA_AUDIO_CHANNEL_SR, }
115
116#define SPA_AUDIO_LAYOUT_4_1 5, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR, \
117 SPA_AUDIO_CHANNEL_FC, SPA_AUDIO_CHANNEL_LFE, \
118 SPA_AUDIO_CHANNEL_RC, }
119#define SPA_AUDIO_LAYOUT_5_0 5, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR, \
120 SPA_AUDIO_CHANNEL_FC, SPA_AUDIO_CHANNEL_SL, \
121 SPA_AUDIO_CHANNEL_SR, }
122#define SPA_AUDIO_LAYOUT_5_0R 5, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR, \
123 SPA_AUDIO_CHANNEL_FC, SPA_AUDIO_CHANNEL_RL, \
124 SPA_AUDIO_CHANNEL_RR, }
125#define SPA_AUDIO_LAYOUT_5_1 6, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR, \
126 SPA_AUDIO_CHANNEL_FC, SPA_AUDIO_CHANNEL_LFE, \
127 SPA_AUDIO_CHANNEL_SL, SPA_AUDIO_CHANNEL_SR, }
128#define SPA_AUDIO_LAYOUT_5_1R 6, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR, \
129 SPA_AUDIO_CHANNEL_FC, SPA_AUDIO_CHANNEL_LFE, \
130 SPA_AUDIO_CHANNEL_RL, SPA_AUDIO_CHANNEL_RR, }
131#define SPA_AUDIO_LAYOUT_6_0 6, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR, \
132 SPA_AUDIO_CHANNEL_FC, SPA_AUDIO_CHANNEL_RC, \
133 SPA_AUDIO_CHANNEL_SL, SPA_AUDIO_CHANNEL_SR, }
134#define SPA_AUDIO_LAYOUT_6_0F 6, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR, \
135 SPA_AUDIO_CHANNEL_FLC, SPA_AUDIO_CHANNEL_FRC, \
136 SPA_AUDIO_CHANNEL_SL, SPA_AUDIO_CHANNEL_SR, }
137#define SPA_AUDIO_LAYOUT_6_1 7, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR, \
138 SPA_AUDIO_CHANNEL_FC, SPA_AUDIO_CHANNEL_LFE, \
139 SPA_AUDIO_CHANNEL_RC, SPA_AUDIO_CHANNEL_SL, \
140 SPA_AUDIO_CHANNEL_SR, }
141#define SPA_AUDIO_LAYOUT_6_1F 7, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR, \
142 SPA_AUDIO_CHANNEL_FC, SPA_AUDIO_CHANNEL_LFE, \
143 SPA_AUDIO_CHANNEL_RL, SPA_AUDIO_CHANNEL_RR, \
144 SPA_AUDIO_CHANNEL_RC, }
145#define SPA_AUDIO_LAYOUT_7_0 7, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR, \
146 SPA_AUDIO_CHANNEL_FC, SPA_AUDIO_CHANNEL_RL, \
147 SPA_AUDIO_CHANNEL_RR, SPA_AUDIO_CHANNEL_SL, \
148 SPA_AUDIO_CHANNEL_SR, }
149#define SPA_AUDIO_LAYOUT_7_0F 7, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR, \
150 SPA_AUDIO_CHANNEL_FC, SPA_AUDIO_CHANNEL_FLC, \
151 SPA_AUDIO_CHANNEL_FRC, SPA_AUDIO_CHANNEL_SL, \
152 SPA_AUDIO_CHANNEL_SR, }
153#define SPA_AUDIO_LAYOUT_7_1 8, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR, \
154 SPA_AUDIO_CHANNEL_FC, SPA_AUDIO_CHANNEL_LFE, \
155 SPA_AUDIO_CHANNEL_RL, SPA_AUDIO_CHANNEL_RR, \
156 SPA_AUDIO_CHANNEL_SL, SPA_AUDIO_CHANNEL_SR, }
157#define SPA_AUDIO_LAYOUT_7_1W 8, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR, \
158 SPA_AUDIO_CHANNEL_FC, SPA_AUDIO_CHANNEL_LFE, \
159 SPA_AUDIO_CHANNEL_FLC, SPA_AUDIO_CHANNEL_FRC, \
160 SPA_AUDIO_CHANNEL_SL, SPA_AUDIO_CHANNEL_SR, }
161#define SPA_AUDIO_LAYOUT_7_1WR 8, { SPA_AUDIO_CHANNEL_FL, SPA_AUDIO_CHANNEL_FR, \
162 SPA_AUDIO_CHANNEL_FC, SPA_AUDIO_CHANNEL_LFE, \
163 SPA_AUDIO_CHANNEL_RL, SPA_AUDIO_CHANNEL_RR, \
164 SPA_AUDIO_CHANNEL_FLC, SPA_AUDIO_CHANNEL_FRC, }
165
167
167 * \}
168 */
169
170#ifdef __cplusplus
171} /* extern "C" */
172#endif
173
174#endif /* SPA_AUDIO_LAYOUT_H */
raw.h
spa/param/audio/raw.h
SPA_AUDIO_MAX_CHANNELS
#define SPA_AUDIO_MAX_CHANNELS
Definition raw.h:30
spa_audio_layout_info
Definition layout.h:26
spa_audio_layout_info::position
uint32_t position[SPA_AUDIO_MAX_CHANNELS]
Definition layout.h:28
spa_audio_layout_info::n_channels
uint32_t n_channels
Definition layout.h:27