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

macro_rules! validate {
    ($a:expr) => { if !$a { println!("check failed at {}:{}", file!(), line!()); return Err(DecoderError::InvalidData); } };
}

#[cfg(feature="decoder_mwv1")]
mod mwv1;

const DECODERS: &[DecoderInfo] = &[
#[cfg(feature="decoder_mwv1")]
    DecoderInfo { name: "mwv1", get_decoder: mwv1::get_decoder },
];

/// Registers all available codecs provided by this crate.
pub fn misc_register_all_decoders(rd: &mut RegisteredDecoders) {
    for decoder in DECODERS.iter() {
        rd.add_decoder(*decoder);
    }
}