]> git.nihav.org Git - nihav.git/blob - nihav-duck/src/codecs/mod.rs
vp3: rename in preparation for VP30 decoding
[nihav.git] / nihav-duck / src / codecs / mod.rs
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;
15 #[cfg(any(feature="decoder_vp3", feature="decoder_vp4"))]
16 mod vp3;
17 #[cfg(any(feature="decoder_vp5", feature="decoder_vp6"))]
18 mod vp56;
19 #[cfg(feature="decoder_vp7")]
20 mod vp7;
21 #[cfg(any(feature="decoder_vp3", feature="decoder_vp4", feature="decoder_vp5", feature="decoder_vp6", feature="decoder_vp7"))]
22 mod vpcommon;
23
24 #[cfg(any(feature="decoder_dk3_adpcm", feature="decoder_dk4_adpcm"))]
25 mod dkadpcm;
26 #[cfg(feature="decoder_on2avc")]
27 mod on2avc;
28
29 const DUCK_CODECS: &[DecoderInfo] = &[
30 #[cfg(feature="decoder_truemotion1")]
31 DecoderInfo { name: "truemotion1", get_decoder: truemotion1::get_decoder },
32 #[cfg(feature="decoder_truemotionrt")]
33 DecoderInfo { name: "truemotionrt", get_decoder: truemotionrt::get_decoder },
34 #[cfg(feature="decoder_truemotion2")]
35 DecoderInfo { name: "truemotion2", get_decoder: truemotion2::get_decoder },
36 #[cfg(feature="decoder_truemotion2x")]
37 DecoderInfo { name: "truemotion2x", get_decoder: truemotion2x::get_decoder },
38 #[cfg(feature="decoder_vp3")]
39 DecoderInfo { name: "vp3", get_decoder: vp3::get_decoder_vp3 },
40 #[cfg(feature="decoder_vp4")]
41 DecoderInfo { name: "vp4", get_decoder: vp3::get_decoder_vp4 },
42 #[cfg(feature="decoder_vp5")]
43 DecoderInfo { name: "vp5", get_decoder: vp56::get_decoder_vp5 },
44 #[cfg(feature="decoder_vp6")]
45 DecoderInfo { name: "vp6", get_decoder: vp56::get_decoder_vp6 },
46 #[cfg(feature="decoder_vp7")]
47 DecoderInfo { name: "vp7", get_decoder: vp7::get_decoder },
48
49 #[cfg(feature="decoder_dk3_adpcm")]
50 DecoderInfo { name: "adpcm-dk3", get_decoder: dkadpcm::get_decoder_dk3 },
51 #[cfg(feature="decoder_dk4_adpcm")]
52 DecoderInfo { name: "adpcm-dk4", get_decoder: dkadpcm::get_decoder_dk4 },
53 #[cfg(feature="decoder_on2avc")]
54 DecoderInfo { name: "on2avc-500", get_decoder: on2avc::get_decoder_500 },
55 #[cfg(feature="decoder_on2avc")]
56 DecoderInfo { name: "on2avc-501", get_decoder: on2avc::get_decoder_501 },
57 ];
58
59 pub fn duck_register_all_codecs(rd: &mut RegisteredDecoders) {
60 for decoder in DUCK_CODECS.iter() {
61 rd.add_decoder(decoder.clone());
62 }
63 }