add (limited) support for Digital Pictures SGA format
[nihav.git] / nihav-game / src / demuxers / mod.rs
CommitLineData
5641dccf
KS
1use nihav_core::demuxers::*;
2
674ebc33 3#[allow(unused_macros)]
71d7f397 4#[cfg(debug_assertions)]
5641dccf
KS
5macro_rules! validate {
6 ($a:expr) => { if !$a { println!("check failed at {}:{}", file!(), line!()); return Err(DemuxerError::InvalidData); } };
7}
71d7f397
KS
8#[cfg(not(debug_assertions))]
9macro_rules! validate {
10 ($a:expr) => { if !$a { return Err(DemuxerError::InvalidData); } };
11}
5641dccf 12
ecda1cc1 13#[cfg(any(feature="demuxer_bmv",feature="demuxer_bmv3"))]
9067c1f8 14mod bmv;
1991b7da
KS
15#[cfg(feature="demuxer_cnm")]
16mod cnm;
8d91d85f
KS
17#[cfg(any(feature="demuxer_fst",feature="demuxer_fcmp"))]
18mod fst;
5641dccf
KS
19#[cfg(feature="demuxer_gdv")]
20mod gdv;
ff6a914f
KS
21#[cfg(feature="demuxer_hl_fmv")]
22mod hl_fmv;
3813fe8a
KS
23#[cfg(feature="demuxer_imax")]
24mod imax;
afe1e5ba
KS
25#[cfg(feature="demuxer_q")]
26mod q;
fead60e3
KS
27#[cfg(feature="demuxer_sga")]
28mod sga;
561d0f79
KS
29#[cfg(feature="demuxer_siff")]
30mod siff;
c17769db
KS
31#[cfg(feature="demuxer_smush")]
32mod smush;
9895bd7b
KS
33#[cfg(feature="demuxer_vmd")]
34mod vmd;
55d85231
KS
35#[cfg(feature="demuxer_vx")]
36mod vx;
5641dccf 37
ac818eac 38const GAME_DEMUXERS: &[&dyn DemuxerCreator] = &[
9067c1f8
KS
39#[cfg(feature="demuxer_bmv")]
40 &bmv::BMVDemuxerCreator {},
ecda1cc1
KS
41#[cfg(feature="demuxer_bmv3")]
42 &bmv::BMV3DemuxerCreator {},
1991b7da
KS
43#[cfg(feature="demuxer_cnm")]
44 &cnm::CNMDemuxerCreator {},
8d91d85f
KS
45#[cfg(feature="demuxer_fcmp")]
46 &fst::FCMPDemuxerCreator {},
47#[cfg(feature="demuxer_fst")]
48 &fst::FSTDemuxerCreator {},
5641dccf
KS
49#[cfg(feature="demuxer_gdv")]
50 &gdv::GDVDemuxerCreator {},
ff6a914f
KS
51#[cfg(feature="demuxer_hl_fmv")]
52 &hl_fmv::HighlanderFMVDemuxerCreator {},
3813fe8a
KS
53#[cfg(feature="demuxer_imax")]
54 &imax::IMAXDemuxerCreator {},
afe1e5ba
KS
55#[cfg(feature="demuxer_q")]
56 &q::QDemuxerCreator {},
fead60e3
KS
57#[cfg(feature="demuxer_sga")]
58 &sga::SGADemuxerCreator {},
561d0f79
KS
59#[cfg(feature="demuxer_siff")]
60 &siff::SIFFDemuxerCreator {},
c17769db
KS
61#[cfg(feature="demuxer_smush")]
62 &smush::SmushDemuxerCreator {},
9e08bfdd
KS
63#[cfg(feature="demuxer_smush")]
64 &smush::MCMPDemuxerCreator {},
9895bd7b
KS
65#[cfg(feature="demuxer_vmd")]
66 &vmd::VMDDemuxerCreator {},
55d85231
KS
67#[cfg(feature="demuxer_vx")]
68 &vx::VXDemuxerCreator {},
5641dccf
KS
69];
70
e64739f8 71/// Registers all available demuxers provided by this crate.
5641dccf 72pub fn game_register_all_demuxers(rd: &mut RegisteredDemuxers) {
e69b1148 73 for demuxer in GAME_DEMUXERS.iter() {
5641dccf
KS
74 rd.add_demuxer(*demuxer);
75 }
76}