]> git.nihav.org Git - nihav.git/blob - nihav-commonfmt/src/demuxers/mod.rs
GIF support
[nihav.git] / nihav-commonfmt / src / demuxers / mod.rs
1 use nihav_core::demuxers::*;
2
3
4 #[allow(unused_macros)]
5 #[cfg(debug_assertions)]
6 macro_rules! validate {
7 ($a:expr) => { if !$a { println!("check failed at {}:{}", file!(), line!()); return Err(DemuxerError::InvalidData); } };
8 }
9 #[cfg(not(debug_assertions))]
10 macro_rules! validate {
11 ($a:expr) => { if !$a { return Err(DemuxerError::InvalidData); } };
12 }
13
14 #[cfg(feature="demuxer_avi")]
15 #[allow(clippy::cast_lossless)]
16 mod avi;
17 #[cfg(feature="demuxer_gif")]
18 mod gif;
19 #[cfg(feature="demuxer_mov")]
20 #[allow(clippy::cast_lossless)]
21 mod mov;
22 #[cfg(feature="demuxer_wav")]
23 mod wav;
24 #[cfg(feature="demuxer_y4m")]
25 mod y4m;
26
27 const DEMUXERS: &[&dyn DemuxerCreator] = &[
28 #[cfg(feature="demuxer_avi")]
29 &avi::AVIDemuxerCreator {},
30 #[cfg(feature="demuxer_gif")]
31 &gif::GIFDemuxerCreator {},
32 #[cfg(feature="demuxer_mov")]
33 &mov::MOVDemuxerCreator {},
34 #[cfg(feature="demuxer_mov")]
35 &mov::MacBinaryMOVDemuxerCreator {},
36 #[cfg(feature="demuxer_wav")]
37 &wav::WAVDemuxerCreator {},
38 #[cfg(feature="demuxer_y4m")]
39 &y4m::Y4MDemuxerCreator {},
40 ];
41
42 /// Registers all available demuxers provided by this crate.
43 pub fn generic_register_all_demuxers(rd: &mut RegisteredDemuxers) {
44 for demuxer in DEMUXERS.iter() {
45 rd.add_demuxer(*demuxer);
46 }
47 }