Skip to content

Commit ce29738

Browse files
committed
feat: add AVChannelLayout definitions
1 parent 42bbbd2 commit ce29738

5 files changed

Lines changed: 190 additions & 5 deletions

File tree

Cargo.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ link_vcpkg_ffmpeg = ["vcpkg"]
4040
# FFmpeg 5.* support
4141
ffmpeg5 = []
4242
# FFmpeg 6.* support
43-
ffmpeg6 = []
43+
ffmpeg6 = ["ffmpeg5"]
4444
# FFmpeg 7.* support
45-
ffmpeg7 = []
45+
ffmpeg7 = ["ffmpeg6"]
46+
# FFmpeg 7.1+ support
47+
ffmpeg7_1 = ["ffmpeg7"]
48+
# FFmpeg 8.* support
49+
ffmpeg8 = ["ffmpeg7_1"]

src/avutil/channel_layout.rs

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
//! Rust equivalents of libavutil channel layout #defines, generated via small macros.
2+
//! Only mirrors the #define parts in `channel_layout.h`.
3+
4+
use crate::ffi::{AVChannelLayout, AV_CHANNEL_ORDER_NATIVE, AV_CHANNEL_ORDER_AMBISONIC, AVChannelLayout__bindgen_ty_1};
5+
6+
// Helpers
7+
macro_rules! AV_CH_MASK_CONST {
8+
($name:ident, $chan:ident) => {
9+
pub const $name: u64 = 1u64 << (crate::ffi::$chan as u64);
10+
};
11+
}
12+
13+
macro_rules! AV_CH_LAYOUT_CONST {
14+
($name:ident, $($part:ident)|+ $(|)?) => {
15+
pub const $name: u64 = $($part)|+;
16+
};
17+
}
18+
19+
// C-style macro returning an AVChannelLayout struct literal
20+
macro_rules! AV_CHANNEL_LAYOUT_MASK {
21+
($nb:expr, $m:expr) => {
22+
AVChannelLayout {
23+
order: AV_CHANNEL_ORDER_NATIVE,
24+
nb_channels: $nb,
25+
u: AVChannelLayout__bindgen_ty_1 { mask: $m },
26+
opaque: ::std::ptr::null_mut(),
27+
}
28+
};
29+
}
30+
31+
// ---- AV_CH_* single-channel masks ----
32+
AV_CH_MASK_CONST!(AV_CH_FRONT_LEFT, AV_CHAN_FRONT_LEFT);
33+
AV_CH_MASK_CONST!(AV_CH_FRONT_RIGHT, AV_CHAN_FRONT_RIGHT);
34+
AV_CH_MASK_CONST!(AV_CH_FRONT_CENTER, AV_CHAN_FRONT_CENTER);
35+
AV_CH_MASK_CONST!(AV_CH_LOW_FREQUENCY, AV_CHAN_LOW_FREQUENCY);
36+
AV_CH_MASK_CONST!(AV_CH_BACK_LEFT, AV_CHAN_BACK_LEFT);
37+
AV_CH_MASK_CONST!(AV_CH_BACK_RIGHT, AV_CHAN_BACK_RIGHT);
38+
AV_CH_MASK_CONST!(AV_CH_FRONT_LEFT_OF_CENTER, AV_CHAN_FRONT_LEFT_OF_CENTER);
39+
AV_CH_MASK_CONST!(AV_CH_FRONT_RIGHT_OF_CENTER, AV_CHAN_FRONT_RIGHT_OF_CENTER);
40+
AV_CH_MASK_CONST!(AV_CH_BACK_CENTER, AV_CHAN_BACK_CENTER);
41+
AV_CH_MASK_CONST!(AV_CH_SIDE_LEFT, AV_CHAN_SIDE_LEFT);
42+
AV_CH_MASK_CONST!(AV_CH_SIDE_RIGHT, AV_CHAN_SIDE_RIGHT);
43+
AV_CH_MASK_CONST!(AV_CH_TOP_CENTER, AV_CHAN_TOP_CENTER);
44+
AV_CH_MASK_CONST!(AV_CH_TOP_FRONT_LEFT, AV_CHAN_TOP_FRONT_LEFT);
45+
AV_CH_MASK_CONST!(AV_CH_TOP_FRONT_CENTER, AV_CHAN_TOP_FRONT_CENTER);
46+
AV_CH_MASK_CONST!(AV_CH_TOP_FRONT_RIGHT, AV_CHAN_TOP_FRONT_RIGHT);
47+
AV_CH_MASK_CONST!(AV_CH_TOP_BACK_LEFT, AV_CHAN_TOP_BACK_LEFT);
48+
AV_CH_MASK_CONST!(AV_CH_TOP_BACK_CENTER, AV_CHAN_TOP_BACK_CENTER);
49+
AV_CH_MASK_CONST!(AV_CH_TOP_BACK_RIGHT, AV_CHAN_TOP_BACK_RIGHT);
50+
AV_CH_MASK_CONST!(AV_CH_STEREO_LEFT, AV_CHAN_STEREO_LEFT);
51+
AV_CH_MASK_CONST!(AV_CH_STEREO_RIGHT, AV_CHAN_STEREO_RIGHT);
52+
AV_CH_MASK_CONST!(AV_CH_WIDE_LEFT, AV_CHAN_WIDE_LEFT);
53+
AV_CH_MASK_CONST!(AV_CH_WIDE_RIGHT, AV_CHAN_WIDE_RIGHT);
54+
AV_CH_MASK_CONST!(AV_CH_SURROUND_DIRECT_LEFT, AV_CHAN_SURROUND_DIRECT_LEFT);
55+
AV_CH_MASK_CONST!(AV_CH_SURROUND_DIRECT_RIGHT, AV_CHAN_SURROUND_DIRECT_RIGHT);
56+
AV_CH_MASK_CONST!(AV_CH_LOW_FREQUENCY_2, AV_CHAN_LOW_FREQUENCY_2);
57+
#[cfg(feature = "ffmpeg5")]
58+
AV_CH_MASK_CONST!(AV_CH_TOP_SIDE_LEFT, AV_CHAN_TOP_SIDE_LEFT);
59+
#[cfg(feature = "ffmpeg5")]
60+
AV_CH_MASK_CONST!(AV_CH_TOP_SIDE_RIGHT, AV_CHAN_TOP_SIDE_RIGHT);
61+
#[cfg(feature = "ffmpeg5")]
62+
AV_CH_MASK_CONST!(AV_CH_BOTTOM_FRONT_CENTER, AV_CHAN_BOTTOM_FRONT_CENTER);
63+
#[cfg(feature = "ffmpeg5")]
64+
AV_CH_MASK_CONST!(AV_CH_BOTTOM_FRONT_LEFT, AV_CHAN_BOTTOM_FRONT_LEFT);
65+
#[cfg(feature = "ffmpeg5")]
66+
AV_CH_MASK_CONST!(AV_CH_BOTTOM_FRONT_RIGHT, AV_CHAN_BOTTOM_FRONT_RIGHT);
67+
#[cfg(feature = "ffmpeg6")]
68+
AV_CH_MASK_CONST!(AV_CH_SIDE_SURROUND_LEFT, AV_CHAN_SIDE_SURROUND_LEFT);
69+
#[cfg(feature = "ffmpeg6")]
70+
AV_CH_MASK_CONST!(AV_CH_SIDE_SURROUND_RIGHT, AV_CHAN_SIDE_SURROUND_RIGHT);
71+
#[cfg(feature = "ffmpeg7_1")]
72+
AV_CH_MASK_CONST!(AV_CH_TOP_SURROUND_LEFT, AV_CHAN_TOP_SURROUND_LEFT);
73+
#[cfg(feature = "ffmpeg7_1")]
74+
AV_CH_MASK_CONST!(AV_CH_TOP_SURROUND_RIGHT, AV_CHAN_TOP_SURROUND_RIGHT);
75+
#[cfg(feature = "ffmpeg8")]
76+
AV_CH_MASK_CONST!(AV_CH_BINAURAL_LEFT, AV_CHAN_BINAURAL_LEFT);
77+
#[cfg(feature = "ffmpeg8")]
78+
AV_CH_MASK_CONST!(AV_CH_BINAURAL_RIGHT, AV_CHAN_BINAURAL_RIGHT);
79+
80+
// ---- AV_CH_LAYOUT_* bitmask combinations ----
81+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_MONO, AV_CH_FRONT_CENTER);
82+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_STEREO, AV_CH_FRONT_LEFT|AV_CH_FRONT_RIGHT);
83+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_2POINT1, AV_CH_LAYOUT_STEREO|AV_CH_LOW_FREQUENCY);
84+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_2_1, AV_CH_LAYOUT_STEREO|AV_CH_BACK_CENTER);
85+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_SURROUND, AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER);
86+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_3POINT1, AV_CH_LAYOUT_SURROUND|AV_CH_LOW_FREQUENCY);
87+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_4POINT0, AV_CH_LAYOUT_SURROUND|AV_CH_BACK_CENTER);
88+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_4POINT1, AV_CH_LAYOUT_4POINT0|AV_CH_LOW_FREQUENCY);
89+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_2_2, AV_CH_LAYOUT_STEREO|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT);
90+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_QUAD, AV_CH_LAYOUT_STEREO|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT);
91+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_5POINT0, AV_CH_LAYOUT_SURROUND|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT);
92+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_5POINT1, AV_CH_LAYOUT_5POINT0|AV_CH_LOW_FREQUENCY);
93+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_5POINT0_BACK, AV_CH_LAYOUT_SURROUND|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT);
94+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_5POINT1_BACK, AV_CH_LAYOUT_5POINT0_BACK|AV_CH_LOW_FREQUENCY);
95+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_6POINT0, AV_CH_LAYOUT_5POINT0|AV_CH_BACK_CENTER);
96+
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);
97+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_HEXAGONAL, AV_CH_LAYOUT_5POINT0_BACK|AV_CH_BACK_CENTER);
98+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_3POINT1POINT2, AV_CH_LAYOUT_3POINT1|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT);
99+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_6POINT1, AV_CH_LAYOUT_5POINT1|AV_CH_BACK_CENTER);
100+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_6POINT1_BACK, AV_CH_LAYOUT_5POINT1_BACK|AV_CH_BACK_CENTER);
101+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_6POINT1_FRONT, AV_CH_LAYOUT_6POINT0_FRONT|AV_CH_LOW_FREQUENCY);
102+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_7POINT0, AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT);
103+
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);
104+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_7POINT1, AV_CH_LAYOUT_5POINT1|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT);
105+
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);
106+
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);
107+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_5POINT1POINT2, AV_CH_LAYOUT_5POINT1|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT);
108+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_5POINT1POINT2_BACK, AV_CH_LAYOUT_5POINT1_BACK|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT);
109+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_OCTAGONAL, AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_CENTER|AV_CH_BACK_RIGHT);
110+
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);
111+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_5POINT1POINT4_BACK, AV_CH_LAYOUT_5POINT1POINT2|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT);
112+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_7POINT1POINT2, AV_CH_LAYOUT_7POINT1|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT);
113+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_7POINT1POINT4_BACK, AV_CH_LAYOUT_7POINT1POINT2|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT);
114+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_7POINT2POINT3, AV_CH_LAYOUT_7POINT1POINT2|AV_CH_TOP_BACK_CENTER|AV_CH_LOW_FREQUENCY_2);
115+
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);
116+
#[cfg(feature = "ffmpeg5")]
117+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_9POINT1POINT6, AV_CH_LAYOUT_9POINT1POINT4_BACK|AV_CH_TOP_SIDE_LEFT|AV_CH_TOP_SIDE_RIGHT);
118+
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);
119+
#[cfg(feature = "ffmpeg8")]
120+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_BINAURAL, AV_CH_BINAURAL_LEFT|AV_CH_BINAURAL_RIGHT);
121+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_STEREO_DOWNMIX, AV_CH_STEREO_LEFT|AV_CH_STEREO_RIGHT);
122+
#[cfg(feature = "ffmpeg5")]
123+
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);
124+
125+
// Alias
126+
pub const AV_CH_LAYOUT_7POINT1_TOP_BACK: u64 = AV_CH_LAYOUT_5POINT1POINT2_BACK;
127+
128+
// ---- AV_CHANNEL_LAYOUT_* (struct initializers) ----
129+
pub const AV_CHANNEL_LAYOUT_MONO: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(1, AV_CH_LAYOUT_MONO);
130+
pub const AV_CHANNEL_LAYOUT_STEREO: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(2, AV_CH_LAYOUT_STEREO);
131+
pub const AV_CHANNEL_LAYOUT_2POINT1: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(3, AV_CH_LAYOUT_2POINT1);
132+
pub const AV_CHANNEL_LAYOUT_2_1: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(3, AV_CH_LAYOUT_2_1);
133+
pub const AV_CHANNEL_LAYOUT_SURROUND: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(3, AV_CH_LAYOUT_SURROUND);
134+
pub const AV_CHANNEL_LAYOUT_3POINT1: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(4, AV_CH_LAYOUT_3POINT1);
135+
pub const AV_CHANNEL_LAYOUT_4POINT0: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(4, AV_CH_LAYOUT_4POINT0);
136+
pub const AV_CHANNEL_LAYOUT_4POINT1: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(5, AV_CH_LAYOUT_4POINT1);
137+
pub const AV_CHANNEL_LAYOUT_2_2: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(4, AV_CH_LAYOUT_2_2);
138+
pub const AV_CHANNEL_LAYOUT_QUAD: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(4, AV_CH_LAYOUT_QUAD);
139+
pub const AV_CHANNEL_LAYOUT_5POINT0: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(5, AV_CH_LAYOUT_5POINT0);
140+
pub const AV_CHANNEL_LAYOUT_5POINT1: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(6, AV_CH_LAYOUT_5POINT1);
141+
pub const AV_CHANNEL_LAYOUT_5POINT0_BACK: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(5, AV_CH_LAYOUT_5POINT0_BACK);
142+
pub const AV_CHANNEL_LAYOUT_5POINT1_BACK: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(6, AV_CH_LAYOUT_5POINT1_BACK);
143+
pub const AV_CHANNEL_LAYOUT_6POINT0: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(6, AV_CH_LAYOUT_6POINT0);
144+
pub const AV_CHANNEL_LAYOUT_6POINT0_FRONT: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(6, AV_CH_LAYOUT_6POINT0_FRONT);
145+
pub const AV_CHANNEL_LAYOUT_3POINT1POINT2: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(6, AV_CH_LAYOUT_3POINT1POINT2);
146+
pub const AV_CHANNEL_LAYOUT_HEXAGONAL: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(6, AV_CH_LAYOUT_HEXAGONAL);
147+
pub const AV_CHANNEL_LAYOUT_6POINT1: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(7, AV_CH_LAYOUT_6POINT1);
148+
pub const AV_CHANNEL_LAYOUT_6POINT1_BACK: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(7, AV_CH_LAYOUT_6POINT1_BACK);
149+
pub const AV_CHANNEL_LAYOUT_6POINT1_FRONT: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(7, AV_CH_LAYOUT_6POINT1_FRONT);
150+
pub const AV_CHANNEL_LAYOUT_7POINT0: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(7, AV_CH_LAYOUT_7POINT0);
151+
pub const AV_CHANNEL_LAYOUT_7POINT0_FRONT: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(7, AV_CH_LAYOUT_7POINT0_FRONT);
152+
pub const AV_CHANNEL_LAYOUT_7POINT1: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(8, AV_CH_LAYOUT_7POINT1);
153+
pub const AV_CHANNEL_LAYOUT_7POINT1_WIDE: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(8, AV_CH_LAYOUT_7POINT1_WIDE);
154+
pub const AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(8, AV_CH_LAYOUT_7POINT1_WIDE_BACK);
155+
pub const AV_CHANNEL_LAYOUT_5POINT1POINT2: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(8, AV_CH_LAYOUT_5POINT1POINT2);
156+
pub const AV_CHANNEL_LAYOUT_5POINT1POINT2_BACK: AVChannelLayout= AV_CHANNEL_LAYOUT_MASK!(8, AV_CH_LAYOUT_5POINT1POINT2_BACK);
157+
pub const AV_CHANNEL_LAYOUT_OCTAGONAL: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(8, AV_CH_LAYOUT_OCTAGONAL);
158+
pub const AV_CHANNEL_LAYOUT_CUBE: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(8, AV_CH_LAYOUT_CUBE);
159+
pub const AV_CHANNEL_LAYOUT_5POINT1POINT4_BACK: AVChannelLayout= AV_CHANNEL_LAYOUT_MASK!(10, AV_CH_LAYOUT_5POINT1POINT4_BACK);
160+
pub const AV_CHANNEL_LAYOUT_7POINT1POINT2: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(10, AV_CH_LAYOUT_7POINT1POINT2);
161+
pub const AV_CHANNEL_LAYOUT_7POINT1POINT4_BACK: AVChannelLayout= AV_CHANNEL_LAYOUT_MASK!(12, AV_CH_LAYOUT_7POINT1POINT4_BACK);
162+
pub const AV_CHANNEL_LAYOUT_7POINT2POINT3: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(12, AV_CH_LAYOUT_7POINT2POINT3);
163+
pub const AV_CHANNEL_LAYOUT_9POINT1POINT4_BACK: AVChannelLayout= AV_CHANNEL_LAYOUT_MASK!(14, AV_CH_LAYOUT_9POINT1POINT4_BACK);
164+
pub const AV_CHANNEL_LAYOUT_9POINT1POINT6: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(16, AV_CH_LAYOUT_9POINT1POINT6);
165+
pub const AV_CHANNEL_LAYOUT_HEXADECAGONAL: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(16, AV_CH_LAYOUT_HEXADECAGONAL);
166+
#[cfg(feature = "ffmpeg8")]
167+
pub const AV_CHANNEL_LAYOUT_BINAURAL: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(2, AV_CH_LAYOUT_BINAURAL);
168+
pub const AV_CHANNEL_LAYOUT_STEREO_DOWNMIX: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(2, AV_CH_LAYOUT_STEREO_DOWNMIX);
169+
pub const AV_CHANNEL_LAYOUT_22POINT2: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(24, AV_CH_LAYOUT_22POINT2);
170+
171+
pub const AV_CHANNEL_LAYOUT_7POINT1_TOP_BACK: AVChannelLayout = AV_CHANNEL_LAYOUT_5POINT1POINT2_BACK;
172+
173+
// Special predefined (non-native order)
174+
pub const AV_CHANNEL_LAYOUT_AMBISONIC_FIRST_ORDER: AVChannelLayout = AVChannelLayout {
175+
order: AV_CHANNEL_ORDER_AMBISONIC,
176+
nb_channels: 4,
177+
u: AVChannelLayout__bindgen_ty_1 { mask: 0 },
178+
opaque: ::std::ptr::null_mut(),
179+
};

src/avutil/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ pub mod error;
55
#[rustfmt::skip]
66
pub mod pixfmt;
77
pub mod rational;
8+
#[rustfmt::skip]
9+
pub mod channel_layout;

src/avutil/pixfmt.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![allow(non_upper_case_globals)]
2-
31
use crate::ffi::*;
42

53
macro_rules! AV_PIX_FMT_NE {

src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ mod avutil;
99
clippy::all
1010
)]
1111
pub mod ffi {
12-
pub use crate::avutil::{_avutil::*, common::*, error::*, pixfmt::*, rational::*};
12+
pub use crate::avutil::{
13+
_avutil::*, channel_layout::*, common::*, error::*, pixfmt::*, rational::*,
14+
};
1315
include!(concat!(env!("OUT_DIR"), "/binding.rs"));
1416
}

0 commit comments

Comments
 (0)