From: Kostya Shishkov Date: Wed, 17 Nov 2021 13:29:51 +0000 (+0100) Subject: correct some crate configurations for enabling/disabling features X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=820b43313ea6d0e03c7bf063ee6a64f3ff0cf659;p=nihav.git correct some crate configurations for enabling/disabling features --- diff --git a/nihav-commonfmt/src/codecs/mod.rs b/nihav-commonfmt/src/codecs/mod.rs index f052ea3..cf0c846 100644 --- a/nihav-commonfmt/src/codecs/mod.rs +++ b/nihav-commonfmt/src/codecs/mod.rs @@ -31,6 +31,7 @@ mod sipro; #[cfg(feature="decoder_ts102366")] mod ts102366; +#[cfg(feature="decoders")] const DECODERS: &[DecoderInfo] = &[ #[cfg(feature="decoder_cinepak")] DecoderInfo { name: "cinepak", get_decoder: cinepak::get_decoder }, @@ -62,6 +63,7 @@ const DECODERS: &[DecoderInfo] = &[ ]; /// Registers all available codecs provided by this crate. +#[cfg(feature="decoders")] pub fn generic_register_all_decoders(rd: &mut RegisteredDecoders) { for decoder in DECODERS.iter() { rd.add_decoder(*decoder); @@ -73,6 +75,7 @@ mod cinepakenc; #[cfg(feature="encoder_zmbv")] mod zmbvenc; +#[cfg(feature="encoders")] const ENCODERS: &[EncoderInfo] = &[ #[cfg(feature="encoder_cinepak")] EncoderInfo { name: "cinepak", get_encoder: cinepakenc::get_encoder }, @@ -84,6 +87,7 @@ const ENCODERS: &[EncoderInfo] = &[ ]; /// Registers all available encoders provided by this crate. +#[cfg(feature="encoders")] pub fn generic_register_all_encoders(re: &mut RegisteredEncoders) { for encoder in ENCODERS.iter() { re.add_encoder(*encoder); diff --git a/nihav-commonfmt/src/lib.rs b/nihav-commonfmt/src/lib.rs index 54fff4b..528b8b7 100644 --- a/nihav-commonfmt/src/lib.rs +++ b/nihav-commonfmt/src/lib.rs @@ -3,7 +3,7 @@ extern crate nihav_core; extern crate nihav_codec_support; extern crate nihav_registry; -#[cfg(feature="decoders")] +#[cfg(any(feature="decoders", feature="encoders"))] #[allow(clippy::needless_range_loop)] #[allow(clippy::single_match)] #[allow(clippy::unreadable_literal)] diff --git a/nihav-flash/src/codecs/mod.rs b/nihav-flash/src/codecs/mod.rs index 1789543..906c3ec 100644 --- a/nihav-flash/src/codecs/mod.rs +++ b/nihav-flash/src/codecs/mod.rs @@ -14,6 +14,7 @@ mod adpcm; #[cfg(feature="decoder_asao")] mod asao; +#[cfg(feature="decoders")] const DECODERS: &[DecoderInfo] = &[ #[cfg(feature="decoder_flv263")] DecoderInfo { name: "flv263", get_decoder: flv263::get_decoder }, @@ -29,6 +30,7 @@ const DECODERS: &[DecoderInfo] = &[ ]; /// Registers all available codecs provided by this crate. +#[cfg(feature="decoders")] pub fn flash_register_all_decoders(rd: &mut RegisteredDecoders) { for decoder in DECODERS.iter() { rd.add_decoder(*decoder); @@ -38,12 +40,14 @@ pub fn flash_register_all_decoders(rd: &mut RegisteredDecoders) { #[cfg(feature="encoder_flv_adpcm")] mod adpcmenc; +#[cfg(feature="encoders")] 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. +#[cfg(feature="encoders")] pub fn flash_register_all_encoders(re: &mut RegisteredEncoders) { for encoder in ENCODERS.iter() { re.add_encoder(*encoder);