]> git.nihav.org Git - nihav.git/blob - nihav-qt/src/codecs/mod.rs
use proper audio buffer truncation function
[nihav.git] / nihav-qt / src / codecs / mod.rs
1 use nihav_core::codecs::*;
2
3 macro_rules! validate {
4 ($a:expr) => { if !$a { println!("check failed at {}:{}", file!(), line!()); return Err(DecoderError::InvalidData); } };
5 }
6
7 #[cfg(feature="decoder_rle")]
8 mod rle;
9
10 #[cfg(feature="decoder_rpza")]
11 mod rpza;
12
13 #[cfg(feature="decoder_smc")]
14 mod smc;
15
16 #[cfg(feature="decoder_svq1")]
17 mod svq1;
18 #[cfg(feature="decoder_svq1")]
19 mod svq1data;
20
21 #[cfg(feature="decoder_svq3")]
22 #[allow(clippy::collapsible_if)]
23 #[allow(clippy::identity_op)]
24 #[allow(clippy::needless_range_loop)]
25 #[allow(clippy::too_many_arguments)]
26 #[allow(clippy::verbose_bit_mask)]
27 mod svq3;
28 #[cfg(feature="decoder_svq3")]
29 #[allow(clippy::collapsible_if)]
30 #[allow(clippy::erasing_op)]
31 #[allow(clippy::identity_op)]
32 #[allow(clippy::many_single_char_names)]
33 #[allow(clippy::needless_range_loop)]
34 #[allow(clippy::unreadable_literal)]
35 mod svq3dsp;
36
37 #[cfg(feature="decoder_alac")]
38 mod alac;
39
40 #[cfg(feature="decoder_ima_adpcm_qt")]
41 mod imaadpcm;
42
43 #[cfg(feature="decoder_mace")]
44 mod mace;
45
46 #[cfg(any(feature="decoder_qdm",feature="decoder_qdm2"))]
47 #[allow(clippy::unreadable_literal)]
48 mod qdmcommon;
49 #[cfg(feature="decoder_qdm")]
50 #[allow(clippy::needless_range_loop)]
51 #[allow(clippy::unreadable_literal)]
52 mod qdmc;
53 #[cfg(feature="decoder_qdm2")]
54 #[allow(clippy::needless_range_loop)]
55 #[allow(clippy::excessive_precision)]
56 #[allow(clippy::unreadable_literal)]
57 mod qdm2fft;
58 #[cfg(feature="decoder_qdm2")]
59 #[allow(clippy::needless_range_loop)]
60 #[allow(clippy::excessive_precision)]
61 #[allow(clippy::unreadable_literal)]
62 mod qdm2qmf;
63 #[cfg(feature="decoder_qdm2")]
64 #[allow(clippy::excessive_precision)]
65 #[allow(clippy::unreadable_literal)]
66 mod qdm2;
67
68 const QT_CODECS: &[DecoderInfo] = &[
69 #[cfg(feature="decoder_rle")]
70 DecoderInfo { name: "qt-rle", get_decoder: rle::get_decoder },
71 #[cfg(feature="decoder_rpza")]
72 DecoderInfo { name: "apple-video", get_decoder: rpza::get_decoder },
73 #[cfg(feature="decoder_smc")]
74 DecoderInfo { name: "qt-smc", get_decoder: smc::get_decoder },
75 #[cfg(feature="decoder_svq1")]
76 DecoderInfo { name: "sorenson-video", get_decoder: svq1::get_decoder },
77 #[cfg(feature="decoder_svq3")]
78 DecoderInfo { name: "sorenson-video3", get_decoder: svq3::get_decoder },
79 #[cfg(feature="decoder_alac")]
80 DecoderInfo { name: "alac", get_decoder: alac::get_decoder },
81 #[cfg(feature="decoder_ima_adpcm_qt")]
82 DecoderInfo { name: "ima-adpcm-qt", get_decoder: imaadpcm::get_decoder },
83 #[cfg(feature="decoder_mace")]
84 DecoderInfo { name: "mace-3", get_decoder: mace::get_decoder_3 },
85 #[cfg(feature="decoder_mace")]
86 DecoderInfo { name: "mace-6", get_decoder: mace::get_decoder_6 },
87 #[cfg(feature="decoder_qdm")]
88 DecoderInfo { name: "qdesign-music", get_decoder: qdmc::get_decoder },
89 #[cfg(feature="decoder_qdm2")]
90 DecoderInfo { name: "qdesign-music2", get_decoder: qdm2::get_decoder },
91 ];
92
93 /// Registers all available codecs provided by this crate.
94 pub fn qt_register_all_decoders(rd: &mut RegisteredDecoders) {
95 for decoder in QT_CODECS.iter() {
96 rd.add_decoder(*decoder);
97 }
98 }