]> git.nihav.org Git - nihav.git/blob - nihav-commonfmt/src/demuxers/mod.rs
32fe113cd4e07097cd08bb028048df79ae05bc2d
[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_mov")]
18 #[allow(clippy::cast_lossless)]
19 mod mov;
20 #[cfg(feature="demuxer_wav")]
21 mod wav;
22 #[cfg(feature="demuxer_y4m")]
23 mod y4m;
24
25 const DEMUXERS: &[&dyn DemuxerCreator] = &[
26 #[cfg(feature="demuxer_avi")]
27 &avi::AVIDemuxerCreator {},
28 #[cfg(feature="demuxer_mov")]
29 &mov::MOVDemuxerCreator {},
30 #[cfg(feature="demuxer_mov")]
31 &mov::MacBinaryMOVDemuxerCreator {},
32 #[cfg(feature="demuxer_wav")]
33 &wav::WAVDemuxerCreator {},
34 #[cfg(feature="demuxer_y4m")]
35 &y4m::Y4MDemuxerCreator {},
36 ];
37
38 /// Registers all available demuxers provided by this crate.
39 pub fn generic_register_all_demuxers(rd: &mut RegisteredDemuxers) {
40 for demuxer in DEMUXERS.iter() {
41 rd.add_demuxer(*demuxer);
42 }
43 }