1 | use ffi::AVDiscard::*; |
2 | use ffi::*; |
3 | |
4 | #[derive (Eq, PartialEq, Clone, Copy, Debug)] |
5 | pub enum Discard { |
6 | None, |
7 | Default, |
8 | NonReference, |
9 | Bidirectional, |
10 | NonIntra, |
11 | NonKey, |
12 | All, |
13 | } |
14 | |
15 | impl From<AVDiscard> for Discard { |
16 | fn from(value: AVDiscard) -> Self { |
17 | match value { |
18 | AVDISCARD_NONE => Discard::None, |
19 | AVDISCARD_DEFAULT => Discard::Default, |
20 | AVDISCARD_NONREF => Discard::NonReference, |
21 | AVDISCARD_BIDIR => Discard::Bidirectional, |
22 | AVDISCARD_NONINTRA => Discard::NonIntra, |
23 | AVDISCARD_NONKEY => Discard::NonKey, |
24 | AVDISCARD_ALL => Discard::All, |
25 | } |
26 | } |
27 | } |
28 | |
29 | impl From<Discard> for AVDiscard { |
30 | fn from(value: Discard) -> AVDiscard { |
31 | match value { |
32 | Discard::None => AVDISCARD_NONE, |
33 | Discard::Default => AVDISCARD_DEFAULT, |
34 | Discard::NonReference => AVDISCARD_NONREF, |
35 | Discard::Bidirectional => AVDISCARD_BIDIR, |
36 | Discard::NonIntra => AVDISCARD_NONINTRA, |
37 | Discard::NonKey => AVDISCARD_NONKEY, |
38 | Discard::All => AVDISCARD_ALL, |
39 | } |
40 | } |
41 | } |
42 | |