]> git.nihav.org Git - nihav.git/blame - nihav-game/src/codecs/mod.rs
nihav_registry: fix clippy warnings and tests in detect module
[nihav.git] / nihav-game / src / codecs / mod.rs
CommitLineData
5641dccf
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
9067c1f8
KS
7#[cfg(feature="decoder_bmv")]
8pub mod bmv;
ecda1cc1
KS
9#[cfg(feature="decoder_bmv3")]
10pub mod bmv3;
8d91d85f
KS
11#[cfg(any(feature="decoder_fstvid",feature="decoder_fstaud"))]
12pub mod futurevision;
5641dccf
KS
13#[cfg(feature="decoder_gdvvid")]
14pub mod gremlinvideo;
3813fe8a
KS
15#[cfg(feature="decoder_imax")]
16pub mod imax;
3e52414f
KS
17#[cfg(feature="decoder_lhst500f22")]
18pub mod lhst500f22;
801bba83
KS
19#[cfg(feature="decoder_midivid")]
20pub mod midivid;
f42a4a86
KS
21#[cfg(feature="decoder_midivid3")]
22pub mod midivid3;
9895bd7b
KS
23#[cfg(feature="decoder_vmd")]
24pub mod vmd;
55d85231 25#[cfg(feature="decoder_vx")]
016340a0
KS
26#[allow(clippy::erasing_op)]
27#[allow(clippy::identity_op)]
55d85231 28pub mod vx;
5641dccf
KS
29
30const GAME_CODECS: &[DecoderInfo] = &[
31#[cfg(feature="decoder_gdvvid")]
32 DecoderInfo { name: "gdv-audio", get_decoder: gremlinvideo::get_decoder_audio },
33#[cfg(feature="decoder_gdvvid")]
34 DecoderInfo { name: "gdv-video", get_decoder: gremlinvideo::get_decoder_video },
9067c1f8
KS
35#[cfg(feature="decoder_bmv")]
36 DecoderInfo { name: "bmv-audio", get_decoder: bmv::get_decoder_audio },
37#[cfg(feature="decoder_bmv")]
38 DecoderInfo { name: "bmv-video", get_decoder: bmv::get_decoder_video },
ecda1cc1
KS
39#[cfg(feature="decoder_bmv3")]
40 DecoderInfo { name: "bmv3-audio", get_decoder: bmv3::get_decoder_audio },
41#[cfg(feature="decoder_bmv3")]
42 DecoderInfo { name: "bmv3-video", get_decoder: bmv3::get_decoder_video },
8d91d85f
KS
43#[cfg(feature="decoder_fstaud")]
44 DecoderInfo { name: "fst-audio", get_decoder: futurevision::get_decoder_audio },
45#[cfg(feature="decoder_fstvid")]
46 DecoderInfo { name: "fst-video", get_decoder: futurevision::get_decoder_video },
3813fe8a
KS
47#[cfg(feature="decoder_imax")]
48 DecoderInfo { name: "fable-imax", get_decoder: imax::get_decoder },
9895bd7b
KS
49#[cfg(feature="decoder_vmd")]
50 DecoderInfo { name: "vmd-audio", get_decoder: vmd::get_decoder_audio },
51#[cfg(feature="decoder_vmd")]
52 DecoderInfo { name: "vmd-video", get_decoder: vmd::get_decoder_video },
3e52414f
KS
53#[cfg(feature="decoder_lhst500f22")]
54 DecoderInfo { name: "lhst500f22", get_decoder: lhst500f22::get_decoder },
801bba83
KS
55#[cfg(feature="decoder_midivid")]
56 DecoderInfo { name: "midivid", get_decoder: midivid::get_decoder_video },
f42a4a86
KS
57#[cfg(feature="decoder_midivid3")]
58 DecoderInfo { name: "midivid3", get_decoder: midivid3::get_decoder_video },
55d85231
KS
59#[cfg(feature="decoder_vx")]
60 DecoderInfo { name: "vxaudio", get_decoder: vx::get_decoder_audio },
61#[cfg(feature="decoder_vx")]
62 DecoderInfo { name: "vxvideo", get_decoder: vx::get_decoder_video },
5641dccf
KS
63];
64
e64739f8 65/// Registers all available codecs provided by this crate.
78fb6560 66pub fn game_register_all_decoders(rd: &mut RegisteredDecoders) {
e69b1148 67 for decoder in GAME_CODECS.iter() {
5641dccf
KS
68 rd.add_decoder(decoder.clone());
69 }
70}