mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-28 05:30:34 +00:00
audioconvert: add av_get_default_channel_layout public function
This commit is contained in:
parent
2446a8cc0a
commit
60aaf044f3
@ -131,3 +131,11 @@ int av_get_channel_layout_nb_channels(int64_t channel_layout)
|
||||
x &= x-1; // unset lowest set bit
|
||||
return count;
|
||||
}
|
||||
|
||||
int av_get_default_channel_layout(int nb_channels) {
|
||||
int i;
|
||||
for (i = 0; channel_layout_map[i].name; i++)
|
||||
if (nb_channels == channel_layout_map[i].nb_channels)
|
||||
return channel_layout_map[i].layout;
|
||||
return 0;
|
||||
}
|
||||
|
@ -92,4 +92,9 @@ void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, int6
|
||||
*/
|
||||
int av_get_channel_layout_nb_channels(int64_t channel_layout);
|
||||
|
||||
/**
|
||||
* Return default channel layout for a given number of channels.
|
||||
*/
|
||||
int av_get_default_channel_layout(int nb_channels);
|
||||
|
||||
#endif /* AVUTIL_AUDIOCONVERT_H */
|
||||
|
Loading…
Reference in New Issue
Block a user