X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-commonfmt%2Fsrc%2Fdemuxers%2Fmod.rs;h=42d1f11cfc0fe50ab14103e0aa27bffbd048eec6;hb=86b51082f5aa5b94e40aec40c6963ec34071f9b5;hp=ba8a8df4a9653cd71dd4e4b7e6161a716f0066ab;hpb=61cab15b810434b8e62234ab5cdfcb17ec2d566d;p=nihav.git diff --git a/nihav-commonfmt/src/demuxers/mod.rs b/nihav-commonfmt/src/demuxers/mod.rs index ba8a8df..42d1f11 100644 --- a/nihav-commonfmt/src/demuxers/mod.rs +++ b/nihav-commonfmt/src/demuxers/mod.rs @@ -2,26 +2,41 @@ use nihav_core::demuxers::*; #[allow(unused_macros)] +#[cfg(debug_assertions)] macro_rules! validate { ($a:expr) => { if !$a { println!("check failed at {}:{}", file!(), line!()); return Err(DemuxerError::InvalidData); } }; } +#[cfg(not(debug_assertions))] +macro_rules! validate { + ($a:expr) => { if !$a { return Err(DemuxerError::InvalidData); } }; +} #[cfg(feature="demuxer_avi")] #[allow(clippy::cast_lossless)] mod avi; +#[cfg(feature="demuxer_gif")] +mod gif; #[cfg(feature="demuxer_mov")] #[allow(clippy::cast_lossless)] mod mov; #[cfg(feature="demuxer_wav")] mod wav; +#[cfg(feature="demuxer_y4m")] +mod y4m; -const DEMUXERS: &[&DemuxerCreator] = &[ +const DEMUXERS: &[&dyn DemuxerCreator] = &[ #[cfg(feature="demuxer_avi")] &avi::AVIDemuxerCreator {}, +#[cfg(feature="demuxer_gif")] + &gif::GIFDemuxerCreator {}, #[cfg(feature="demuxer_mov")] &mov::MOVDemuxerCreator {}, +#[cfg(feature="demuxer_mov")] + &mov::MacBinaryMOVDemuxerCreator {}, #[cfg(feature="demuxer_wav")] &wav::WAVDemuxerCreator {}, +#[cfg(feature="demuxer_y4m")] + &y4m::Y4MDemuxerCreator {}, ]; /// Registers all available demuxers provided by this crate.