]> git.nihav.org Git - nihav.git/blame - nihav-rad/src/codecs/mod.rs
vp6enc: allow setting codec version
[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
e64739f8 31/// Registers all available codecs provided by this crate.
78fb6560 32pub fn rad_register_all_decoders(rd: &mut RegisteredDecoders) {
7e6086e5 33 for decoder in RAD_CODECS.iter() {
b7c882c1 34 rd.add_decoder(*decoder);
606c448e
KS
35 }
36}