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")]
11 #[cfg(feature="decoder_jpeg")]
13 #[cfg(feature="decoder_rawvideo")]
15 #[cfg(feature="decoder_rawvideo_ms")]
17 #[cfg(feature="decoder_zmbv")]
20 #[cfg(feature="decoder_atrac3")]
21 #[allow(clippy::identity_op)]
22 #[allow(clippy::useless_let_if_seq)]
24 #[cfg(any(feature="decoder_pcm",feature="encoder_pcm"))]
26 #[cfg(feature="decoder_sipro")]
27 #[allow(clippy::collapsible_if)]
28 #[allow(clippy::identity_op)]
29 #[allow(clippy::manual_memcpy)]
31 #[cfg(feature="decoder_ts102366")]
34 #[cfg(feature="decoders")]
35 const DECODERS: &[DecoderInfo] = &[
36 #[cfg(feature="decoder_cinepak")]
37 DecoderInfo { name: "cinepak", get_decoder: cinepak::get_decoder },
38 #[cfg(feature="decoder_clearvideo")]
39 DecoderInfo { name: "clearvideo", get_decoder: clearvideo::get_decoder },
40 #[cfg(feature="decoder_clearvideo")]
41 DecoderInfo { name: "clearvideo_rm", get_decoder: clearvideo::get_decoder_rm },
42 #[cfg(feature="decoder_jpeg")]
43 DecoderInfo { name: "jpeg", get_decoder: jpeg::get_decoder },
44 #[cfg(feature="decoder_rawvideo")]
45 DecoderInfo { name: "rawvideo", get_decoder: rawvideo::get_decoder },
46 #[cfg(feature="decoder_rawvideo_ms")]
47 DecoderInfo { name: "rawvideo-ms", get_decoder: rawvideo_ms::get_decoder },
48 #[cfg(feature="decoder_zmbv")]
49 DecoderInfo { name: "zmbv", get_decoder: zmbv::get_decoder },
51 #[cfg(feature="decoder_pcm")]
52 DecoderInfo { name: "pcm", get_decoder: pcm::get_decoder },
53 #[cfg(feature="decoder_pcm")]
54 DecoderInfo { name: "alaw", get_decoder: pcm::get_a_law_decoder },
55 #[cfg(feature="decoder_pcm")]
56 DecoderInfo { name: "ulaw", get_decoder: pcm::get_mu_law_decoder },
57 #[cfg(feature="decoder_sipro")]
58 DecoderInfo { name: "sipro", get_decoder: sipro::get_decoder },
59 #[cfg(feature="decoder_ts102366")]
60 DecoderInfo { name: "ac3", get_decoder: ts102366::get_decoder },
61 #[cfg(feature="decoder_atrac3")]
62 DecoderInfo { name: "atrac3", get_decoder: atrac3::get_decoder },
65 /// Registers all available codecs provided by this crate.
66 #[cfg(feature="decoders")]
67 pub fn generic_register_all_decoders(rd: &mut RegisteredDecoders) {
68 for decoder in DECODERS.iter() {
69 rd.add_decoder(*decoder);
73 #[cfg(feature="encoder_cinepak")]
75 #[cfg(feature="encoder_zmbv")]
78 #[cfg(feature="encoders")]
79 const ENCODERS: &[EncoderInfo] = &[
80 #[cfg(feature="encoder_cinepak")]
81 EncoderInfo { name: "cinepak", get_encoder: cinepakenc::get_encoder },
82 #[cfg(feature="encoder_zmbv")]
83 EncoderInfo { name: "zmbv", get_encoder: zmbvenc::get_encoder },
85 #[cfg(feature="encoder_pcm")]
86 EncoderInfo { name: "pcm", get_encoder: pcm::get_encoder },
89 /// Registers all available encoders provided by this crate.
90 #[cfg(feature="encoders")]
91 pub fn generic_register_all_encoders(re: &mut RegisteredEncoders) {
92 for encoder in ENCODERS.iter() {
93 re.add_encoder(*encoder);