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(feature="decoder_bmv")]
9 #[cfg(feature="decoder_bmv3")]
11 #[cfg(feature="decoder_gdvvid")]
13 #[cfg(feature="decoder_lhst500f22")]
15 #[cfg(feature="decoder_midivid")]
17 #[cfg(feature="decoder_midivid3")]
19 #[cfg(feature="decoder_vmd")]
21 #[cfg(feature="decoder_vx")]
22 #[allow(clippy::erasing_op)]
23 #[allow(clippy::identity_op)]
26 const GAME_CODECS: &[DecoderInfo] = &[
27 #[cfg(feature="decoder_gdvvid")]
28 DecoderInfo { name: "gdv-audio", get_decoder: gremlinvideo::get_decoder_audio },
29 #[cfg(feature="decoder_gdvvid")]
30 DecoderInfo { name: "gdv-video", get_decoder: gremlinvideo::get_decoder_video },
31 #[cfg(feature="decoder_bmv")]
32 DecoderInfo { name: "bmv-audio", get_decoder: bmv::get_decoder_audio },
33 #[cfg(feature="decoder_bmv")]
34 DecoderInfo { name: "bmv-video", get_decoder: bmv::get_decoder_video },
35 #[cfg(feature="decoder_bmv3")]
36 DecoderInfo { name: "bmv3-audio", get_decoder: bmv3::get_decoder_audio },
37 #[cfg(feature="decoder_bmv3")]
38 DecoderInfo { name: "bmv3-video", get_decoder: bmv3::get_decoder_video },
39 #[cfg(feature="decoder_vmd")]
40 DecoderInfo { name: "vmd-audio", get_decoder: vmd::get_decoder_audio },
41 #[cfg(feature="decoder_vmd")]
42 DecoderInfo { name: "vmd-video", get_decoder: vmd::get_decoder_video },
43 #[cfg(feature="decoder_lhst500f22")]
44 DecoderInfo { name: "lhst500f22", get_decoder: lhst500f22::get_decoder },
45 #[cfg(feature="decoder_midivid")]
46 DecoderInfo { name: "midivid", get_decoder: midivid::get_decoder_video },
47 #[cfg(feature="decoder_midivid3")]
48 DecoderInfo { name: "midivid3", get_decoder: midivid3::get_decoder_video },
49 #[cfg(feature="decoder_vx")]
50 DecoderInfo { name: "vxaudio", get_decoder: vx::get_decoder_audio },
51 #[cfg(feature="decoder_vx")]
52 DecoderInfo { name: "vxvideo", get_decoder: vx::get_decoder_video },
55 /// Registers all available codecs provided by this crate.
56 pub fn game_register_all_decoders(rd: &mut RegisteredDecoders) {
57 for decoder in GAME_CODECS.iter() {
58 rd.add_decoder(decoder.clone());