]> git.nihav.org Git - nihav.git/blob - nihav-indeo/src/codecs/mod.rs
a5a8ec3bbd3ec67eb9a2e4ab82a8dc74eba6bbbe
[nihav.git] / nihav-indeo / 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_intel263")]
8 mod intel263;
9 #[cfg(feature="decoder_indeo2")]
10 mod indeo2;
11 #[cfg(feature="decoder_indeo3")]
12 mod indeo3;
13 #[cfg(feature="decoder_indeo4")]
14 mod indeo4;
15 #[cfg(feature="decoder_indeo5")]
16 mod indeo5;
17
18 #[cfg(any(feature="decoder_indeo4", feature="decoder_indeo5"))]
19 mod ivi;
20 #[cfg(any(feature="decoder_indeo4", feature="decoder_indeo5"))]
21 mod ivibr;
22 #[cfg(any(feature="decoder_indeo4", feature="decoder_indeo5"))]
23 #[allow(clippy::erasing_op)]
24 mod ividsp;
25
26 #[cfg(feature="decoder_imc")]
27 #[allow(clippy::excessive_precision)]
28 #[allow(clippy::unreadable_literal)]
29 mod imc;
30
31 const INDEO_CODECS: &[DecoderInfo] = &[
32 #[cfg(feature="decoder_indeo2")]
33 DecoderInfo { name: "indeo2", get_decoder: indeo2::get_decoder },
34 #[cfg(feature="decoder_indeo3")]
35 DecoderInfo { name: "indeo3", get_decoder: indeo3::get_decoder },
36 #[cfg(feature="decoder_indeo4")]
37 DecoderInfo { name: "indeo4", get_decoder: indeo4::get_decoder },
38 #[cfg(feature="decoder_indeo5")]
39 DecoderInfo { name: "indeo5", get_decoder: indeo5::get_decoder },
40 #[cfg(feature="decoder_intel263")]
41 DecoderInfo { name: "intel263", get_decoder: intel263::get_decoder },
42
43 #[cfg(feature="decoder_imc")]
44 DecoderInfo { name: "imc", get_decoder: imc::get_decoder_imc },
45 #[cfg(feature="decoder_imc")]
46 DecoderInfo { name: "iac", get_decoder: imc::get_decoder_iac },
47 ];
48
49 /// Registers all available codecs provided by this crate.
50 pub fn indeo_register_all_decoders(rd: &mut RegisteredDecoders) {
51 for decoder in INDEO_CODECS.iter() {
52 rd.add_decoder(*decoder);
53 }
54 }