]> git.nihav.org Git - nihav.git/blob - mod.rs
1421613ca40f432b1d353d2fd6b6ef99d52dcd42
[nihav.git] / 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_clearvideo")]
8 mod clearvideo;
9
10 #[cfg(feature="decoder_aac")]
11 mod aac;
12 #[cfg(feature="decoder_atrac3")]
13 mod atrac3;
14 #[cfg(feature="decoder_pcm")]
15 mod pcm;
16 #[cfg(feature="decoder_sipro")]
17 mod sipro;
18 #[cfg(feature="decoder_ts102366")]
19 mod ts102366;
20
21 const DECODERS: &[DecoderInfo] = &[
22 #[cfg(feature="decoder_clearvideo")]
23 DecoderInfo { name: "clearvideo", get_decoder: clearvideo::get_decoder },
24 #[cfg(feature="decoder_clearvideo")]
25 DecoderInfo { name: "clearvideo_rm", get_decoder: clearvideo::get_decoder_rm },
26
27 #[cfg(feature="decoder_pcm")]
28 DecoderInfo { name: "pcm", get_decoder: pcm::get_decoder },
29 #[cfg(feature="decoder_sipro")]
30 DecoderInfo { name: "sipro", get_decoder: sipro::get_decoder },
31 #[cfg(feature="decoder_ts102366")]
32 DecoderInfo { name: "ac3", get_decoder: ts102366::get_decoder },
33 #[cfg(feature="decoder_atrac3")]
34 DecoderInfo { name: "atrac3", get_decoder: atrac3::get_decoder },
35 #[cfg(feature="decoder_aac")]
36 DecoderInfo { name: "aac", get_decoder: aac::get_decoder },
37 ];
38
39 /// Registers all available codecs provided by this crate.
40 pub fn generic_register_all_codecs(rd: &mut RegisteredDecoders) {
41 for decoder in DECODERS.iter() {
42 rd.add_decoder(decoder.clone());
43 }
44 }