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