]> git.nihav.org Git - nihav.git/blob - mod.rs
fde660144eca543b3bbad99eadee77b57828d8f3
[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_bmv")]
8 pub mod bmv;
9 #[cfg(feature="decoder_gdvvid")]
10 pub mod gremlinvideo;
11 #[cfg(feature="decoder_vmd")]
12 pub mod vmd;
13
14 const GAME_CODECS: &[DecoderInfo] = &[
15 #[cfg(feature="decoder_gdvvid")]
16 DecoderInfo { name: "gdv-audio", get_decoder: gremlinvideo::get_decoder_audio },
17 #[cfg(feature="decoder_gdvvid")]
18 DecoderInfo { name: "gdv-video", get_decoder: gremlinvideo::get_decoder_video },
19 #[cfg(feature="decoder_bmv")]
20 DecoderInfo { name: "bmv-audio", get_decoder: bmv::get_decoder_audio },
21 #[cfg(feature="decoder_bmv")]
22 DecoderInfo { name: "bmv-video", get_decoder: bmv::get_decoder_video },
23 #[cfg(feature="decoder_vmd")]
24 DecoderInfo { name: "vmd-audio", get_decoder: vmd::get_decoder_audio },
25 #[cfg(feature="decoder_vmd")]
26 DecoderInfo { name: "vmd-video", get_decoder: vmd::get_decoder_video },
27 ];
28
29 pub fn game_register_all_codecs(rd: &mut RegisteredDecoders) {
30 for decoder in GAME_CODECS.into_iter() {
31 rd.add_decoder(decoder.clone());
32 }
33 }