]> git.nihav.org Git - nihav.git/commitdiff
move AAC decoder to nihav-mpeg crate
authorKostya Shishkov <kostya.shishkov@gmail.com>
Tue, 9 Nov 2021 17:48:44 +0000 (18:48 +0100)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Tue, 9 Nov 2021 17:49:28 +0000 (18:49 +0100)
nihav-commonfmt/Cargo.toml
nihav-commonfmt/src/codecs/mod.rs
nihav-mpeg/Cargo.toml
nihav-mpeg/src/codecs/aac.rs [moved from nihav-commonfmt/src/codecs/aac.rs with 99% similarity]
nihav-mpeg/src/codecs/mod.rs

index acccd96b61ee25b89da601a956ec4fb40cfa3c5b..229bd8afc49b95e6a574f3466968711d58f89452 100644 (file)
@@ -12,7 +12,7 @@ path = "../nihav-registry"
 
 [dependencies.nihav_codec_support]
 path = "../nihav-codec-support"
-features = ["h263", "mdct", "fft", "dsp_window", "vq"]
+features = ["h263", "mdct", "fft", "vq"]
 
 [dev-dependencies]
 nihav_realmedia = { path = "../nihav-realmedia", default-features=false, features = ["all_demuxers"] }
index cc1cf74f1121fb217f80501b6bde3cb4c1e2c166..bf254eedb00683298e7ac7b63b503208b55ad35a 100644 (file)
@@ -15,10 +15,6 @@ mod rawvideo_ms;
 #[cfg(feature="decoder_zmbv")]
 mod zmbv;
 
-#[cfg(feature="decoder_aac")]
-#[allow(clippy::manual_memcpy)]
-#[allow(clippy::useless_let_if_seq)]
-mod aac;
 #[cfg(feature="decoder_atrac3")]
 #[allow(clippy::identity_op)]
 #[allow(clippy::useless_let_if_seq)]
@@ -59,8 +55,6 @@ const DECODERS: &[DecoderInfo] = &[
     DecoderInfo { name: "ac3", get_decoder: ts102366::get_decoder },
 #[cfg(feature="decoder_atrac3")]
     DecoderInfo { name: "atrac3", get_decoder: atrac3::get_decoder },
-#[cfg(feature="decoder_aac")]
-    DecoderInfo { name: "aac", get_decoder: aac::get_decoder },
 ];
 
 /// Registers all available codecs provided by this crate.
index 0b214443d7b13d6af300b2812c9d98a4f16814c0..53a1d9e96e6d7771795808506b3012d0213e7070 100644 (file)
@@ -9,7 +9,7 @@ path = "../nihav-core"
 
 [dependencies.nihav_codec_support]
 path = "../nihav-codec-support"
-features = ["qmf"]
+features = ["qmf", "fft", "mdct", "dsp_window"]
 
 [dev-dependencies]
 nihav_flash = { path = "../nihav-flash", default-features=false, features = ["all_demuxers"] }
@@ -23,5 +23,6 @@ all_decoders = ["all_video_decoders", "all_audio_decoders"]
 
 all_video_decoders = []
 
-all_audio_decoders = ["decoder_mpa"]
+all_audio_decoders = ["decoder_aac", "decoder_mpa"]
+decoder_aac = ["decoders"]
 decoder_mpa = ["decoders"]
similarity index 99%
rename from nihav-commonfmt/src/codecs/aac.rs
rename to nihav-mpeg/src/codecs/aac.rs
index 85854206ab3e3470b4fe175027a14c17cbb6cea1..e11d56442aefc5e17c2ede8afc6b3b245ce2bb97 100644 (file)
@@ -1339,14 +1339,14 @@ mod test {
     use nihav_core::codecs::RegisteredDecoders;
     use nihav_core::demuxers::RegisteredDemuxers;
     use nihav_codec_support::test::dec_video::test_decode_audio;
-    use crate::generic_register_all_decoders;
+    use crate::mpeg_register_all_decoders;
     use nihav_realmedia::realmedia_register_all_demuxers;
     #[test]
     fn test_aac() {
         let mut dmx_reg = RegisteredDemuxers::new();
         realmedia_register_all_demuxers(&mut dmx_reg);
         let mut dec_reg = RegisteredDecoders::new();
-        generic_register_all_decoders(&mut dec_reg);
+        mpeg_register_all_decoders(&mut dec_reg);
 
 //        let file = "assets/RV/rv40_weighted_mc.rmvb";
         let file = "assets/RV/rv40_weighted_mc_2.rmvb";
index eb5855305479fa5e4d7fbfb6423cca499bbaedbd..09b42bdfe6212aa81e83b4484c5cfc3655238bab 100644 (file)
@@ -4,11 +4,17 @@ macro_rules! validate {
     ($a:expr) => { if !$a { println!("check failed at {}:{}", file!(), line!()); return Err(DecoderError::InvalidData); } };
 }
 
+#[cfg(feature="decoder_aac")]
+#[allow(clippy::manual_memcpy)]
+#[allow(clippy::useless_let_if_seq)]
+mod aac;
 #[cfg(feature="decoder_mpa")]
 #[allow(clippy::excessive_precision)]
 mod mpegaudio;
 
 const DECODERS: &[DecoderInfo] = &[
+#[cfg(feature="decoder_aac")]
+    DecoderInfo { name: "aac", get_decoder: aac::get_decoder },
 #[cfg(feature="decoder_mpa")]
     DecoderInfo { name: "mp3", get_decoder: mpegaudio::get_decoder_mp3 },
 ];