]>
Commit | Line | Data |
---|---|---|
38953fb5 KS |
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 | ||
57777a0a KS |
7 | #[cfg(feature="decoder_cinepak")] |
8 | mod cinepak; | |
38953fb5 KS |
9 | #[cfg(feature="decoder_clearvideo")] |
10 | mod clearvideo; | |
11 | ||
12 | #[cfg(feature="decoder_aac")] | |
61cab15b KS |
13 | #[allow(clippy::manual_memcpy)] |
14 | #[allow(clippy::useless_let_if_seq)] | |
38953fb5 KS |
15 | mod aac; |
16 | #[cfg(feature="decoder_atrac3")] | |
61cab15b KS |
17 | #[allow(clippy::identity_op)] |
18 | #[allow(clippy::useless_let_if_seq)] | |
38953fb5 | 19 | mod atrac3; |
f5c54c10 | 20 | #[cfg(any(feature="decoder_pcm",feature="encoder_pcm"))] |
38953fb5 KS |
21 | mod pcm; |
22 | #[cfg(feature="decoder_sipro")] | |
61cab15b KS |
23 | #[allow(clippy::collapsible_if)] |
24 | #[allow(clippy::identity_op)] | |
25 | #[allow(clippy::manual_memcpy)] | |
38953fb5 KS |
26 | mod sipro; |
27 | #[cfg(feature="decoder_ts102366")] | |
28 | mod ts102366; | |
29 | ||
30 | const DECODERS: &[DecoderInfo] = &[ | |
57777a0a KS |
31 | #[cfg(feature="decoder_cinepak")] |
32 | DecoderInfo { name: "cinepak", get_decoder: cinepak::get_decoder }, | |
38953fb5 KS |
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 }, | |
37 | ||
38 | #[cfg(feature="decoder_pcm")] | |
39 | DecoderInfo { name: "pcm", get_decoder: pcm::get_decoder }, | |
67a31585 KS |
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 }, | |
38953fb5 KS |
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 }, | |
52 | ]; | |
53 | ||
e64739f8 | 54 | /// Registers all available codecs provided by this crate. |
38953fb5 | 55 | pub fn generic_register_all_codecs(rd: &mut RegisteredDecoders) { |
c83013a1 | 56 | for decoder in DECODERS.iter() { |
38953fb5 KS |
57 | rd.add_decoder(decoder.clone()); |
58 | } | |
59 | } | |
a178c22c KS |
60 | |
61 | #[cfg(feature="encoder_cinepak")] | |
62 | mod cinepakenc; | |
63 | ||
64 | const ENCODERS: &[EncoderInfo] = &[ | |
65 | #[cfg(feature="encoder_cinepak")] | |
66 | EncoderInfo { name: "cinepak", get_encoder: cinepakenc::get_encoder }, | |
f5c54c10 KS |
67 | |
68 | #[cfg(feature="encoder_pcm")] | |
69 | EncoderInfo { name: "pcm", get_encoder: pcm::get_encoder }, | |
a178c22c KS |
70 | ]; |
71 | ||
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()); | |
76 | } | |
77 | } | |
78 |