]>
Commit | Line | Data |
---|---|---|
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_bmv3")] | |
10 | pub mod bmv3; | |
11 | #[cfg(feature="decoder_gdvvid")] | |
12 | pub mod gremlinvideo; | |
13 | #[cfg(feature="decoder_midivid")] | |
14 | pub mod midivid; | |
15 | #[cfg(feature="decoder_vmd")] | |
16 | pub mod vmd; | |
17 | ||
18 | const GAME_CODECS: &[DecoderInfo] = &[ | |
19 | #[cfg(feature="decoder_gdvvid")] | |
20 | DecoderInfo { name: "gdv-audio", get_decoder: gremlinvideo::get_decoder_audio }, | |
21 | #[cfg(feature="decoder_gdvvid")] | |
22 | DecoderInfo { name: "gdv-video", get_decoder: gremlinvideo::get_decoder_video }, | |
23 | #[cfg(feature="decoder_bmv")] | |
24 | DecoderInfo { name: "bmv-audio", get_decoder: bmv::get_decoder_audio }, | |
25 | #[cfg(feature="decoder_bmv")] | |
26 | DecoderInfo { name: "bmv-video", get_decoder: bmv::get_decoder_video }, | |
27 | #[cfg(feature="decoder_bmv3")] | |
28 | DecoderInfo { name: "bmv3-audio", get_decoder: bmv3::get_decoder_audio }, | |
29 | #[cfg(feature="decoder_bmv3")] | |
30 | DecoderInfo { name: "bmv3-video", get_decoder: bmv3::get_decoder_video }, | |
31 | #[cfg(feature="decoder_vmd")] | |
32 | DecoderInfo { name: "vmd-audio", get_decoder: vmd::get_decoder_audio }, | |
33 | #[cfg(feature="decoder_vmd")] | |
34 | DecoderInfo { name: "vmd-video", get_decoder: vmd::get_decoder_video }, | |
35 | #[cfg(feature="decoder_midivid")] | |
36 | DecoderInfo { name: "midivid", get_decoder: midivid::get_decoder_video }, | |
37 | ]; | |
38 | ||
39 | /// Registers all available codecs provided by this crate. | |
40 | pub fn game_register_all_codecs(rd: &mut RegisteredDecoders) { | |
41 | for decoder in GAME_CODECS.iter() { | |
42 | rd.add_decoder(decoder.clone()); | |
43 | } | |
44 | } |