]> git.nihav.org Git - nihav.git/blame - nihav-commonfmt/src/demuxers/mod.rs
make muxers handle options
[nihav.git] / nihav-commonfmt / src / demuxers / mod.rs
CommitLineData
38953fb5
KS
1use nihav_core::demuxers::*;
2
3
674ebc33 4#[allow(unused_macros)]
38953fb5
KS
5macro_rules! validate {
6 ($a:expr) => { if !$a { println!("check failed at {}:{}", file!(), line!()); return Err(DemuxerError::InvalidData); } };
7}
8
9#[cfg(feature="demuxer_avi")]
c83013a1 10#[allow(clippy::cast_lossless)]
38953fb5 11mod avi;
58309c73
KS
12#[cfg(feature="demuxer_mov")]
13mod mov;
283abfa6
KS
14#[cfg(feature="demuxer_wav")]
15mod wav;
38953fb5 16
c83013a1 17const DEMUXERS: &[&DemuxerCreator] = &[
38953fb5
KS
18#[cfg(feature="demuxer_avi")]
19 &avi::AVIDemuxerCreator {},
58309c73
KS
20#[cfg(feature="demuxer_mov")]
21 &mov::MOVDemuxerCreator {},
283abfa6
KS
22#[cfg(feature="demuxer_wav")]
23 &wav::WAVDemuxerCreator {},
38953fb5
KS
24];
25
e64739f8 26/// Registers all available demuxers provided by this crate.
38953fb5 27pub fn generic_register_all_demuxers(rd: &mut RegisteredDemuxers) {
c83013a1 28 for demuxer in DEMUXERS.iter() {
38953fb5
KS
29 rd.add_demuxer(*demuxer);
30 }
31}