]> git.nihav.org Git - nihav.git/blame_incremental - nihav-vivo/src/codecs/mod.rs
avi: handle audio extradata shorter than chunk size
[nihav.git] / nihav-vivo / src / codecs / mod.rs
... / ...
CommitLineData
1use nihav_core::codecs::*;
2
3#[allow(unused_macros)]
4macro_rules! validate {
5 ($a:expr) => { if !$a { println!("check failed at {}:{}", file!(), line!()); return Err(DecoderError::InvalidData); } };
6}
7
8#[cfg(any(feature="decoder_vivo1", feature="decoder_vivo2"))]
9#[allow(clippy::useless_let_if_seq)]
10mod vivo;
11#[cfg(feature="decoder_g723_1")]
12#[allow(clippy::needless_range_loop)]
13#[allow(clippy::unreadable_literal)]
14#[allow(clippy::useless_let_if_seq)]
15mod g723_1;
16#[cfg(feature="decoder_siren")]
17#[allow(clippy::approx_constant)]
18#[allow(clippy::needless_range_loop)]
19mod siren;
20
21const VIVO_CODECS: &[DecoderInfo] = &[
22#[cfg(feature="decoder_vivo1")]
23 DecoderInfo { name: "vivo1", get_decoder: vivo::get_decoder },
24#[cfg(feature="decoder_vivo2")]
25 DecoderInfo { name: "vivo2", get_decoder: vivo::get_decoder },
26#[cfg(feature="decoder_g723_1")]
27 DecoderInfo { name: "g723.1", get_decoder: g723_1::get_decoder },
28#[cfg(feature="decoder_siren")]
29 DecoderInfo { name: "siren", get_decoder: siren::get_decoder },
30];
31
32/// Registers all available codecs provided by this crate.
33pub fn vivo_register_all_codecs(rd: &mut RegisteredDecoders) {
34 for decoder in VIVO_CODECS.iter() {
35 rd.add_decoder(decoder.clone());
36 }
37}