1 use nihav_core::demuxers::*;
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); } };
9 #[cfg(not(debug_assertions))]
10 macro_rules! validate {
11 ($a:expr) => { if !$a { return Err(DemuxerError::InvalidData); } };
14 #[cfg(feature="demuxer_avi")]
15 #[allow(clippy::cast_lossless)]
17 #[cfg(feature="demuxer_mov")]
18 #[allow(clippy::cast_lossless)]
20 #[cfg(feature="demuxer_wav")]
22 #[cfg(feature="demuxer_y4m")]
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 {},
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);