Add ChannelLayout API (#38)

* Create channel_layout directory

* Rename ChannelLayout -> ChannelLayoutMask

* Add enum Channel (<-> AVChannel)

* Add struct ChannelCustom (<-> AVChannelCustom)

* Add enum ChannelOrder (<-> AVChannelOrder)

* Add struct ChannelLayout

- Smart copy-on-write pointer to AVChannelLayout
- idiomatic Rust API wrapping around FFmpeg APIs
- no Ambisonic support (yet)
- consts will need to be manually updated

* Add ChannelLayoutIter (iterator over all standard layouts)

* Add codec/Audio::ch_layouts

* Add ch_layout API to Audio-related structs
This commit is contained in:
FreezyLemon
2024-04-23 14:59:15 +02:00
committed by GitHub
parent 3a9f4584a0
commit 3206eedcf0
19 changed files with 1115 additions and 47 deletions

View File

@ -91,7 +91,7 @@ fn transcoder<P: AsRef<Path>>(
let channel_layout = codec
.channel_layouts()
.map(|cls| cls.best(decoder.channel_layout().channels()))
.unwrap_or(ffmpeg::channel_layout::ChannelLayout::STEREO);
.unwrap_or(ffmpeg::channel_layout::ChannelLayoutMask::STEREO);
if global {
encoder.set_flags(ffmpeg::codec::flag::Flags::GLOBAL_HEADER);