Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
cc554704
Commit
cc554704
authored
Jul 29, 2012
by
Nicolas George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
audioconvert: include the description of channels in the library.
parent
8a6d673e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
29 deletions
+34
-29
audioconvert.c
libavutil/audioconvert.c
+34
-29
No files found.
libavutil/audioconvert.c
View file @
cc554704
...
...
@@ -28,38 +28,43 @@
#include "audioconvert.h"
#include "bprint.h"
static
const
char
*
const
channel_names
[]
=
{
[
0
]
=
"FL"
,
/* front left */
[
1
]
=
"FR"
,
/* front right */
[
2
]
=
"FC"
,
/* front center */
[
3
]
=
"LFE"
,
/* low frequency */
[
4
]
=
"BL"
,
/* back left */
[
5
]
=
"BR"
,
/* back right */
[
6
]
=
"FLC"
,
/* front left-of-center */
[
7
]
=
"FRC"
,
/* front right-of-center */
[
8
]
=
"BC"
,
/* back-center */
[
9
]
=
"SL"
,
/* side left */
[
10
]
=
"SR"
,
/* side right */
[
11
]
=
"TC"
,
/* top center */
[
12
]
=
"TFL"
,
/* top front left */
[
13
]
=
"TFC"
,
/* top front center */
[
14
]
=
"TFR"
,
/* top front right */
[
15
]
=
"TBL"
,
/* top back left */
[
16
]
=
"TBC"
,
/* top back center */
[
17
]
=
"TBR"
,
/* top back right */
[
29
]
=
"DL"
,
/* downmix left */
[
30
]
=
"DR"
,
/* downmix right */
[
31
]
=
"WL"
,
/* wide left */
[
32
]
=
"WR"
,
/* wide right */
[
33
]
=
"SDL"
,
/* surround direct left */
[
34
]
=
"SDR"
,
/* surround direct right */
struct
channel_name
{
const
char
*
name
;
const
char
*
description
;
};
static
const
struct
channel_name
channel_names
[]
=
{
[
0
]
=
{
"FL"
,
"front left"
},
[
1
]
=
{
"FR"
,
"front right"
},
[
2
]
=
{
"FC"
,
"front center"
},
[
3
]
=
{
"LFE"
,
"low frequency"
},
[
4
]
=
{
"BL"
,
"back left"
},
[
5
]
=
{
"BR"
,
"back right"
},
[
6
]
=
{
"FLC"
,
"front left-of-center"
},
[
7
]
=
{
"FRC"
,
"front right-of-center"
},
[
8
]
=
{
"BC"
,
"back center"
},
[
9
]
=
{
"SL"
,
"side left"
},
[
10
]
=
{
"SR"
,
"side right"
},
[
11
]
=
{
"TC"
,
"top center"
},
[
12
]
=
{
"TFL"
,
"top front left"
},
[
13
]
=
{
"TFC"
,
"top front center"
},
[
14
]
=
{
"TFR"
,
"top front right"
},
[
15
]
=
{
"TBL"
,
"top back left"
},
[
16
]
=
{
"TBC"
,
"top back center"
},
[
17
]
=
{
"TBR"
,
"top back right"
},
[
29
]
=
{
"DL"
,
"downmix left"
},
[
30
]
=
{
"DR"
,
"downmix right"
},
[
31
]
=
{
"WL"
,
"wide left"
},
[
32
]
=
{
"WR"
,
"wide right"
},
[
33
]
=
{
"SDL"
,
"surround direct left"
},
[
34
]
=
{
"SDR"
,
"surround direct right"
},
};
static
const
char
*
get_channel_name
(
int
channel_id
)
{
if
(
channel_id
<
0
||
channel_id
>=
FF_ARRAY_ELEMS
(
channel_names
))
return
NULL
;
return
channel_names
[
channel_id
];
return
channel_names
[
channel_id
]
.
name
;
}
static
const
struct
{
...
...
@@ -107,9 +112,9 @@ static uint64_t get_channel_layout_single(const char *name, int name_len)
return
channel_layout_map
[
i
].
layout
;
}
for
(
i
=
0
;
i
<
FF_ARRAY_ELEMS
(
channel_names
);
i
++
)
if
(
channel_names
[
i
]
&&
strlen
(
channel_names
[
i
])
==
name_len
&&
!
memcmp
(
channel_names
[
i
],
name
,
name_len
))
if
(
channel_names
[
i
]
.
name
&&
strlen
(
channel_names
[
i
]
.
name
)
==
name_len
&&
!
memcmp
(
channel_names
[
i
]
.
name
,
name
,
name_len
))
return
(
int64_t
)
1
<<
i
;
i
=
strtol
(
name
,
&
end
,
10
);
if
(
end
-
name
==
name_len
||
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment