ffmpeg_the_third/util/channel_layout/
order.rs1use crate::ffi::AVChannelOrder;
2
3use AVChannelOrder::*;
4use ChannelOrder::*;
5
6#[derive(Debug, Clone, Copy, PartialEq, Eq)]
8pub enum ChannelOrder {
9 Unspecified,
11
12 Native,
15
16 Custom,
20
21 Ambisonic,
23}
24
25impl From<AVChannelOrder> for ChannelOrder {
26 fn from(value: AVChannelOrder) -> Self {
27 match value {
28 AV_CHANNEL_ORDER_UNSPEC => Unspecified,
29 AV_CHANNEL_ORDER_NATIVE => Native,
30 AV_CHANNEL_ORDER_CUSTOM => Custom,
31 AV_CHANNEL_ORDER_AMBISONIC => Ambisonic,
32 #[cfg(feature = "ffmpeg_7_0")]
33 FF_CHANNEL_ORDER_NB => unreachable!(),
35 #[cfg(feature = "non-exhaustive-enums")]
36 _ => unimplemented!(),
37 }
38 }
39}
40
41impl From<ChannelOrder> for AVChannelOrder {
42 fn from(value: ChannelOrder) -> Self {
43 match value {
44 Unspecified => AV_CHANNEL_ORDER_UNSPEC,
45 Native => AV_CHANNEL_ORDER_NATIVE,
46 Custom => AV_CHANNEL_ORDER_CUSTOM,
47 Ambisonic => AV_CHANNEL_ORDER_AMBISONIC,
48 }
49 }
50}