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
59d58b33
Commit
59d58b33
authored
May 28, 2012
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
audioconvert: add a function for extracting the channel with the given index
parent
5df320e1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
audioconvert.c
libavutil/audioconvert.c
+14
-0
audioconvert.h
libavutil/audioconvert.h
+5
-0
No files found.
libavutil/audioconvert.c
View file @
59d58b33
...
@@ -213,3 +213,17 @@ const char *av_get_channel_name(uint64_t channel)
...
@@ -213,3 +213,17 @@ const char *av_get_channel_name(uint64_t channel)
return
get_channel_name
(
i
);
return
get_channel_name
(
i
);
return
NULL
;
return
NULL
;
}
}
uint64_t
av_channel_layout_extract_channel
(
uint64_t
channel_layout
,
int
index
)
{
int
i
;
if
(
av_get_channel_layout_nb_channels
(
channel_layout
)
<=
index
)
return
0
;
for
(
i
=
0
;
i
<
64
;
i
++
)
{
if
((
1ULL
<<
i
)
&
channel_layout
&&
!
index
--
)
return
1ULL
<<
i
;
}
return
0
;
}
libavutil/audioconvert.h
View file @
59d58b33
...
@@ -155,6 +155,11 @@ uint64_t av_get_default_channel_layout(int nb_channels);
...
@@ -155,6 +155,11 @@ uint64_t av_get_default_channel_layout(int nb_channels);
int
av_get_channel_layout_channel_index
(
uint64_t
channel_layout
,
int
av_get_channel_layout_channel_index
(
uint64_t
channel_layout
,
uint64_t
channel
);
uint64_t
channel
);
/**
* Get the channel with the given index in channel_layout.
*/
uint64_t
av_channel_layout_extract_channel
(
uint64_t
channel_layout
,
int
index
);
/**
/**
* Get the name of a given channel.
* Get the name of a given channel.
*
*
...
...
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