]> git.nihav.org Git - nihav.git/blob - nihav-commonfmt/src/demuxers/mod.rs
mov: add support for MacBinary format
[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_mov")]
26 &mov::MacBinaryMOVDemuxerCreator {},
27 #[cfg(feature="demuxer_wav")]
28 &wav::WAVDemuxerCreator {},
29 #[cfg(feature="demuxer_y4m")]
30 &y4m::Y4MDemuxerCreator {},
31 ];
32
33 /// Registers all available demuxers provided by this crate.
34 pub fn generic_register_all_demuxers(rd: &mut RegisteredDemuxers) {
35 for demuxer in DEMUXERS.iter() {
36 rd.add_demuxer(*demuxer);
37 }
38 }