1 | use ffi::AVFieldOrder::*; |
2 | use ffi::*; |
3 | |
4 | #[derive (Eq, PartialEq, Clone, Copy, Debug)] |
5 | pub enum FieldOrder { |
6 | Unknown, |
7 | Progressive, |
8 | TT, |
9 | BB, |
10 | TB, |
11 | BT, |
12 | } |
13 | |
14 | impl From<AVFieldOrder> for FieldOrder { |
15 | fn from(value: AVFieldOrder) -> Self { |
16 | match value { |
17 | AV_FIELD_UNKNOWN => FieldOrder::Unknown, |
18 | AV_FIELD_PROGRESSIVE => FieldOrder::Progressive, |
19 | AV_FIELD_TT => FieldOrder::TT, |
20 | AV_FIELD_BB => FieldOrder::BB, |
21 | AV_FIELD_TB => FieldOrder::TB, |
22 | AV_FIELD_BT => FieldOrder::BT, |
23 | } |
24 | } |
25 | } |
26 | |
27 | impl From<FieldOrder> for AVFieldOrder { |
28 | fn from(value: FieldOrder) -> AVFieldOrder { |
29 | match value { |
30 | FieldOrder::Unknown => AV_FIELD_UNKNOWN, |
31 | FieldOrder::Progressive => AV_FIELD_PROGRESSIVE, |
32 | FieldOrder::TT => AV_FIELD_TT, |
33 | FieldOrder::BB => AV_FIELD_BB, |
34 | FieldOrder::TB => AV_FIELD_TB, |
35 | FieldOrder::BT => AV_FIELD_BT, |
36 | } |
37 | } |
38 | } |
39 | |