]>
Commit | Line | Data |
---|---|---|
1b8522d6 KS |
1 | use nihav_core::codecs::*; |
2 | ||
3 | macro_rules! validate { | |
4 | ($a:expr) => { if !$a { println!("check failed at {}:{}", file!(), line!()); return Err(DecoderError::InvalidData); } }; | |
5 | } | |
6 | ||
7 | #[cfg(feature="decoder_truemotion1")] | |
8 | mod truemotion1; | |
9 | #[cfg(feature="decoder_truemotionrt")] | |
10 | mod truemotionrt; | |
11 | #[cfg(feature="decoder_truemotion2")] | |
12 | mod truemotion2; | |
13 | #[cfg(feature="decoder_truemotion2x")] | |
14 | mod truemotion2x; | |
3584b223 KS |
15 | #[cfg(any(feature="decoder_vp3", feature="decoder_vp4", feature="decoder_vp5", feature="decoder_vp6", feature="decoder_vp7"))] |
16 | #[macro_use] | |
17 | mod vpcommon; | |
40e95291 KS |
18 | #[cfg(any(feature="decoder_vp3", feature="decoder_vp4"))] |
19 | mod vp3; | |
20 | #[cfg(any(feature="decoder_vp5", feature="decoder_vp6"))] | |
21 | mod vp56; | |
3584b223 KS |
22 | #[cfg(feature="decoder_vp5")] |
23 | mod vp5; | |
24 | #[cfg(feature="decoder_vp6")] | |
25 | mod vp6; | |
40e95291 KS |
26 | #[cfg(feature="decoder_vp7")] |
27 | mod vp7; | |
587a6d78 KS |
28 | #[cfg(feature="decoder_vp7")] |
29 | mod vp7data; | |
30 | #[cfg(feature="decoder_vp7")] | |
31 | mod vp7dsp; | |
1b8522d6 | 32 | |
029d2552 KS |
33 | #[cfg(any(feature="decoder_dk3_adpcm", feature="decoder_dk4_adpcm"))] |
34 | mod dkadpcm; | |
1b8522d6 KS |
35 | #[cfg(feature="decoder_on2avc")] |
36 | mod on2avc; | |
6a494288 KS |
37 | #[cfg(feature="decoder_on2avc")] |
38 | mod on2avcdata; | |
1b8522d6 KS |
39 | |
40 | const DUCK_CODECS: &[DecoderInfo] = &[ | |
41 | #[cfg(feature="decoder_truemotion1")] | |
42 | DecoderInfo { name: "truemotion1", get_decoder: truemotion1::get_decoder }, | |
43 | #[cfg(feature="decoder_truemotionrt")] | |
44 | DecoderInfo { name: "truemotionrt", get_decoder: truemotionrt::get_decoder }, | |
45 | #[cfg(feature="decoder_truemotion2")] | |
46 | DecoderInfo { name: "truemotion2", get_decoder: truemotion2::get_decoder }, | |
47 | #[cfg(feature="decoder_truemotion2x")] | |
48 | DecoderInfo { name: "truemotion2x", get_decoder: truemotion2x::get_decoder }, | |
40e95291 KS |
49 | #[cfg(feature="decoder_vp3")] |
50 | DecoderInfo { name: "vp3", get_decoder: vp3::get_decoder_vp3 }, | |
51 | #[cfg(feature="decoder_vp4")] | |
52 | DecoderInfo { name: "vp4", get_decoder: vp3::get_decoder_vp4 }, | |
53 | #[cfg(feature="decoder_vp5")] | |
3584b223 KS |
54 | DecoderInfo { name: "vp5", get_decoder: vp5::get_decoder }, |
55 | #[cfg(feature="decoder_vp6")] | |
56 | DecoderInfo { name: "vp6", get_decoder: vp6::get_decoder_vp6 }, | |
40e95291 | 57 | #[cfg(feature="decoder_vp6")] |
3584b223 | 58 | DecoderInfo { name: "vp6a", get_decoder: vp6::get_decoder_vp6_alpha }, |
40e95291 KS |
59 | #[cfg(feature="decoder_vp7")] |
60 | DecoderInfo { name: "vp7", get_decoder: vp7::get_decoder }, | |
1b8522d6 | 61 | |
029d2552 KS |
62 | #[cfg(feature="decoder_dk3_adpcm")] |
63 | DecoderInfo { name: "adpcm-dk3", get_decoder: dkadpcm::get_decoder_dk3 }, | |
64 | #[cfg(feature="decoder_dk4_adpcm")] | |
65 | DecoderInfo { name: "adpcm-dk4", get_decoder: dkadpcm::get_decoder_dk4 }, | |
1b8522d6 KS |
66 | #[cfg(feature="decoder_on2avc")] |
67 | DecoderInfo { name: "on2avc-500", get_decoder: on2avc::get_decoder_500 }, | |
68 | #[cfg(feature="decoder_on2avc")] | |
69 | DecoderInfo { name: "on2avc-501", get_decoder: on2avc::get_decoder_501 }, | |
70 | ]; | |
71 | ||
72 | pub fn duck_register_all_codecs(rd: &mut RegisteredDecoders) { | |
8a7352c0 | 73 | for decoder in DUCK_CODECS.iter() { |
1b8522d6 KS |
74 | rd.add_decoder(decoder.clone()); |
75 | } | |
76 | } |