]> git.nihav.org Git - nihav.git/blob - nihav-rad/src/codecs/mod.rs
avimux: always write positive height in stream properties
[nihav.git] / nihav-rad / 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(any(feature="decoder_smkaud", feature="decoder_smkvid"))]
8 mod smacker;
9 #[cfg(feature="decoder_binkaud")]
10 mod binkaud;
11 #[cfg(feature="decoder_binkvid")]
12 mod binkvid;
13 #[cfg(feature="decoder_bink2")]
14 mod bink2;
15
16 const RAD_CODECS: &[DecoderInfo] = &[
17 #[cfg(feature="decoder_smkaud")]
18 DecoderInfo { name: "smacker-audio", get_decoder: smacker::get_decoder_audio },
19 #[cfg(feature="decoder_smkvid")]
20 DecoderInfo { name: "smacker-video", get_decoder: smacker::get_decoder_video },
21 #[cfg(feature="decoder_binkaud")]
22 DecoderInfo { name: "bink-audio-dct", get_decoder: binkaud::get_decoder_dct },
23 #[cfg(feature="decoder_binkaud")]
24 DecoderInfo { name: "bink-audio-rdft", get_decoder: binkaud::get_decoder_rdft },
25 #[cfg(feature="decoder_binkvid")]
26 DecoderInfo { name: "bink-video", get_decoder: binkvid::get_decoder },
27 #[cfg(feature="decoder_bink2")]
28 DecoderInfo { name: "bink2-video", get_decoder: bink2::get_decoder },
29 ];
30
31 /// Registers all available codecs provided by this crate.
32 pub fn rad_register_all_decoders(rd: &mut RegisteredDecoders) {
33 for decoder in RAD_CODECS.iter() {
34 rd.add_decoder(*decoder);
35 }
36 }