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