1 use nihav_core::codecs::*;
3 macro_rules! validate {
4 ($a:expr) => { if !$a { println!("check failed at {}:{}", file!(), line!()); return Err(DecoderError::InvalidData); } };
7 #[cfg(feature="decoder_aac")]
8 #[allow(clippy::comparison_chain)]
9 #[allow(clippy::excessive_precision)]
10 #[allow(clippy::manual_memcpy)]
11 #[allow(clippy::useless_let_if_seq)]
13 #[cfg(feature="decoder_mpa")]
14 #[allow(clippy::excessive_precision)]
17 const DECODERS: &[DecoderInfo] = &[
18 #[cfg(feature="decoder_aac")]
19 DecoderInfo { name: "aac", get_decoder: aac::get_decoder },
20 #[cfg(feature="decoder_mpa")]
21 DecoderInfo { name: "mp2", get_decoder: mpegaudio::get_decoder_mp2 },
22 #[cfg(feature="decoder_mpa")]
23 DecoderInfo { name: "mp3", get_decoder: mpegaudio::get_decoder_mp3 },
26 /// Registers all available codecs provided by this crate.
27 pub fn mpeg_register_all_decoders(rd: &mut RegisteredDecoders) {
28 for decoder in DECODERS.iter() {
29 rd.add_decoder(*decoder);
33 const PACKETISERS: &[PacketiserInfo] = &[
34 #[cfg(feature="decoder_mpa")]
35 PacketiserInfo { name: "mpa", get_packetiser: mpegaudio::get_packetiser },
38 /// Registers all available packetisers provided by this crate.
39 pub fn mpeg_register_all_packetisers(rp: &mut RegisteredPacketisers) {
40 for packetiser in PACKETISERS.iter() {
41 rp.add_packetiser(*packetiser);