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_cinepak")]
9 #[cfg(feature="decoder_clearvideo")]
12 #[cfg(feature="decoder_aac")]
13 #[allow(clippy::manual_memcpy)]
14 #[allow(clippy::useless_let_if_seq)]
16 #[cfg(feature="decoder_atrac3")]
17 #[allow(clippy::identity_op)]
18 #[allow(clippy::useless_let_if_seq)]
20 #[cfg(any(feature="decoder_pcm",feature="encoder_pcm"))]
22 #[cfg(feature="decoder_sipro")]
23 #[allow(clippy::collapsible_if)]
24 #[allow(clippy::identity_op)]
25 #[allow(clippy::manual_memcpy)]
27 #[cfg(feature="decoder_ts102366")]
30 const DECODERS: &[DecoderInfo] = &[
31 #[cfg(feature="decoder_cinepak")]
32 DecoderInfo { name: "cinepak", get_decoder: cinepak::get_decoder },
33 #[cfg(feature="decoder_clearvideo")]
34 DecoderInfo { name: "clearvideo", get_decoder: clearvideo::get_decoder },
35 #[cfg(feature="decoder_clearvideo")]
36 DecoderInfo { name: "clearvideo_rm", get_decoder: clearvideo::get_decoder_rm },
38 #[cfg(feature="decoder_pcm")]
39 DecoderInfo { name: "pcm", get_decoder: pcm::get_decoder },
40 #[cfg(feature="decoder_pcm")]
41 DecoderInfo { name: "alaw", get_decoder: pcm::get_a_law_decoder },
42 #[cfg(feature="decoder_pcm")]
43 DecoderInfo { name: "ulaw", get_decoder: pcm::get_mu_law_decoder },
44 #[cfg(feature="decoder_sipro")]
45 DecoderInfo { name: "sipro", get_decoder: sipro::get_decoder },
46 #[cfg(feature="decoder_ts102366")]
47 DecoderInfo { name: "ac3", get_decoder: ts102366::get_decoder },
48 #[cfg(feature="decoder_atrac3")]
49 DecoderInfo { name: "atrac3", get_decoder: atrac3::get_decoder },
50 #[cfg(feature="decoder_aac")]
51 DecoderInfo { name: "aac", get_decoder: aac::get_decoder },
54 /// Registers all available codecs provided by this crate.
55 pub fn generic_register_all_codecs(rd: &mut RegisteredDecoders) {
56 for decoder in DECODERS.iter() {
57 rd.add_decoder(decoder.clone());
61 #[cfg(feature="encoder_cinepak")]
64 const ENCODERS: &[EncoderInfo] = &[
65 #[cfg(feature="encoder_cinepak")]
66 EncoderInfo { name: "cinepak", get_encoder: cinepakenc::get_encoder },
68 #[cfg(feature="encoder_pcm")]
69 EncoderInfo { name: "pcm", get_encoder: pcm::get_encoder },
72 /// Registers all available encoders provided by this crate.
73 pub fn generic_register_all_encoders(re: &mut RegisteredEncoders) {
74 for encoder in ENCODERS.iter() {
75 re.add_encoder(encoder.clone());