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_msrle")]
10 #[cfg(feature="decoder_msvideo1")]
13 #[cfg(feature="decoder_ima_adpcm_ms")]
16 #[cfg(any(feature="decoder_ms_adpcm", feature="encoder_ms_adpcm"))]
19 const MS_CODECS: &[DecoderInfo] = &[
20 #[cfg(feature="decoder_msrle")]
21 DecoderInfo { name: "msrle", get_decoder: msrle::get_decoder },
22 #[cfg(feature="decoder_msvideo1")]
23 DecoderInfo { name: "msvideo1", get_decoder: msvideo1::get_decoder },
24 #[cfg(feature="decoder_ima_adpcm_ms")]
25 DecoderInfo { name: "ima-adpcm-ms", get_decoder: imaadpcm::get_decoder },
26 #[cfg(feature="decoder_ms_adpcm")]
27 DecoderInfo { name: "ms-adpcm", get_decoder: msadpcm::get_decoder },
30 /// Registers all available codecs provided by this crate.
31 pub fn ms_register_all_decoders(rd: &mut RegisteredDecoders) {
32 for decoder in MS_CODECS.iter() {
33 rd.add_decoder(*decoder);
37 #[cfg(feature="encoder_msvideo1")]
40 const MS_ENCODERS: &[EncoderInfo] = &[
41 #[cfg(feature="encoder_msvideo1")]
42 EncoderInfo { name: "msvideo1", get_encoder: msvideo1enc::get_encoder },
43 #[cfg(feature="encoder_ms_adpcm")]
44 EncoderInfo { name: "ms-adpcm", get_encoder: msadpcm::get_encoder },
47 /// Registers all available encoders provided by this crate.
48 pub fn ms_register_all_encoders(re: &mut RegisteredEncoders) {
49 for encoder in MS_ENCODERS.iter() {
50 re.add_encoder(*encoder);