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