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

PipeWire 1.4.7

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