aboutsummaryrefslogtreecommitdiffstats
path: root/nihav-rad/src/demuxers/mod.rs
blob: 1bdf74dfeef79a447a77dedf30ed3b12f257f121 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use nihav_core::demuxers::*;

#[allow(unused_macros)]
macro_rules! validate {
    ($a:expr) => { if !$a { println!("check failed at {}:{}", file!(), line!()); return Err(DemuxerError::InvalidData); } };
}

#[cfg(feature="demuxer_smk")]
mod smacker;
#[cfg(feature="demuxer_bink")]
mod bink;

const RAD_DEMUXERS: &[&DemuxerCreator] = &[
#[cfg(feature="demuxer_smk")]
    &smacker::SMKDemuxerCreator {},
#[cfg(feature="demuxer_bink")]
    &bink::BinkDemuxerCreator {},
];

/// Registers all available demuxers provided by this crate.
pub fn rad_register_all_demuxers(rd: &mut RegisteredDemuxers) {
    for demuxer in RAD_DEMUXERS.iter() {
        rd.add_demuxer(*demuxer);
    }
}