1 use nihav_core::codecs::*;
3 macro_rules! validate {
4 ($a:expr) => { if !$a { println!("check failed at {}:{}", file!(), line!()); return Err(DecoderError::InvalidData); } };
7 #[cfg(any(feature="decoder_smkaud", feature="decoder_smkvid"))]
9 #[cfg(feature="decoder_binkaud")]
11 #[cfg(feature="decoder_binkvid")]
13 #[cfg(feature="decoder_bink2")]
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 },
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);