diff --git a/Cargo.toml b/Cargo.toml index c427ca4..00f8d58 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rusty_ffmpeg" -version = "0.16.4+ffmpeg.7.1" +version = "0.16.5+ffmpeg.7.1" authors = ["ldm0 "] edition = "2021" description = "A library that provides Rust bindings for FFmpeg" @@ -40,6 +40,10 @@ link_vcpkg_ffmpeg = ["vcpkg"] # FFmpeg 5.* support ffmpeg5 = [] # FFmpeg 6.* support -ffmpeg6 = [] +ffmpeg6 = ["ffmpeg5"] # FFmpeg 7.* support -ffmpeg7 = [] +ffmpeg7 = ["ffmpeg6"] +# FFmpeg 7.1+ support +ffmpeg7_1 = ["ffmpeg7"] +# FFmpeg 8.* support +ffmpeg8 = ["ffmpeg7_1"] diff --git a/src/avutil/channel_layout.rs b/src/avutil/channel_layout.rs new file mode 100644 index 0000000..93dc710 --- /dev/null +++ b/src/avutil/channel_layout.rs @@ -0,0 +1,181 @@ +//! Rust equivalents of libavutil channel layout #defines, generated via small macros. +//! Only mirrors the #define parts in `channel_layout.h`. + +use crate::ffi::{AVChannelLayout, AV_CHANNEL_ORDER_NATIVE, AV_CHANNEL_ORDER_AMBISONIC, AVChannelLayout__bindgen_ty_1}; + +// Helpers +macro_rules! AV_CH_MASK_CONST { + ($name:ident, $chan:ident) => { + pub const $name: u64 = 1u64 << (crate::ffi::$chan as u64); + }; +} + +macro_rules! AV_CH_LAYOUT_CONST { + ($name:ident, $($part:ident)|+ $(|)?) => { + pub const $name: u64 = $($part)|+; + }; +} + +// C-style macro returning an AVChannelLayout struct literal +macro_rules! AV_CHANNEL_LAYOUT_MASK { + ($nb:expr, $m:expr) => { + AVChannelLayout { + order: AV_CHANNEL_ORDER_NATIVE, + nb_channels: $nb, + u: AVChannelLayout__bindgen_ty_1 { mask: $m }, + opaque: ::std::ptr::null_mut(), + } + }; +} + +// ---- AV_CH_* single-channel masks ---- +AV_CH_MASK_CONST!(AV_CH_FRONT_LEFT, AV_CHAN_FRONT_LEFT); +AV_CH_MASK_CONST!(AV_CH_FRONT_RIGHT, AV_CHAN_FRONT_RIGHT); +AV_CH_MASK_CONST!(AV_CH_FRONT_CENTER, AV_CHAN_FRONT_CENTER); +AV_CH_MASK_CONST!(AV_CH_LOW_FREQUENCY, AV_CHAN_LOW_FREQUENCY); +AV_CH_MASK_CONST!(AV_CH_BACK_LEFT, AV_CHAN_BACK_LEFT); +AV_CH_MASK_CONST!(AV_CH_BACK_RIGHT, AV_CHAN_BACK_RIGHT); +AV_CH_MASK_CONST!(AV_CH_FRONT_LEFT_OF_CENTER, AV_CHAN_FRONT_LEFT_OF_CENTER); +AV_CH_MASK_CONST!(AV_CH_FRONT_RIGHT_OF_CENTER, AV_CHAN_FRONT_RIGHT_OF_CENTER); +AV_CH_MASK_CONST!(AV_CH_BACK_CENTER, AV_CHAN_BACK_CENTER); +AV_CH_MASK_CONST!(AV_CH_SIDE_LEFT, AV_CHAN_SIDE_LEFT); +AV_CH_MASK_CONST!(AV_CH_SIDE_RIGHT, AV_CHAN_SIDE_RIGHT); +AV_CH_MASK_CONST!(AV_CH_TOP_CENTER, AV_CHAN_TOP_CENTER); +AV_CH_MASK_CONST!(AV_CH_TOP_FRONT_LEFT, AV_CHAN_TOP_FRONT_LEFT); +AV_CH_MASK_CONST!(AV_CH_TOP_FRONT_CENTER, AV_CHAN_TOP_FRONT_CENTER); +AV_CH_MASK_CONST!(AV_CH_TOP_FRONT_RIGHT, AV_CHAN_TOP_FRONT_RIGHT); +AV_CH_MASK_CONST!(AV_CH_TOP_BACK_LEFT, AV_CHAN_TOP_BACK_LEFT); +AV_CH_MASK_CONST!(AV_CH_TOP_BACK_CENTER, AV_CHAN_TOP_BACK_CENTER); +AV_CH_MASK_CONST!(AV_CH_TOP_BACK_RIGHT, AV_CHAN_TOP_BACK_RIGHT); +AV_CH_MASK_CONST!(AV_CH_STEREO_LEFT, AV_CHAN_STEREO_LEFT); +AV_CH_MASK_CONST!(AV_CH_STEREO_RIGHT, AV_CHAN_STEREO_RIGHT); +AV_CH_MASK_CONST!(AV_CH_WIDE_LEFT, AV_CHAN_WIDE_LEFT); +AV_CH_MASK_CONST!(AV_CH_WIDE_RIGHT, AV_CHAN_WIDE_RIGHT); +AV_CH_MASK_CONST!(AV_CH_SURROUND_DIRECT_LEFT, AV_CHAN_SURROUND_DIRECT_LEFT); +AV_CH_MASK_CONST!(AV_CH_SURROUND_DIRECT_RIGHT, AV_CHAN_SURROUND_DIRECT_RIGHT); +AV_CH_MASK_CONST!(AV_CH_LOW_FREQUENCY_2, AV_CHAN_LOW_FREQUENCY_2); +#[cfg(feature = "ffmpeg5")] +AV_CH_MASK_CONST!(AV_CH_TOP_SIDE_LEFT, AV_CHAN_TOP_SIDE_LEFT); +#[cfg(feature = "ffmpeg5")] +AV_CH_MASK_CONST!(AV_CH_TOP_SIDE_RIGHT, AV_CHAN_TOP_SIDE_RIGHT); +#[cfg(feature = "ffmpeg5")] +AV_CH_MASK_CONST!(AV_CH_BOTTOM_FRONT_CENTER, AV_CHAN_BOTTOM_FRONT_CENTER); +#[cfg(feature = "ffmpeg5")] +AV_CH_MASK_CONST!(AV_CH_BOTTOM_FRONT_LEFT, AV_CHAN_BOTTOM_FRONT_LEFT); +#[cfg(feature = "ffmpeg5")] +AV_CH_MASK_CONST!(AV_CH_BOTTOM_FRONT_RIGHT, AV_CHAN_BOTTOM_FRONT_RIGHT); +#[cfg(feature = "ffmpeg6")] +AV_CH_MASK_CONST!(AV_CH_SIDE_SURROUND_LEFT, AV_CHAN_SIDE_SURROUND_LEFT); +#[cfg(feature = "ffmpeg6")] +AV_CH_MASK_CONST!(AV_CH_SIDE_SURROUND_RIGHT, AV_CHAN_SIDE_SURROUND_RIGHT); +#[cfg(feature = "ffmpeg7_1")] +AV_CH_MASK_CONST!(AV_CH_TOP_SURROUND_LEFT, AV_CHAN_TOP_SURROUND_LEFT); +#[cfg(feature = "ffmpeg7_1")] +AV_CH_MASK_CONST!(AV_CH_TOP_SURROUND_RIGHT, AV_CHAN_TOP_SURROUND_RIGHT); +#[cfg(feature = "ffmpeg8")] +AV_CH_MASK_CONST!(AV_CH_BINAURAL_LEFT, AV_CHAN_BINAURAL_LEFT); +#[cfg(feature = "ffmpeg8")] +AV_CH_MASK_CONST!(AV_CH_BINAURAL_RIGHT, AV_CHAN_BINAURAL_RIGHT); + +// ---- AV_CH_LAYOUT_* bitmask combinations ---- +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_MONO, AV_CH_FRONT_CENTER); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_STEREO, AV_CH_FRONT_LEFT|AV_CH_FRONT_RIGHT); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_2POINT1, AV_CH_LAYOUT_STEREO|AV_CH_LOW_FREQUENCY); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_2_1, AV_CH_LAYOUT_STEREO|AV_CH_BACK_CENTER); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_SURROUND, AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_3POINT1, AV_CH_LAYOUT_SURROUND|AV_CH_LOW_FREQUENCY); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_4POINT0, AV_CH_LAYOUT_SURROUND|AV_CH_BACK_CENTER); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_4POINT1, AV_CH_LAYOUT_4POINT0|AV_CH_LOW_FREQUENCY); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_2_2, AV_CH_LAYOUT_STEREO|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_QUAD, AV_CH_LAYOUT_STEREO|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_5POINT0, AV_CH_LAYOUT_SURROUND|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_5POINT1, AV_CH_LAYOUT_5POINT0|AV_CH_LOW_FREQUENCY); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_5POINT0_BACK, AV_CH_LAYOUT_SURROUND|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_5POINT1_BACK, AV_CH_LAYOUT_5POINT0_BACK|AV_CH_LOW_FREQUENCY); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_6POINT0, AV_CH_LAYOUT_5POINT0|AV_CH_BACK_CENTER); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_6POINT0_FRONT, AV_CH_LAYOUT_2_2|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_HEXAGONAL, AV_CH_LAYOUT_5POINT0_BACK|AV_CH_BACK_CENTER); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_3POINT1POINT2, AV_CH_LAYOUT_3POINT1|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_6POINT1, AV_CH_LAYOUT_5POINT1|AV_CH_BACK_CENTER); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_6POINT1_BACK, AV_CH_LAYOUT_5POINT1_BACK|AV_CH_BACK_CENTER); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_6POINT1_FRONT, AV_CH_LAYOUT_6POINT0_FRONT|AV_CH_LOW_FREQUENCY); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_7POINT0, AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_7POINT0_FRONT, AV_CH_LAYOUT_5POINT0|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_7POINT1, AV_CH_LAYOUT_5POINT1|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_7POINT1_WIDE, AV_CH_LAYOUT_5POINT1|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_7POINT1_WIDE_BACK, AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_5POINT1POINT2, AV_CH_LAYOUT_5POINT1|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_5POINT1POINT2_BACK, AV_CH_LAYOUT_5POINT1_BACK|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_OCTAGONAL, AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_CENTER|AV_CH_BACK_RIGHT); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_CUBE, AV_CH_LAYOUT_QUAD|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_5POINT1POINT4_BACK, AV_CH_LAYOUT_5POINT1POINT2|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_7POINT1POINT2, AV_CH_LAYOUT_7POINT1|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_7POINT1POINT4_BACK, AV_CH_LAYOUT_7POINT1POINT2|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_7POINT2POINT3, AV_CH_LAYOUT_7POINT1POINT2|AV_CH_TOP_BACK_CENTER|AV_CH_LOW_FREQUENCY_2); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_9POINT1POINT4_BACK, AV_CH_LAYOUT_7POINT1POINT4_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER); +#[cfg(feature = "ffmpeg5")] +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_9POINT1POINT6, AV_CH_LAYOUT_9POINT1POINT4_BACK|AV_CH_TOP_SIDE_LEFT|AV_CH_TOP_SIDE_RIGHT); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_HEXADECAGONAL, AV_CH_LAYOUT_OCTAGONAL|AV_CH_WIDE_LEFT|AV_CH_WIDE_RIGHT|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT|AV_CH_TOP_BACK_CENTER|AV_CH_TOP_FRONT_CENTER|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT); +#[cfg(feature = "ffmpeg8")] +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_BINAURAL, AV_CH_BINAURAL_LEFT|AV_CH_BINAURAL_RIGHT); +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_STEREO_DOWNMIX, AV_CH_STEREO_LEFT|AV_CH_STEREO_RIGHT); +#[cfg(feature = "ffmpeg5")] +AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_22POINT2, AV_CH_LAYOUT_9POINT1POINT6|AV_CH_BACK_CENTER|AV_CH_LOW_FREQUENCY_2|AV_CH_TOP_FRONT_CENTER|AV_CH_TOP_CENTER|AV_CH_TOP_BACK_CENTER|AV_CH_BOTTOM_FRONT_CENTER|AV_CH_BOTTOM_FRONT_LEFT|AV_CH_BOTTOM_FRONT_RIGHT); + +// Alias +pub const AV_CH_LAYOUT_7POINT1_TOP_BACK: u64 = AV_CH_LAYOUT_5POINT1POINT2_BACK; + +// ---- AV_CHANNEL_LAYOUT_* (struct initializers) ---- +pub const AV_CHANNEL_LAYOUT_MONO: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(1, AV_CH_LAYOUT_MONO); +pub const AV_CHANNEL_LAYOUT_STEREO: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(2, AV_CH_LAYOUT_STEREO); +pub const AV_CHANNEL_LAYOUT_2POINT1: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(3, AV_CH_LAYOUT_2POINT1); +pub const AV_CHANNEL_LAYOUT_2_1: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(3, AV_CH_LAYOUT_2_1); +pub const AV_CHANNEL_LAYOUT_SURROUND: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(3, AV_CH_LAYOUT_SURROUND); +pub const AV_CHANNEL_LAYOUT_3POINT1: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(4, AV_CH_LAYOUT_3POINT1); +pub const AV_CHANNEL_LAYOUT_4POINT0: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(4, AV_CH_LAYOUT_4POINT0); +pub const AV_CHANNEL_LAYOUT_4POINT1: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(5, AV_CH_LAYOUT_4POINT1); +pub const AV_CHANNEL_LAYOUT_2_2: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(4, AV_CH_LAYOUT_2_2); +pub const AV_CHANNEL_LAYOUT_QUAD: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(4, AV_CH_LAYOUT_QUAD); +pub const AV_CHANNEL_LAYOUT_5POINT0: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(5, AV_CH_LAYOUT_5POINT0); +pub const AV_CHANNEL_LAYOUT_5POINT1: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(6, AV_CH_LAYOUT_5POINT1); +pub const AV_CHANNEL_LAYOUT_5POINT0_BACK: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(5, AV_CH_LAYOUT_5POINT0_BACK); +pub const AV_CHANNEL_LAYOUT_5POINT1_BACK: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(6, AV_CH_LAYOUT_5POINT1_BACK); +pub const AV_CHANNEL_LAYOUT_6POINT0: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(6, AV_CH_LAYOUT_6POINT0); +pub const AV_CHANNEL_LAYOUT_6POINT0_FRONT: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(6, AV_CH_LAYOUT_6POINT0_FRONT); +pub const AV_CHANNEL_LAYOUT_3POINT1POINT2: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(6, AV_CH_LAYOUT_3POINT1POINT2); +pub const AV_CHANNEL_LAYOUT_HEXAGONAL: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(6, AV_CH_LAYOUT_HEXAGONAL); +pub const AV_CHANNEL_LAYOUT_6POINT1: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(7, AV_CH_LAYOUT_6POINT1); +pub const AV_CHANNEL_LAYOUT_6POINT1_BACK: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(7, AV_CH_LAYOUT_6POINT1_BACK); +pub const AV_CHANNEL_LAYOUT_6POINT1_FRONT: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(7, AV_CH_LAYOUT_6POINT1_FRONT); +pub const AV_CHANNEL_LAYOUT_7POINT0: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(7, AV_CH_LAYOUT_7POINT0); +pub const AV_CHANNEL_LAYOUT_7POINT0_FRONT: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(7, AV_CH_LAYOUT_7POINT0_FRONT); +pub const AV_CHANNEL_LAYOUT_7POINT1: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(8, AV_CH_LAYOUT_7POINT1); +pub const AV_CHANNEL_LAYOUT_7POINT1_WIDE: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(8, AV_CH_LAYOUT_7POINT1_WIDE); +pub const AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(8, AV_CH_LAYOUT_7POINT1_WIDE_BACK); +pub const AV_CHANNEL_LAYOUT_5POINT1POINT2: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(8, AV_CH_LAYOUT_5POINT1POINT2); +pub const AV_CHANNEL_LAYOUT_5POINT1POINT2_BACK: AVChannelLayout= AV_CHANNEL_LAYOUT_MASK!(8, AV_CH_LAYOUT_5POINT1POINT2_BACK); +pub const AV_CHANNEL_LAYOUT_OCTAGONAL: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(8, AV_CH_LAYOUT_OCTAGONAL); +pub const AV_CHANNEL_LAYOUT_CUBE: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(8, AV_CH_LAYOUT_CUBE); +pub const AV_CHANNEL_LAYOUT_5POINT1POINT4_BACK: AVChannelLayout= AV_CHANNEL_LAYOUT_MASK!(10, AV_CH_LAYOUT_5POINT1POINT4_BACK); +pub const AV_CHANNEL_LAYOUT_7POINT1POINT2: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(10, AV_CH_LAYOUT_7POINT1POINT2); +pub const AV_CHANNEL_LAYOUT_7POINT1POINT4_BACK: AVChannelLayout= AV_CHANNEL_LAYOUT_MASK!(12, AV_CH_LAYOUT_7POINT1POINT4_BACK); +pub const AV_CHANNEL_LAYOUT_7POINT2POINT3: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(12, AV_CH_LAYOUT_7POINT2POINT3); +pub const AV_CHANNEL_LAYOUT_9POINT1POINT4_BACK: AVChannelLayout= AV_CHANNEL_LAYOUT_MASK!(14, AV_CH_LAYOUT_9POINT1POINT4_BACK); +#[cfg(feature = "ffmpeg5")] +pub const AV_CHANNEL_LAYOUT_9POINT1POINT6: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(16, AV_CH_LAYOUT_9POINT1POINT6); +pub const AV_CHANNEL_LAYOUT_HEXADECAGONAL: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(16, AV_CH_LAYOUT_HEXADECAGONAL); +#[cfg(feature = "ffmpeg8")] +pub const AV_CHANNEL_LAYOUT_BINAURAL: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(2, AV_CH_LAYOUT_BINAURAL); +pub const AV_CHANNEL_LAYOUT_STEREO_DOWNMIX: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(2, AV_CH_LAYOUT_STEREO_DOWNMIX); +#[cfg(feature = "ffmpeg5")] +pub const AV_CHANNEL_LAYOUT_22POINT2: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(24, AV_CH_LAYOUT_22POINT2); + +pub const AV_CHANNEL_LAYOUT_7POINT1_TOP_BACK: AVChannelLayout = AV_CHANNEL_LAYOUT_5POINT1POINT2_BACK; + +// Special predefined (non-native order) +pub const AV_CHANNEL_LAYOUT_AMBISONIC_FIRST_ORDER: AVChannelLayout = AVChannelLayout { + order: AV_CHANNEL_ORDER_AMBISONIC, + nb_channels: 4, + u: AVChannelLayout__bindgen_ty_1 { mask: 0 }, + opaque: ::std::ptr::null_mut(), +}; diff --git a/src/avutil/mod.rs b/src/avutil/mod.rs index db72796..5a271db 100644 --- a/src/avutil/mod.rs +++ b/src/avutil/mod.rs @@ -5,3 +5,5 @@ pub mod error; #[rustfmt::skip] pub mod pixfmt; pub mod rational; +#[rustfmt::skip] +pub mod channel_layout; diff --git a/src/avutil/pixfmt.rs b/src/avutil/pixfmt.rs index 63736c6..9854f8a 100644 --- a/src/avutil/pixfmt.rs +++ b/src/avutil/pixfmt.rs @@ -1,5 +1,3 @@ -#![allow(non_upper_case_globals)] - use crate::ffi::*; macro_rules! AV_PIX_FMT_NE { diff --git a/src/lib.rs b/src/lib.rs index 4ca94cf..86a7628 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,6 +9,8 @@ mod avutil; clippy::all )] pub mod ffi { - pub use crate::avutil::{_avutil::*, common::*, error::*, pixfmt::*, rational::*}; + pub use crate::avutil::{ + _avutil::*, channel_layout::*, common::*, error::*, pixfmt::*, rational::*, + }; include!(concat!(env!("OUT_DIR"), "/binding.rs")); }