diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2021-11-02 18:20:06 +0100 |
---|---|---|
committer | Kostya Shishkov <kostya.shishkov@gmail.com> | 2021-11-02 18:20:06 +0100 |
commit | 92d9fb6993d2d3f6f7a016ee6796a98e6e989f21 (patch) | |
tree | fc62601617c3ec10e18c5a39940225abe0d2da4d /nihav-flash/src/codecs/mod.rs | |
parent | bc23de6bedc2e151caea241b073a65d30f62c134 (diff) | |
download | nihav-92d9fb6993d2d3f6f7a016ee6796a98e6e989f21.tar.gz |
Flash support
Diffstat (limited to 'nihav-flash/src/codecs/mod.rs')
-rw-r--r-- | nihav-flash/src/codecs/mod.rs | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/nihav-flash/src/codecs/mod.rs b/nihav-flash/src/codecs/mod.rs new file mode 100644 index 0000000..1789543 --- /dev/null +++ b/nihav-flash/src/codecs/mod.rs @@ -0,0 +1,51 @@ +use nihav_core::codecs::*; + +macro_rules! validate { + ($a:expr) => { if !$a { println!("check failed at {}:{}", file!(), line!()); return Err(DecoderError::InvalidData); } }; +} + +#[cfg(feature="decoder_flv263")] +mod flv263; +#[cfg(feature="decoder_flashsv")] +mod flashsv; + +#[cfg(feature="decoder_flv_adpcm")] +mod adpcm; +#[cfg(feature="decoder_asao")] +mod asao; + +const DECODERS: &[DecoderInfo] = &[ +#[cfg(feature="decoder_flv263")] + DecoderInfo { name: "flv263", get_decoder: flv263::get_decoder }, +#[cfg(feature="decoder_flashsv")] + DecoderInfo { name: "flashsv", get_decoder: flashsv::get_decoder }, +#[cfg(feature="decoder_flashsv")] + DecoderInfo { name: "flashsv2", get_decoder: flashsv::get_decoder_v2 }, + +#[cfg(feature="decoder_flv_adpcm")] + DecoderInfo { name: "flv-adpcm", get_decoder: adpcm::get_decoder }, +#[cfg(feature="decoder_asao")] + DecoderInfo { name: "asao", get_decoder: asao::get_decoder }, +]; + +/// Registers all available codecs provided by this crate. +pub fn flash_register_all_decoders(rd: &mut RegisteredDecoders) { + for decoder in DECODERS.iter() { + rd.add_decoder(*decoder); + } +} + +#[cfg(feature="encoder_flv_adpcm")] +mod adpcmenc; + +const ENCODERS: &[EncoderInfo] = &[ +#[cfg(feature="encoder_flv_adpcm")] + EncoderInfo { name: "flv-adpcm", get_encoder: adpcmenc::get_encoder }, +]; + +/// Registers all available encoders provided by this crate. +pub fn flash_register_all_encoders(re: &mut RegisteredEncoders) { + for encoder in ENCODERS.iter() { + re.add_encoder(*encoder); + } +} |