]>
Commit | Line | Data |
---|---|---|
1 | use nihav_core::codecs::*; | |
2 | ||
3 | #[allow(unused_macros)] | |
4 | macro_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)] | |
10 | mod 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)] | |
15 | mod g723_1; | |
16 | #[cfg(feature="decoder_siren")] | |
17 | #[allow(clippy::approx_constant)] | |
18 | #[allow(clippy::needless_range_loop)] | |
19 | mod siren; | |
20 | ||
21 | const 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. | |
33 | pub fn vivo_register_all_codecs(rd: &mut RegisteredDecoders) { | |
34 | for decoder in VIVO_CODECS.iter() { | |
35 | rd.add_decoder(decoder.clone()); | |
36 | } | |
37 | } |