Skip to content

Commit 2725519

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

5 files changed

Lines changed: 175 additions & 3 deletions

File tree

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,5 @@ ffmpeg5 = []
4343
ffmpeg6 = []
4444
# FFmpeg 7.* support
4545
ffmpeg7 = []
46+
# FFmpeg 8.* support
47+
ffmpeg8 = []

src/avutil/channel_layout.rs

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
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+
AV_CH_MASK_CONST!(AV_CH_TOP_SIDE_LEFT, AV_CHAN_TOP_SIDE_LEFT);
58+
AV_CH_MASK_CONST!(AV_CH_TOP_SIDE_RIGHT, AV_CHAN_TOP_SIDE_RIGHT);
59+
AV_CH_MASK_CONST!(AV_CH_BOTTOM_FRONT_CENTER, AV_CHAN_BOTTOM_FRONT_CENTER);
60+
AV_CH_MASK_CONST!(AV_CH_BOTTOM_FRONT_LEFT, AV_CHAN_BOTTOM_FRONT_LEFT);
61+
AV_CH_MASK_CONST!(AV_CH_BOTTOM_FRONT_RIGHT, AV_CHAN_BOTTOM_FRONT_RIGHT);
62+
AV_CH_MASK_CONST!(AV_CH_SIDE_SURROUND_LEFT, AV_CHAN_SIDE_SURROUND_LEFT);
63+
AV_CH_MASK_CONST!(AV_CH_SIDE_SURROUND_RIGHT, AV_CHAN_SIDE_SURROUND_RIGHT);
64+
AV_CH_MASK_CONST!(AV_CH_TOP_SURROUND_LEFT, AV_CHAN_TOP_SURROUND_LEFT);
65+
AV_CH_MASK_CONST!(AV_CH_TOP_SURROUND_RIGHT, AV_CHAN_TOP_SURROUND_RIGHT);
66+
#[cfg(feature = "ffmpeg8")]
67+
AV_CH_MASK_CONST!(AV_CH_BINAURAL_LEFT, AV_CHAN_BINAURAL_LEFT);
68+
#[cfg(feature = "ffmpeg8")]
69+
AV_CH_MASK_CONST!(AV_CH_BINAURAL_RIGHT, AV_CHAN_BINAURAL_RIGHT);
70+
71+
// ---- AV_CH_LAYOUT_* bitmask combinations ----
72+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_MONO, AV_CH_FRONT_CENTER);
73+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_STEREO, AV_CH_FRONT_LEFT|AV_CH_FRONT_RIGHT);
74+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_2POINT1, AV_CH_LAYOUT_STEREO|AV_CH_LOW_FREQUENCY);
75+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_2_1, AV_CH_LAYOUT_STEREO|AV_CH_BACK_CENTER);
76+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_SURROUND, AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER);
77+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_3POINT1, AV_CH_LAYOUT_SURROUND|AV_CH_LOW_FREQUENCY);
78+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_4POINT0, AV_CH_LAYOUT_SURROUND|AV_CH_BACK_CENTER);
79+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_4POINT1, AV_CH_LAYOUT_4POINT0|AV_CH_LOW_FREQUENCY);
80+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_2_2, AV_CH_LAYOUT_STEREO|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT);
81+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_QUAD, AV_CH_LAYOUT_STEREO|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT);
82+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_5POINT0, AV_CH_LAYOUT_SURROUND|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT);
83+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_5POINT1, AV_CH_LAYOUT_5POINT0|AV_CH_LOW_FREQUENCY);
84+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_5POINT0_BACK, AV_CH_LAYOUT_SURROUND|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT);
85+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_5POINT1_BACK, AV_CH_LAYOUT_5POINT0_BACK|AV_CH_LOW_FREQUENCY);
86+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_6POINT0, AV_CH_LAYOUT_5POINT0|AV_CH_BACK_CENTER);
87+
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);
88+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_HEXAGONAL, AV_CH_LAYOUT_5POINT0_BACK|AV_CH_BACK_CENTER);
89+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_3POINT1POINT2, AV_CH_LAYOUT_3POINT1|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT);
90+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_6POINT1, AV_CH_LAYOUT_5POINT1|AV_CH_BACK_CENTER);
91+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_6POINT1_BACK, AV_CH_LAYOUT_5POINT1_BACK|AV_CH_BACK_CENTER);
92+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_6POINT1_FRONT, AV_CH_LAYOUT_6POINT0_FRONT|AV_CH_LOW_FREQUENCY);
93+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_7POINT0, AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT);
94+
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);
95+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_7POINT1, AV_CH_LAYOUT_5POINT1|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT);
96+
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);
97+
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);
98+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_5POINT1POINT2, AV_CH_LAYOUT_5POINT1|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT);
99+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_5POINT1POINT2_BACK, AV_CH_LAYOUT_5POINT1_BACK|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT);
100+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_OCTAGONAL, AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_CENTER|AV_CH_BACK_RIGHT);
101+
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);
102+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_5POINT1POINT4_BACK, AV_CH_LAYOUT_5POINT1POINT2|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT);
103+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_7POINT1POINT2, AV_CH_LAYOUT_7POINT1|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT);
104+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_7POINT1POINT4_BACK, AV_CH_LAYOUT_7POINT1POINT2|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT);
105+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_7POINT2POINT3, AV_CH_LAYOUT_7POINT1POINT2|AV_CH_TOP_BACK_CENTER|AV_CH_LOW_FREQUENCY_2);
106+
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);
107+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_9POINT1POINT6, AV_CH_LAYOUT_9POINT1POINT4_BACK|AV_CH_TOP_SIDE_LEFT|AV_CH_TOP_SIDE_RIGHT);
108+
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);
109+
#[cfg(feature = "ffmpeg8")]
110+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_BINAURAL, AV_CH_BINAURAL_LEFT|AV_CH_BINAURAL_RIGHT);
111+
AV_CH_LAYOUT_CONST!(AV_CH_LAYOUT_STEREO_DOWNMIX, AV_CH_STEREO_LEFT|AV_CH_STEREO_RIGHT);
112+
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);
113+
114+
// Alias
115+
pub const AV_CH_LAYOUT_7POINT1_TOP_BACK: u64 = AV_CH_LAYOUT_5POINT1POINT2_BACK;
116+
117+
// ---- AV_CHANNEL_LAYOUT_* (struct initializers) ----
118+
pub const AV_CHANNEL_LAYOUT_MONO: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(1, AV_CH_LAYOUT_MONO);
119+
pub const AV_CHANNEL_LAYOUT_STEREO: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(2, AV_CH_LAYOUT_STEREO);
120+
pub const AV_CHANNEL_LAYOUT_2POINT1: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(3, AV_CH_LAYOUT_2POINT1);
121+
pub const AV_CHANNEL_LAYOUT_2_1: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(3, AV_CH_LAYOUT_2_1);
122+
pub const AV_CHANNEL_LAYOUT_SURROUND: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(3, AV_CH_LAYOUT_SURROUND);
123+
pub const AV_CHANNEL_LAYOUT_3POINT1: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(4, AV_CH_LAYOUT_3POINT1);
124+
pub const AV_CHANNEL_LAYOUT_4POINT0: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(4, AV_CH_LAYOUT_4POINT0);
125+
pub const AV_CHANNEL_LAYOUT_4POINT1: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(5, AV_CH_LAYOUT_4POINT1);
126+
pub const AV_CHANNEL_LAYOUT_2_2: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(4, AV_CH_LAYOUT_2_2);
127+
pub const AV_CHANNEL_LAYOUT_QUAD: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(4, AV_CH_LAYOUT_QUAD);
128+
pub const AV_CHANNEL_LAYOUT_5POINT0: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(5, AV_CH_LAYOUT_5POINT0);
129+
pub const AV_CHANNEL_LAYOUT_5POINT1: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(6, AV_CH_LAYOUT_5POINT1);
130+
pub const AV_CHANNEL_LAYOUT_5POINT0_BACK: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(5, AV_CH_LAYOUT_5POINT0_BACK);
131+
pub const AV_CHANNEL_LAYOUT_5POINT1_BACK: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(6, AV_CH_LAYOUT_5POINT1_BACK);
132+
pub const AV_CHANNEL_LAYOUT_6POINT0: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(6, AV_CH_LAYOUT_6POINT0);
133+
pub const AV_CHANNEL_LAYOUT_6POINT0_FRONT: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(6, AV_CH_LAYOUT_6POINT0_FRONT);
134+
pub const AV_CHANNEL_LAYOUT_3POINT1POINT2: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(6, AV_CH_LAYOUT_3POINT1POINT2);
135+
pub const AV_CHANNEL_LAYOUT_HEXAGONAL: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(6, AV_CH_LAYOUT_HEXAGONAL);
136+
pub const AV_CHANNEL_LAYOUT_6POINT1: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(7, AV_CH_LAYOUT_6POINT1);
137+
pub const AV_CHANNEL_LAYOUT_6POINT1_BACK: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(7, AV_CH_LAYOUT_6POINT1_BACK);
138+
pub const AV_CHANNEL_LAYOUT_6POINT1_FRONT: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(7, AV_CH_LAYOUT_6POINT1_FRONT);
139+
pub const AV_CHANNEL_LAYOUT_7POINT0: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(7, AV_CH_LAYOUT_7POINT0);
140+
pub const AV_CHANNEL_LAYOUT_7POINT0_FRONT: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(7, AV_CH_LAYOUT_7POINT0_FRONT);
141+
pub const AV_CHANNEL_LAYOUT_7POINT1: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(8, AV_CH_LAYOUT_7POINT1);
142+
pub const AV_CHANNEL_LAYOUT_7POINT1_WIDE: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(8, AV_CH_LAYOUT_7POINT1_WIDE);
143+
pub const AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(8, AV_CH_LAYOUT_7POINT1_WIDE_BACK);
144+
pub const AV_CHANNEL_LAYOUT_5POINT1POINT2: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(8, AV_CH_LAYOUT_5POINT1POINT2);
145+
pub const AV_CHANNEL_LAYOUT_5POINT1POINT2_BACK: AVChannelLayout= AV_CHANNEL_LAYOUT_MASK!(8, AV_CH_LAYOUT_5POINT1POINT2_BACK);
146+
pub const AV_CHANNEL_LAYOUT_OCTAGONAL: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(8, AV_CH_LAYOUT_OCTAGONAL);
147+
pub const AV_CHANNEL_LAYOUT_CUBE: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(8, AV_CH_LAYOUT_CUBE);
148+
pub const AV_CHANNEL_LAYOUT_5POINT1POINT4_BACK: AVChannelLayout= AV_CHANNEL_LAYOUT_MASK!(10, AV_CH_LAYOUT_5POINT1POINT4_BACK);
149+
pub const AV_CHANNEL_LAYOUT_7POINT1POINT2: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(10, AV_CH_LAYOUT_7POINT1POINT2);
150+
pub const AV_CHANNEL_LAYOUT_7POINT1POINT4_BACK: AVChannelLayout= AV_CHANNEL_LAYOUT_MASK!(12, AV_CH_LAYOUT_7POINT1POINT4_BACK);
151+
pub const AV_CHANNEL_LAYOUT_7POINT2POINT3: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(12, AV_CH_LAYOUT_7POINT2POINT3);
152+
pub const AV_CHANNEL_LAYOUT_9POINT1POINT4_BACK: AVChannelLayout= AV_CHANNEL_LAYOUT_MASK!(14, AV_CH_LAYOUT_9POINT1POINT4_BACK);
153+
pub const AV_CHANNEL_LAYOUT_9POINT1POINT6: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(16, AV_CH_LAYOUT_9POINT1POINT6);
154+
pub const AV_CHANNEL_LAYOUT_HEXADECAGONAL: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(16, AV_CH_LAYOUT_HEXADECAGONAL);
155+
#[cfg(feature = "ffmpeg8")]
156+
pub const AV_CHANNEL_LAYOUT_BINAURAL: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(2, AV_CH_LAYOUT_BINAURAL);
157+
pub const AV_CHANNEL_LAYOUT_STEREO_DOWNMIX: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(2, AV_CH_LAYOUT_STEREO_DOWNMIX);
158+
pub const AV_CHANNEL_LAYOUT_22POINT2: AVChannelLayout = AV_CHANNEL_LAYOUT_MASK!(24, AV_CH_LAYOUT_22POINT2);
159+
160+
pub const AV_CHANNEL_LAYOUT_7POINT1_TOP_BACK: AVChannelLayout = AV_CHANNEL_LAYOUT_5POINT1POINT2_BACK;
161+
162+
// Special predefined (non-native order)
163+
pub const AV_CHANNEL_LAYOUT_AMBISONIC_FIRST_ORDER: AVChannelLayout = AVChannelLayout {
164+
order: AV_CHANNEL_ORDER_AMBISONIC,
165+
nb_channels: 4,
166+
u: AVChannelLayout__bindgen_ty_1 { mask: 0 },
167+
opaque: ::std::ptr::null_mut(),
168+
};

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)