]> git.nihav.org Git - nihav.git/blame - nihav-ms/src/codecs/mod.rs
core/scale: fix flipping of packed video buffer
[nihav.git] / nihav-ms / src / codecs / mod.rs
CommitLineData
4abcd842
KS
1use nihav_core::codecs::*;
2
3macro_rules! validate {
4 ($a:expr) => { if !$a { println!("check failed at {}:{}", file!(), line!()); return Err(DecoderError::InvalidData); } };
5}
6
423005dc
KS
7#[cfg(feature="decoder_msrle")]
8pub mod msrle;
9
4abcd842
KS
10#[cfg(feature="decoder_msvideo1")]
11pub mod msvideo1;
12
13#[cfg(feature="decoder_ima_adpcm_ms")]
14pub mod imaadpcm;
15
c7cd83f3
KS
16#[cfg(feature="encoder_ima_adpcm_ms")]
17pub mod imaadpcmenc;
18
dab59886 19#[cfg(any(feature="decoder_ms_adpcm", feature="encoder_ms_adpcm"))]
4abcd842
KS
20pub mod msadpcm;
21
22const MS_CODECS: &[DecoderInfo] = &[
423005dc
KS
23#[cfg(feature="decoder_msrle")]
24 DecoderInfo { name: "msrle", get_decoder: msrle::get_decoder },
4abcd842
KS
25#[cfg(feature="decoder_msvideo1")]
26 DecoderInfo { name: "msvideo1", get_decoder: msvideo1::get_decoder },
27#[cfg(feature="decoder_ima_adpcm_ms")]
28 DecoderInfo { name: "ima-adpcm-ms", get_decoder: imaadpcm::get_decoder },
29#[cfg(feature="decoder_ms_adpcm")]
30 DecoderInfo { name: "ms-adpcm", get_decoder: msadpcm::get_decoder },
31];
32
33/// Registers all available codecs provided by this crate.
78fb6560 34pub fn ms_register_all_decoders(rd: &mut RegisteredDecoders) {
4abcd842 35 for decoder in MS_CODECS.iter() {
b7c882c1 36 rd.add_decoder(*decoder);
4abcd842
KS
37 }
38}
dab59886
KS
39
40#[cfg(feature="encoder_msvideo1")]
41pub mod msvideo1enc;
42
43const MS_ENCODERS: &[EncoderInfo] = &[
44#[cfg(feature="encoder_msvideo1")]
45 EncoderInfo { name: "msvideo1", get_encoder: msvideo1enc::get_encoder },
46#[cfg(feature="encoder_ms_adpcm")]
47 EncoderInfo { name: "ms-adpcm", get_encoder: msadpcm::get_encoder },
c7cd83f3
KS
48#[cfg(feature="encoder_ima_adpcm_ms")]
49 EncoderInfo { name: "ima-adpcm-ms", get_encoder: imaadpcmenc::get_encoder },
dab59886
KS
50];
51
52/// Registers all available encoders provided by this crate.
53pub fn ms_register_all_encoders(re: &mut RegisteredEncoders) {
54 for encoder in MS_ENCODERS.iter() {
b7c882c1 55 re.add_encoder(*encoder);
dab59886
KS
56 }
57}