]> git.nihav.org Git - nihav.git/blame - nihav-rad/src/codecs/mod.rs
Bink audio decoder (semi-working)
[nihav.git] / nihav-rad / src / codecs / mod.rs
CommitLineData
606c448e
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(any(feature="decoder_smkaud", feature="decoder_smkvid"))]
8mod smacker;
9#[cfg(feature="decoder_binkaud")]
10mod binkaud;
11#[cfg(feature="decoder_binkvid")]
12mod binkvid;
13#[cfg(feature="decoder_bink2")]
14mod bink2;
15
16const 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
31pub fn rad_register_all_codecs(rd: &mut RegisteredDecoders) {
32 for decoder in RAD_CODECS.into_iter() {
33 rd.add_decoder(decoder.clone());
34 }
35}