]> git.nihav.org Git - nihav.git/blame - nihav-indeo/src/codecs/mod.rs
prepare for implementing scalable Indeo 5
[nihav.git] / nihav-indeo / src / codecs / mod.rs
CommitLineData
5641dccf
KS
1use nihav_core::codecs::*;
2
3macro_rules! validate {
4 ($a:expr) => { if !$a { println!("check failed at {}:{}", file!(), line!()); return Err(DecoderError::InvalidData); } };
5}
6
7#[cfg(feature="decoder_intel263")]
8mod intel263;
9#[cfg(feature="decoder_indeo2")]
10mod indeo2;
11#[cfg(feature="decoder_indeo3")]
12mod indeo3;
13#[cfg(feature="decoder_indeo4")]
14mod indeo4;
15#[cfg(feature="decoder_indeo5")]
16mod indeo5;
17
18#[cfg(any(feature="decoder_indeo4", feature="decoder_indeo5"))]
19mod ivi;
20#[cfg(any(feature="decoder_indeo4", feature="decoder_indeo5"))]
21mod ivibr;
22#[cfg(any(feature="decoder_indeo4", feature="decoder_indeo5"))]
c2a4fa57 23#[allow(clippy::erasing_op)]
5641dccf
KS
24mod ividsp;
25
26#[cfg(feature="decoder_imc")]
f2af8eca
KS
27#[allow(clippy::excessive_precision)]
28#[allow(clippy::unreadable_literal)]
5641dccf
KS
29mod imc;
30
31const 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 },
f7686373
KS
40#[cfg(feature="decoder_indeo5")]
41 DecoderInfo { name: "indeo5s", get_decoder: indeo5::get_decoder_scalable },
5641dccf
KS
42#[cfg(feature="decoder_intel263")]
43 DecoderInfo { name: "intel263", get_decoder: intel263::get_decoder },
44
45#[cfg(feature="decoder_imc")]
46 DecoderInfo { name: "imc", get_decoder: imc::get_decoder_imc },
47#[cfg(feature="decoder_imc")]
48 DecoderInfo { name: "iac", get_decoder: imc::get_decoder_iac },
49];
50
e64739f8 51/// Registers all available codecs provided by this crate.
78fb6560 52pub fn indeo_register_all_decoders(rd: &mut RegisteredDecoders) {
f2af8eca 53 for decoder in INDEO_CODECS.iter() {
b7c882c1 54 rd.add_decoder(*decoder);
5641dccf
KS
55 }
56}