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::manual_memcpy)]
9 #[allow(clippy::useless_let_if_seq)]
11 #[cfg(feature="decoder_mpa")]
12 #[allow(clippy::excessive_precision)]
15 const DECODERS: &[DecoderInfo] = &[
16 #[cfg(feature="decoder_aac")]
17 DecoderInfo { name: "aac", get_decoder: aac::get_decoder },
18 #[cfg(feature="decoder_mpa")]
19 DecoderInfo { name: "mp3", get_decoder: mpegaudio::get_decoder_mp3 },
22 /// Registers all available codecs provided by this crate.
23 pub fn mpeg_register_all_decoders(rd: &mut RegisteredDecoders) {
24 for decoder in DECODERS.iter() {
25 rd.add_decoder(*decoder);
29 const PACKETISERS: &[PacketiserInfo] = &[
30 #[cfg(feature="decoder_mpa")]
31 PacketiserInfo { name: "mp3", get_packetiser: mpegaudio::get_packetiser },
34 /// Registers all available packetisers provided by this crate.
35 pub fn mpeg_register_all_packetisers(rp: &mut RegisteredPacketisers) {
36 for packetiser in PACKETISERS.iter() {
37 rp.add_packetiser(*packetiser);