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
406b257d
Commit
406b257d
authored
May 28, 2012
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
audioconvert: add a function for getting channel's index in layout
parent
3596de55
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
audioconvert.c
libavutil/audioconvert.c
+10
-0
audioconvert.h
libavutil/audioconvert.h
+12
-0
No files found.
libavutil/audioconvert.c
View file @
406b257d
...
...
@@ -192,3 +192,13 @@ uint64_t av_get_default_channel_layout(int nb_channels)
default:
return
0
;
}
}
int
av_get_channel_layout_channel_index
(
uint64_t
channel_layout
,
uint64_t
channel
)
{
if
(
!
(
channel_layout
&
channel
)
||
av_get_channel_layout_nb_channels
(
channel
)
!=
1
)
return
AVERROR
(
EINVAL
);
channel_layout
&=
channel
-
1
;
return
av_get_channel_layout_nb_channels
(
channel_layout
);
}
libavutil/audioconvert.h
View file @
406b257d
...
...
@@ -143,6 +143,18 @@ int av_get_channel_layout_nb_channels(uint64_t channel_layout);
*/
uint64_t
av_get_default_channel_layout
(
int
nb_channels
);
/**
* Get the index of a channel in channel_layout.
*
* @param channel a channel layout describing exactly one channel which must be
* present in channel_layout.
*
* @return index of channel in channel_layout on success, a negative AVERROR
* on error.
*/
int
av_get_channel_layout_channel_index
(
uint64_t
channel_layout
,
uint64_t
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