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_gif")]
19 #[cfg(feature="demuxer_mov")]
20 #[allow(clippy::cast_lossless)]
22 #[cfg(feature="demuxer_wav")]
24 #[cfg(feature="demuxer_y4m")]
27 const DEMUXERS: &[&dyn DemuxerCreator] = &[
28 #[cfg(feature="demuxer_avi")]
29 &avi::AVIDemuxerCreator {},
30 #[cfg(feature="demuxer_gif")]
31 &gif::GIFDemuxerCreator {},
32 #[cfg(feature="demuxer_mov")]
33 &mov::MOVDemuxerCreator {},
34 #[cfg(feature="demuxer_mov")]
35 &mov::MacBinaryMOVDemuxerCreator {},
36 #[cfg(feature="demuxer_wav")]
37 &wav::WAVDemuxerCreator {},
38 #[cfg(feature="demuxer_y4m")]
39 &y4m::Y4MDemuxerCreator {},
42 /// Registers all available demuxers provided by this crate.
43 pub fn generic_register_all_demuxers(rd: &mut RegisteredDemuxers) {
44 for demuxer in DEMUXERS.iter() {
45 rd.add_demuxer(*demuxer);