1 use nihav_core::codecs::*;
3 #[cfg(debug_assertions)]
4 macro_rules! validate {
5 ($a:expr) => { if !$a { println!("check failed at {}:{}", file!(), line!()); return Err(DecoderError::InvalidData); } };
7 #[cfg(not(debug_assertions))]
8 macro_rules! validate {
9 ($a:expr) => { if !$a { return Err(DecoderError::InvalidData); } };
12 #[cfg(any(feature="decoder_realvideo3", feature="decoder_realvideo4"))]
14 #[cfg(any(feature="decoder_realvideo3", feature="decoder_realvideo4", feature="encoder_realvideo4"))]
15 #[allow(clippy::erasing_op)]
17 #[cfg(any(feature="decoder_realvideo3", feature="decoder_realvideo4"))]
18 #[allow(clippy::erasing_op)]
19 #[allow(clippy::many_single_char_names)]
22 #[cfg(feature="decoder_realvideo1")]
24 #[cfg(feature="decoder_realvideo2")]
26 #[cfg(feature="decoder_realvideo3")]
28 #[cfg(feature="decoder_realvideo3")]
29 #[allow(clippy::erasing_op)]
30 #[allow(clippy::many_single_char_names)]
31 #[allow(clippy::neg_multiply)]
33 #[cfg(feature="decoder_realvideo4")]
35 #[cfg(any(feature="decoder_realvideo4", feature="encoder_realvideo4"))]
37 #[cfg(feature="decoder_realvideo4")]
38 #[allow(clippy::erasing_op)]
39 #[allow(clippy::many_single_char_names)]
41 #[cfg(feature="decoder_realvideo6")]
43 #[cfg(feature="decoder_realvideo6")]
45 #[cfg(feature="decoder_realvideo6")]
46 #[allow(clippy::erasing_op)]
47 #[allow(clippy::many_single_char_names)]
50 #[cfg(feature="decoder_realaudio144")]
51 #[allow(clippy::manual_memcpy)]
53 #[cfg(feature="decoder_realaudio288")]
55 #[cfg(feature="decoder_cook")]
57 #[cfg(any(feature="decoder_cook", feature="encoder_cook"))]
59 #[cfg(feature="decoder_ralf")]
62 const RM_CODECS: &[DecoderInfo] = &[
63 #[cfg(feature="decoder_realvideo1")]
64 DecoderInfo { name: "realvideo1", get_decoder: rv10::get_decoder },
65 #[cfg(feature="decoder_realvideo2")]
66 DecoderInfo { name: "realvideo2", get_decoder: rv20::get_decoder },
67 #[cfg(feature="decoder_realvideo3")]
68 DecoderInfo { name: "realvideo3", get_decoder: rv30::get_decoder },
69 #[cfg(feature="decoder_realvideo4")]
70 DecoderInfo { name: "realvideo4", get_decoder: rv40::get_decoder },
71 #[cfg(feature="decoder_realvideo6")]
72 DecoderInfo { name: "realvideo6", get_decoder: rv60::get_decoder },
74 #[cfg(feature="decoder_realaudio144")]
75 DecoderInfo { name: "ra14.4", get_decoder: ra144::get_decoder },
76 #[cfg(feature="decoder_realaudio288")]
77 DecoderInfo { name: "ra28.8", get_decoder: ra288::get_decoder },
78 #[cfg(feature="decoder_cook")]
79 DecoderInfo { name: "cook", get_decoder: cook::get_decoder },
80 #[cfg(feature="decoder_ralf")]
81 DecoderInfo { name: "ralf", get_decoder: ralf::get_decoder },
84 /// Registers all available codecs provided by this crate.
85 pub fn realmedia_register_all_decoders(rd: &mut RegisteredDecoders) {
86 for decoder in RM_CODECS.iter() {
87 rd.add_decoder(*decoder);
91 #[cfg(feature="encoder_cook")]
94 #[cfg(feature="encoder_rv40")]
97 #[cfg(feature="encoders")]
98 const ENCODERS: &[EncoderInfo] = &[
99 #[cfg(feature="encoder_cook")]
100 EncoderInfo { name: "cook", get_encoder: cookenc::get_encoder },
102 #[cfg(feature="encoder_rv40")]
103 EncoderInfo { name: "realvideo4", get_encoder: rv40enc::get_encoder },
106 /// Registers all available encoders provided by this crate.
107 #[cfg(feature="encoders")]
108 pub fn realmedia_register_all_encoders(re: &mut RegisteredEncoders) {
109 for encoder in ENCODERS.iter() {
110 re.add_encoder(*encoder);