FFmpeg
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
Functions
Variables
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
Data Fields
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
c
d
g
h
i
o
q
r
s
v
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
Enumerator
a
d
e
f
h
i
j
l
m
n
p
r
s
v
Files
File List
Globals
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
l
m
o
p
q
r
s
t
u
v
w
x
y
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
libavfilter
tests
formats.c
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2007 Bobby Bingham
3
*
4
* This file is part of FFmpeg.
5
*
6
* FFmpeg is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public
8
* License as published by the Free Software Foundation; either
9
* version 2.1 of the License, or (at your option) any later version.
10
*
11
* FFmpeg is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
15
*
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with FFmpeg; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
*/
20
21
#include "
libavutil/channel_layout.h
"
22
#include "
libavfilter/formats.c
"
23
24
#undef printf
25
26
const
int64_t
avfilter_all_channel_layouts
[] = {
27
AV_CH_FRONT_CENTER
,
28
AV_CH_FRONT_CENTER
|
AV_CH_LOW_FREQUENCY
,
29
AV_CH_FRONT_LEFT
|
AV_CH_FRONT_RIGHT
,
30
AV_CH_FRONT_LEFT
|
AV_CH_FRONT_RIGHT
|
AV_CH_LOW_FREQUENCY
,
31
AV_CH_FRONT_LEFT
|
AV_CH_FRONT_RIGHT
|
AV_CH_FRONT_CENTER
,
32
AV_CH_FRONT_LEFT
|
AV_CH_FRONT_RIGHT
|
AV_CH_FRONT_CENTER
|
AV_CH_LOW_FREQUENCY
,
33
AV_CH_FRONT_CENTER
|
AV_CH_BACK_LEFT
|
AV_CH_BACK_RIGHT
,
34
AV_CH_FRONT_CENTER
|
AV_CH_LOW_FREQUENCY
|
AV_CH_BACK_LEFT
|
AV_CH_BACK_RIGHT
,
35
AV_CH_FRONT_LEFT
|
AV_CH_FRONT_RIGHT
|
AV_CH_BACK_LEFT
|
AV_CH_BACK_RIGHT
,
36
AV_CH_FRONT_LEFT
|
AV_CH_FRONT_RIGHT
|
AV_CH_LOW_FREQUENCY
|
AV_CH_BACK_LEFT
|
AV_CH_BACK_RIGHT
,
37
AV_CH_FRONT_LEFT
|
AV_CH_FRONT_RIGHT
|
AV_CH_FRONT_CENTER
|
AV_CH_BACK_LEFT
|
AV_CH_BACK_RIGHT
,
38
AV_CH_FRONT_LEFT
|
AV_CH_FRONT_RIGHT
|
AV_CH_FRONT_CENTER
|
AV_CH_LOW_FREQUENCY
|
AV_CH_BACK_LEFT
|
AV_CH_BACK_RIGHT
,
39
AV_CH_FRONT_CENTER
|
AV_CH_BACK_CENTER
,
40
AV_CH_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V_CH_LOW_FREQUENCY
|
AV_CH_BACK_LEFT
|
AV_CH_BACK_RIGHT
|
AV_CH_STEREO_LEFT
|
AV_CH_STEREO_RIGHT
,
73
AV_CH_FRONT_LEFT
|
AV_CH_FRONT_RIGHT
|
AV_CH_FRONT_CENTER
|
AV_CH_BACK_LEFT
|
AV_CH_BACK_RIGHT
|
AV_CH_STEREO_LEFT
|
AV_CH_STEREO_RIGHT
,
74
AV_CH_FRONT_LEFT
|
AV_CH_FRONT_RIGHT
|
AV_CH_FRONT_CENTER
|
AV_CH_LOW_FREQUENCY
|
AV_CH_BACK_LEFT
|
AV_CH_BACK_RIGHT
|
AV_CH_STEREO_LEFT
|
AV_CH_STEREO_RIGHT
,
75
AV_CH_FRONT_CENTER
|
AV_CH_BACK_CENTER
|
AV_CH_STEREO_LEFT
|
AV_CH_STEREO_RIGHT
,
76
AV_CH_FRONT_CENTER
|
AV_CH_LOW_FREQUENCY
|
AV_CH_BACK_CENTER
|
AV_CH_STEREO_LEFT
|
AV_CH_STEREO_RIGHT
,
77
AV_CH_FRONT_LEFT
|
AV_CH_FRONT_RIGHT
|
AV_CH_BACK_CENTER
|
AV_CH_STEREO_LEFT
|
AV_CH_STEREO_RIGHT
,
78
AV_CH_FRONT_LEFT
|
AV_CH_FRONT_RIGHT
|
AV_CH_LOW_FREQUENCY
|
AV_CH_BACK_CENTER
|
AV_CH_STEREO_LEFT
|
AV_CH_STEREO_RIGHT
,
79
AV_CH_FRONT_LEFT
|
AV_CH_FRONT_RIGHT
|
AV_CH_FRONT_CENTER
|
AV_CH_BACK_CENTER
|
AV_CH_STEREO_LEFT
|
AV_CH_STEREO_RIGHT
,
80
AV_CH_FRONT_LEFT
|
AV_CH_FRONT_RIGHT
|
AV_CH_FRONT_CENTER
|
AV_CH_LOW_FREQUENCY
|
AV_CH_BACK_CENTER
|
AV_CH_STEREO_LEFT
|
AV_CH_STEREO_RIGHT
,
81
AV_CH_FRONT_CENTER
|
AV_CH_SIDE_LEFT
|
A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LEFT
|
AV_CH_BACK_RIGHT
|
AV_CH_SIDE_LEFT
|
AV_CH_SIDE_RIGHT
|
AV_CH_STEREO_LEFT
|
AV_CH_STEREO_RIGHT
,
90
AV_CH_FRONT_CENTER
|
AV_CH_BACK_CENTER
|
AV_CH_SIDE_LEFT
|
AV_CH_SIDE_RIGHT
|
AV_CH_STEREO_LEFT
|
AV_CH_STEREO_RIGHT
,
91
AV_CH_FRONT_CENTER
|
AV_CH_LOW_FREQUENCY
|
AV_CH_BACK_CENTER
|
AV_CH_SIDE_LEFT
|
AV_CH_SIDE_RIGHT
|
AV_CH_STEREO_LEFT
|
AV_CH_STEREO_RIGHT
,
92
AV_CH_FRONT_LEFT
|
AV_CH_FRONT_RIGHT
|
AV_CH_BACK_CENTER
|
AV_CH_SIDE_LEFT
|
AV_CH_SIDE_RIGHT
|
AV_CH_STEREO_LEFT
|
AV_CH_STEREO_RIGHT
,
93
AV_CH_FRONT_LEFT
|
AV_CH_FRONT_RIGHT
|
AV_CH_LOW_FREQUENCY
|
AV_CH_BACK_CENTER
|
AV_CH_SIDE_LEFT
|
AV_CH_SIDE_RIGHT
|
AV_CH_STEREO_LEFT
|
AV_CH_STEREO_RIGHT
,
94
AV_CH_FRONT_LEFT
|
AV_CH_FRONT_RIGHT
|
AV_CH_FRONT_CENTER
|
AV_CH_BACK_CENTER
|
AV_CH_SIDE_LEFT
|
AV_CH_SIDE_RIGHT
|
AV_CH_STEREO_LEFT
|
AV_CH_STEREO_RIGHT
,
95
-1
96
};
97
98
int
main
(
void
)
99
{
100
AVChannelLayout
layout
= { 0 };
101
const
int64_t
*cl;
102
char
buf[512];
103
int
i
;
104
const
char
*teststrings[] ={
105
"blah"
,
106
"1"
,
107
"2"
,
108
"-1"
,
109
"60"
,
110
"65"
,
111
"1c"
,
112
"2c"
,
113
"-1c"
,
114
"60c"
,
115
"65c"
,
116
"2C"
,
117
"60C"
,
118
"65C"
,
119
"5.1"
,
120
"stereo"
,
121
"0x3"
,
122
};
123
124
for
(cl =
avfilter_all_channel_layouts
; *cl != -1; cl++) {
125
av_channel_layout_from_mask
(&
layout
, *cl);
126
av_channel_layout_describe
(&
layout
, buf,
sizeof
(buf));
127
printf
(
"%s\n"
, buf);
128
av_channel_layout_uninit
(&
layout
);
129
}
130
131
for
(
i
= 0;
i
<
FF_ARRAY_ELEMS
(teststrings);
i
++) {
132
int
count = -1;
133
int
ret
;
134
av_channel_layout_uninit
(&
layout
);
135
ret
=
ff_parse_channel_layout
(&
layout
, &count, teststrings[
i
],
NULL
);
136
137
printf
(
"%d = ff_parse_channel_layout(%016"
PRIX64
", %2d, %s);\n"
,
ret
? -1 : 0,
layout
.order ==
AV_CHANNEL_ORDER_NATIVE
?
layout
.u.mask : 0, count, teststrings[
i
]);
138
}
139
140
return
0;
141
}
int64_t
long long int64_t
Definition:
coverity.c:34
AV_CH_BACK_LEFT
#define AV_CH_BACK_LEFT
Definition:
channel_layout.h:172
FF_ARRAY_ELEMS
#define FF_ARRAY_ELEMS(a)
Definition:
sinewin_tablegen.c:29
AV_CH_LOW_FREQUENCY
#define AV_CH_LOW_FREQUENCY
Definition:
channel_layout.h:171
av_channel_layout_describe
int av_channel_layout_describe(const AVChannelLayout *channel_layout, char *buf, size_t buf_size)
Get a human-readable string describing the channel layout properties.
Definition:
channel_layout.c:644
av_channel_layout_from_mask
int av_channel_layout_from_mask(AVChannelLayout *channel_layout, uint64_t mask)
Initialize a native channel layout from a bitmask indicating which channels are present.
Definition:
channel_layout.c:242
avfilter_all_channel_layouts
const int64_t avfilter_all_channel_layouts[]
Definition:
formats.c:26
AV_CH_STEREO_RIGHT
#define AV_CH_STEREO_RIGHT
Definition:
channel_layout.h:187
NULL
#define NULL
Definition:
coverity.c:32
main
int main(void)
Definition:
formats.c:98
AV_CH_FRONT_CENTER
#define AV_CH_FRONT_CENTER
Definition:
channel_layout.h:170
AVChannelLayout
An AVChannelLayout holds information about the channel layout of audio data.
Definition:
channel_layout.h:303
ff_parse_channel_layout
int ff_parse_channel_layout(AVChannelLayout *ret, int *nret, const char *arg, void *log_ctx)
Parse a channel layout or a corresponding integer representation.
Definition:
formats.c:966
printf
printf("static const uint8_t my_array[100] = {\n")
AV_CHANNEL_ORDER_NATIVE
@ AV_CHANNEL_ORDER_NATIVE
The native channel order, i.e.
Definition:
channel_layout.h:118
layout
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel layout
Definition:
filter_design.txt:18
i
#define i(width, name, range_min, range_max)
Definition:
cbs_h2645.c:255
AV_CH_BACK_CENTER
#define AV_CH_BACK_CENTER
Definition:
channel_layout.h:176
AV_CH_FRONT_LEFT
#define AV_CH_FRONT_LEFT
Definition:
channel_layout.h:168
AV_CH_SIDE_RIGHT
#define AV_CH_SIDE_RIGHT
Definition:
channel_layout.h:178
ret
ret
Definition:
filter_design.txt:187
channel_layout.h
av_channel_layout_uninit
void av_channel_layout_uninit(AVChannelLayout *channel_layout)
Free any allocated data in the channel layout and reset the channel count to 0.
Definition:
channel_layout.c:432
AV_CH_FRONT_RIGHT
#define AV_CH_FRONT_RIGHT
Definition:
channel_layout.h:169
formats.c
AV_CH_BACK_RIGHT
#define AV_CH_BACK_RIGHT
Definition:
channel_layout.h:173
AV_CH_STEREO_LEFT
#define AV_CH_STEREO_LEFT
Definition:
channel_layout.h:186
AV_CH_SIDE_LEFT
#define AV_CH_SIDE_LEFT
Definition:
channel_layout.h:177
Generated on Thu Sep 26 2024 23:15:33 for FFmpeg by
1.8.17