From: Kostya Shishkov Date: Mon, 17 Feb 2020 13:01:21 +0000 (+0100) Subject: make all codec crates export just register_all functions and document them X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=e64739f87a35f29be0bbbce366876180ba3eb57e;p=nihav.git make all codec crates export just register_all functions and document them --- diff --git a/nihav-allstuff/src/lib.rs b/nihav-allstuff/src/lib.rs index 4f712f3..eb8e9a3 100644 --- a/nihav-allstuff/src/lib.rs +++ b/nihav-allstuff/src/lib.rs @@ -9,21 +9,21 @@ extern crate nihav_realmedia; use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; -use nihav_commonfmt::codecs::generic_register_all_codecs; -use nihav_commonfmt::demuxers::generic_register_all_demuxers; +use nihav_commonfmt::generic_register_all_codecs; +use nihav_commonfmt::generic_register_all_demuxers; -use nihav_duck::codecs::duck_register_all_codecs; +use nihav_duck::duck_register_all_codecs; -use nihav_game::codecs::game_register_all_codecs; -use nihav_game::demuxers::game_register_all_demuxers; +use nihav_game::game_register_all_codecs; +use nihav_game::game_register_all_demuxers; -use nihav_indeo::codecs::indeo_register_all_codecs; +use nihav_indeo::indeo_register_all_codecs; -use nihav_rad::codecs::rad_register_all_codecs; -use nihav_rad::demuxers::rad_register_all_demuxers; +use nihav_rad::rad_register_all_codecs; +use nihav_rad::rad_register_all_demuxers; -use nihav_realmedia::codecs::realmedia_register_all_codecs; -use nihav_realmedia::demuxers::realmedia_register_all_demuxers; +use nihav_realmedia::realmedia_register_all_codecs; +use nihav_realmedia::realmedia_register_all_demuxers; pub fn nihav_register_all_codecs(rd: &mut RegisteredDecoders) { generic_register_all_codecs(rd); diff --git a/nihav-commonfmt/src/codecs/aac.rs b/nihav-commonfmt/src/codecs/aac.rs index c46366c..290868a 100644 --- a/nihav-commonfmt/src/codecs/aac.rs +++ b/nihav-commonfmt/src/codecs/aac.rs @@ -1267,8 +1267,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::test_decode_audio; - use crate::codecs::generic_register_all_codecs; - use nihav_realmedia::demuxers::realmedia_register_all_demuxers; + use crate::generic_register_all_codecs; + use nihav_realmedia::realmedia_register_all_demuxers; #[test] fn test_aac() { let mut dmx_reg = RegisteredDemuxers::new(); diff --git a/nihav-commonfmt/src/codecs/atrac3.rs b/nihav-commonfmt/src/codecs/atrac3.rs index efd608c..044fea6 100644 --- a/nihav-commonfmt/src/codecs/atrac3.rs +++ b/nihav-commonfmt/src/codecs/atrac3.rs @@ -704,8 +704,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::test_decode_audio; - use crate::codecs::generic_register_all_codecs; - use nihav_realmedia::demuxers::realmedia_register_all_demuxers; + use crate::generic_register_all_codecs; + use nihav_realmedia::realmedia_register_all_demuxers; #[test] fn test_atrac3() { let mut dmx_reg = RegisteredDemuxers::new(); diff --git a/nihav-commonfmt/src/codecs/clearvideo.rs b/nihav-commonfmt/src/codecs/clearvideo.rs index 03aa36d..4735731 100644 --- a/nihav-commonfmt/src/codecs/clearvideo.rs +++ b/nihav-commonfmt/src/codecs/clearvideo.rs @@ -718,8 +718,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::*; - use crate::codecs::generic_register_all_codecs; - use crate::demuxers::generic_register_all_demuxers; + use crate::generic_register_all_codecs; + use crate::generic_register_all_demuxers; #[test] fn test_clv() { let mut dmx_reg = RegisteredDemuxers::new(); diff --git a/nihav-commonfmt/src/codecs/mod.rs b/nihav-commonfmt/src/codecs/mod.rs index fa7b2f1..1421613 100644 --- a/nihav-commonfmt/src/codecs/mod.rs +++ b/nihav-commonfmt/src/codecs/mod.rs @@ -36,6 +36,7 @@ const DECODERS: &[DecoderInfo] = &[ DecoderInfo { name: "aac", get_decoder: aac::get_decoder }, ]; +/// Registers all available codecs provided by this crate. pub fn generic_register_all_codecs(rd: &mut RegisteredDecoders) { for decoder in DECODERS.iter() { rd.add_decoder(decoder.clone()); diff --git a/nihav-commonfmt/src/codecs/sipro.rs b/nihav-commonfmt/src/codecs/sipro.rs index 22181cb..bd72643 100644 --- a/nihav-commonfmt/src/codecs/sipro.rs +++ b/nihav-commonfmt/src/codecs/sipro.rs @@ -745,8 +745,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::test_decode_audio; - use crate::codecs::generic_register_all_codecs; - use nihav_realmedia::demuxers::realmedia_register_all_demuxers; + use crate::generic_register_all_codecs; + use nihav_realmedia::realmedia_register_all_demuxers; #[test] fn test_sipro() { let mut dmx_reg = RegisteredDemuxers::new(); diff --git a/nihav-commonfmt/src/codecs/ts102366.rs b/nihav-commonfmt/src/codecs/ts102366.rs index 5546049..cdad890 100644 --- a/nihav-commonfmt/src/codecs/ts102366.rs +++ b/nihav-commonfmt/src/codecs/ts102366.rs @@ -1249,8 +1249,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::test_decode_audio; - use crate::codecs::generic_register_all_codecs; - use nihav_realmedia::demuxers::realmedia_register_all_demuxers; + use crate::generic_register_all_codecs; + use nihav_realmedia::realmedia_register_all_demuxers; #[test] fn test_ts102366() { let mut dmx_reg = RegisteredDemuxers::new(); diff --git a/nihav-commonfmt/src/demuxers/mod.rs b/nihav-commonfmt/src/demuxers/mod.rs index 9c05c18..05518e1 100644 --- a/nihav-commonfmt/src/demuxers/mod.rs +++ b/nihav-commonfmt/src/demuxers/mod.rs @@ -15,6 +15,7 @@ const DEMUXERS: &[&DemuxerCreator] = &[ &avi::AVIDemuxerCreator {}, ]; +/// Registers all available demuxers provided by this crate. pub fn generic_register_all_demuxers(rd: &mut RegisteredDemuxers) { for demuxer in DEMUXERS.iter() { rd.add_demuxer(*demuxer); diff --git a/nihav-commonfmt/src/lib.rs b/nihav-commonfmt/src/lib.rs index bcb20ed..ce931fe 100644 --- a/nihav-commonfmt/src/lib.rs +++ b/nihav-commonfmt/src/lib.rs @@ -4,10 +4,15 @@ extern crate nihav_core; #[allow(clippy::unreadable_literal)] #[allow(clippy::too_many_arguments)] #[allow(clippy::excessive_precision)] -pub mod codecs; +mod codecs; +#[cfg(feature="decoders")] +pub use codecs::generic_register_all_codecs; + +#[cfg(feature="demuxers")] +mod demuxers; #[cfg(feature="demuxers")] -pub mod demuxers; +pub use demuxers::generic_register_all_demuxers; #[cfg(test)] extern crate nihav_realmedia; diff --git a/nihav-duck/src/codecs/dkadpcm.rs b/nihav-duck/src/codecs/dkadpcm.rs index 92e2435..b662a74 100644 --- a/nihav-duck/src/codecs/dkadpcm.rs +++ b/nihav-duck/src/codecs/dkadpcm.rs @@ -180,8 +180,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::*; - use crate::codecs::duck_register_all_codecs; - use nihav_commonfmt::demuxers::generic_register_all_demuxers; + use crate::duck_register_all_codecs; + use nihav_commonfmt::generic_register_all_demuxers; #[test] fn test_dk3() { let mut dmx_reg = RegisteredDemuxers::new(); diff --git a/nihav-duck/src/codecs/mod.rs b/nihav-duck/src/codecs/mod.rs index 40e7a5f..a094f2d 100644 --- a/nihav-duck/src/codecs/mod.rs +++ b/nihav-duck/src/codecs/mod.rs @@ -69,6 +69,7 @@ const DUCK_CODECS: &[DecoderInfo] = &[ DecoderInfo { name: "on2avc-501", get_decoder: on2avc::get_decoder_501 }, ]; +/// Registers all available codecs provided by this crate. pub fn duck_register_all_codecs(rd: &mut RegisteredDecoders) { for decoder in DUCK_CODECS.iter() { rd.add_decoder(decoder.clone()); diff --git a/nihav-duck/src/codecs/on2avc.rs b/nihav-duck/src/codecs/on2avc.rs index dc229b0..b060501 100644 --- a/nihav-duck/src/codecs/on2avc.rs +++ b/nihav-duck/src/codecs/on2avc.rs @@ -1061,8 +1061,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::*; - use crate::codecs::duck_register_all_codecs; - use nihav_commonfmt::demuxers::generic_register_all_demuxers; + use crate::duck_register_all_codecs; + use nihav_commonfmt::generic_register_all_demuxers; #[test] fn test_avc() { let mut dmx_reg = RegisteredDemuxers::new(); diff --git a/nihav-duck/src/codecs/truemotion1.rs b/nihav-duck/src/codecs/truemotion1.rs index 4af75d1..7fc74ff 100644 --- a/nihav-duck/src/codecs/truemotion1.rs +++ b/nihav-duck/src/codecs/truemotion1.rs @@ -668,8 +668,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::*; - use crate::codecs::duck_register_all_codecs; - use nihav_commonfmt::demuxers::generic_register_all_demuxers; + use crate::duck_register_all_codecs; + use nihav_commonfmt::generic_register_all_demuxers; #[test] fn test_tm1() { let mut dmx_reg = RegisteredDemuxers::new(); diff --git a/nihav-duck/src/codecs/truemotion2.rs b/nihav-duck/src/codecs/truemotion2.rs index 32fb732..2ee8b24 100644 --- a/nihav-duck/src/codecs/truemotion2.rs +++ b/nihav-duck/src/codecs/truemotion2.rs @@ -590,8 +590,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::*; - use crate::codecs::duck_register_all_codecs; - use nihav_commonfmt::demuxers::generic_register_all_demuxers; + use crate::duck_register_all_codecs; + use nihav_commonfmt::generic_register_all_demuxers; #[test] fn test_tm2() { let mut dmx_reg = RegisteredDemuxers::new(); diff --git a/nihav-duck/src/codecs/truemotion2x.rs b/nihav-duck/src/codecs/truemotion2x.rs index 8efd66f..165642a 100644 --- a/nihav-duck/src/codecs/truemotion2x.rs +++ b/nihav-duck/src/codecs/truemotion2x.rs @@ -701,8 +701,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::*; - use crate::codecs::duck_register_all_codecs; - use nihav_commonfmt::demuxers::generic_register_all_demuxers; + use crate::duck_register_all_codecs; + use nihav_commonfmt::generic_register_all_demuxers; #[test] fn test_tm2x() { let mut dmx_reg = RegisteredDemuxers::new(); diff --git a/nihav-duck/src/codecs/truemotionrt.rs b/nihav-duck/src/codecs/truemotionrt.rs index 2ea7a1b..8fd2a8e 100644 --- a/nihav-duck/src/codecs/truemotionrt.rs +++ b/nihav-duck/src/codecs/truemotionrt.rs @@ -93,8 +93,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::*; - use crate::codecs::duck_register_all_codecs; - use nihav_commonfmt::demuxers::generic_register_all_demuxers; + use crate::duck_register_all_codecs; + use nihav_commonfmt::generic_register_all_demuxers; #[test] fn test_tmrt() { let mut dmx_reg = RegisteredDemuxers::new(); diff --git a/nihav-duck/src/codecs/vp3.rs b/nihav-duck/src/codecs/vp3.rs index 8c72f7f..3b8560e 100644 --- a/nihav-duck/src/codecs/vp3.rs +++ b/nihav-duck/src/codecs/vp3.rs @@ -1876,8 +1876,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::*; - use crate::codecs::duck_register_all_codecs; - use nihav_commonfmt::demuxers::generic_register_all_demuxers; + use crate::duck_register_all_codecs; + use nihav_commonfmt::generic_register_all_demuxers; #[test] fn test_vp30() { diff --git a/nihav-duck/src/codecs/vp5.rs b/nihav-duck/src/codecs/vp5.rs index f6a649e..35244df 100644 --- a/nihav-duck/src/codecs/vp5.rs +++ b/nihav-duck/src/codecs/vp5.rs @@ -286,8 +286,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::*; - use crate::codecs::duck_register_all_codecs; - use nihav_commonfmt::demuxers::generic_register_all_demuxers; + use crate::duck_register_all_codecs; + use nihav_commonfmt::generic_register_all_demuxers; #[test] fn test_vp5() { diff --git a/nihav-duck/src/codecs/vp6.rs b/nihav-duck/src/codecs/vp6.rs index fdf6252..da0fe40 100644 --- a/nihav-duck/src/codecs/vp6.rs +++ b/nihav-duck/src/codecs/vp6.rs @@ -727,8 +727,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::*; - use crate::codecs::duck_register_all_codecs; - use nihav_commonfmt::demuxers::generic_register_all_demuxers; + use crate::duck_register_all_codecs; + use nihav_commonfmt::generic_register_all_demuxers; #[test] fn test_vp6() { diff --git a/nihav-duck/src/codecs/vp7.rs b/nihav-duck/src/codecs/vp7.rs index 543d093..9b3eef3 100644 --- a/nihav-duck/src/codecs/vp7.rs +++ b/nihav-duck/src/codecs/vp7.rs @@ -1431,8 +1431,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::*; - use crate::codecs::duck_register_all_codecs; - use nihav_commonfmt::demuxers::generic_register_all_demuxers; + use crate::duck_register_all_codecs; + use nihav_commonfmt::generic_register_all_demuxers; #[test] fn test_vp7() { diff --git a/nihav-duck/src/lib.rs b/nihav-duck/src/lib.rs index 40b5f2b..1760338 100644 --- a/nihav-duck/src/lib.rs +++ b/nihav-duck/src/lib.rs @@ -1,6 +1,8 @@ extern crate nihav_core; -pub mod codecs; +mod codecs; + +pub use codecs::duck_register_all_codecs; #[cfg(test)] extern crate nihav_commonfmt; diff --git a/nihav-game/src/codecs/bmv.rs b/nihav-game/src/codecs/bmv.rs index 1f4a660..bdd18e4 100644 --- a/nihav-game/src/codecs/bmv.rs +++ b/nihav-game/src/codecs/bmv.rs @@ -308,8 +308,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::*; - use crate::codecs::game_register_all_codecs; - use crate::demuxers::game_register_all_demuxers; + use crate::game_register_all_codecs; + use crate::game_register_all_demuxers; #[test] fn test_bmv_video() { let mut dmx_reg = RegisteredDemuxers::new(); diff --git a/nihav-game/src/codecs/bmv3.rs b/nihav-game/src/codecs/bmv3.rs index 8e71b8b..3fafb6d 100644 --- a/nihav-game/src/codecs/bmv3.rs +++ b/nihav-game/src/codecs/bmv3.rs @@ -604,8 +604,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::*; - use crate::codecs::game_register_all_codecs; - use crate::demuxers::game_register_all_demuxers; + use crate::game_register_all_codecs; + use crate::game_register_all_demuxers; #[test] fn test_bmv_video() { let mut dmx_reg = RegisteredDemuxers::new(); diff --git a/nihav-game/src/codecs/gremlinvideo.rs b/nihav-game/src/codecs/gremlinvideo.rs index 0ec3861..096c7b6 100644 --- a/nihav-game/src/codecs/gremlinvideo.rs +++ b/nihav-game/src/codecs/gremlinvideo.rs @@ -563,8 +563,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::test_file_decoding; - use crate::codecs::game_register_all_codecs; - use crate::demuxers::game_register_all_demuxers; + use crate::game_register_all_codecs; + use crate::game_register_all_demuxers; #[test] fn test_gdv() { let mut dmx_reg = RegisteredDemuxers::new(); diff --git a/nihav-game/src/codecs/midivid.rs b/nihav-game/src/codecs/midivid.rs index 13c954a..df788f6 100644 --- a/nihav-game/src/codecs/midivid.rs +++ b/nihav-game/src/codecs/midivid.rs @@ -184,8 +184,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::*; - use crate::codecs::game_register_all_codecs; - use nihav_commonfmt::demuxers::generic_register_all_demuxers; + use crate::game_register_all_codecs; + use nihav_commonfmt::generic_register_all_demuxers; #[test] fn test_midivid_video() { let mut dmx_reg = RegisteredDemuxers::new(); diff --git a/nihav-game/src/codecs/mod.rs b/nihav-game/src/codecs/mod.rs index 6f707e9..a3d5555 100644 --- a/nihav-game/src/codecs/mod.rs +++ b/nihav-game/src/codecs/mod.rs @@ -36,6 +36,7 @@ const GAME_CODECS: &[DecoderInfo] = &[ DecoderInfo { name: "midivid", get_decoder: midivid::get_decoder_video }, ]; +/// Registers all available codecs provided by this crate. pub fn game_register_all_codecs(rd: &mut RegisteredDecoders) { for decoder in GAME_CODECS.iter() { rd.add_decoder(decoder.clone()); diff --git a/nihav-game/src/codecs/vmd.rs b/nihav-game/src/codecs/vmd.rs index a228707..1f4964e 100644 --- a/nihav-game/src/codecs/vmd.rs +++ b/nihav-game/src/codecs/vmd.rs @@ -452,8 +452,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::*; - use crate::codecs::game_register_all_codecs; - use crate::demuxers::game_register_all_demuxers; + use crate::game_register_all_codecs; + use crate::game_register_all_demuxers; #[test] fn test_vmd_video() { let mut dmx_reg = RegisteredDemuxers::new(); diff --git a/nihav-game/src/demuxers/mod.rs b/nihav-game/src/demuxers/mod.rs index 7dca6d2..236b3cf 100644 --- a/nihav-game/src/demuxers/mod.rs +++ b/nihav-game/src/demuxers/mod.rs @@ -23,6 +23,7 @@ const GAME_DEMUXERS: &[&DemuxerCreator] = &[ &vmd::VMDDemuxerCreator {}, ]; +/// Registers all available demuxers provided by this crate. pub fn game_register_all_demuxers(rd: &mut RegisteredDemuxers) { for demuxer in GAME_DEMUXERS.iter() { rd.add_demuxer(*demuxer); diff --git a/nihav-game/src/lib.rs b/nihav-game/src/lib.rs index d7a15d0..20207be 100644 --- a/nihav-game/src/lib.rs +++ b/nihav-game/src/lib.rs @@ -1,4 +1,6 @@ extern crate nihav_core; -pub mod codecs; -pub mod demuxers; \ No newline at end of file +mod codecs; +pub use codecs::game_register_all_codecs; +mod demuxers; +pub use demuxers::game_register_all_demuxers; \ No newline at end of file diff --git a/nihav-indeo/src/codecs/imc.rs b/nihav-indeo/src/codecs/imc.rs index b969a14..e49da70 100644 --- a/nihav-indeo/src/codecs/imc.rs +++ b/nihav-indeo/src/codecs/imc.rs @@ -1112,8 +1112,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::*; - use crate::codecs::indeo_register_all_codecs; - use nihav_commonfmt::demuxers::generic_register_all_demuxers; + use crate::indeo_register_all_codecs; + use nihav_commonfmt::generic_register_all_demuxers; #[test] fn test_imc() { let mut dmx_reg = RegisteredDemuxers::new(); diff --git a/nihav-indeo/src/codecs/indeo2.rs b/nihav-indeo/src/codecs/indeo2.rs index 8126be0..2e1d7c6 100644 --- a/nihav-indeo/src/codecs/indeo2.rs +++ b/nihav-indeo/src/codecs/indeo2.rs @@ -373,8 +373,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::*; - use crate::codecs::indeo_register_all_codecs; - use nihav_commonfmt::demuxers::generic_register_all_demuxers; + use crate::indeo_register_all_codecs; + use nihav_commonfmt::generic_register_all_demuxers; #[test] fn test_indeo2() { let mut dmx_reg = RegisteredDemuxers::new(); diff --git a/nihav-indeo/src/codecs/indeo3.rs b/nihav-indeo/src/codecs/indeo3.rs index fe9333b..ea302ab 100644 --- a/nihav-indeo/src/codecs/indeo3.rs +++ b/nihav-indeo/src/codecs/indeo3.rs @@ -801,8 +801,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::*; - use crate::codecs::indeo_register_all_codecs; - use nihav_commonfmt::demuxers::generic_register_all_demuxers; + use crate::indeo_register_all_codecs; + use nihav_commonfmt::generic_register_all_demuxers; #[test] fn test_indeo3() { let mut dmx_reg = RegisteredDemuxers::new(); diff --git a/nihav-indeo/src/codecs/indeo4.rs b/nihav-indeo/src/codecs/indeo4.rs index d6bb283..9ae4158 100644 --- a/nihav-indeo/src/codecs/indeo4.rs +++ b/nihav-indeo/src/codecs/indeo4.rs @@ -770,8 +770,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::*; - use crate::codecs::indeo_register_all_codecs; - use nihav_commonfmt::demuxers::generic_register_all_demuxers; + use crate::indeo_register_all_codecs; + use nihav_commonfmt::generic_register_all_demuxers; #[test] fn test_indeo4() { let mut dmx_reg = RegisteredDemuxers::new(); diff --git a/nihav-indeo/src/codecs/indeo5.rs b/nihav-indeo/src/codecs/indeo5.rs index 47f2437..933958d 100644 --- a/nihav-indeo/src/codecs/indeo5.rs +++ b/nihav-indeo/src/codecs/indeo5.rs @@ -723,8 +723,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::*; - use crate::codecs::indeo_register_all_codecs; - use nihav_commonfmt::demuxers::generic_register_all_demuxers; + use crate::indeo_register_all_codecs; + use nihav_commonfmt::generic_register_all_demuxers; #[test] fn test_indeo5() { let mut dmx_reg = RegisteredDemuxers::new(); diff --git a/nihav-indeo/src/codecs/intel263.rs b/nihav-indeo/src/codecs/intel263.rs index 3d767f9..18c759d 100644 --- a/nihav-indeo/src/codecs/intel263.rs +++ b/nihav-indeo/src/codecs/intel263.rs @@ -419,8 +419,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::*; - use crate::codecs::indeo_register_all_codecs; - use nihav_commonfmt::demuxers::generic_register_all_demuxers; + use crate::indeo_register_all_codecs; + use nihav_commonfmt::generic_register_all_demuxers; #[test] fn test_intel263() { let mut dmx_reg = RegisteredDemuxers::new(); diff --git a/nihav-indeo/src/codecs/mod.rs b/nihav-indeo/src/codecs/mod.rs index bc343fe..4ab5e8f 100644 --- a/nihav-indeo/src/codecs/mod.rs +++ b/nihav-indeo/src/codecs/mod.rs @@ -46,6 +46,7 @@ const INDEO_CODECS: &[DecoderInfo] = &[ DecoderInfo { name: "iac", get_decoder: imc::get_decoder_iac }, ]; +/// Registers all available codecs provided by this crate. pub fn indeo_register_all_codecs(rd: &mut RegisteredDecoders) { for decoder in INDEO_CODECS.iter() { rd.add_decoder(decoder.clone()); diff --git a/nihav-indeo/src/lib.rs b/nihav-indeo/src/lib.rs index 78bb060..1ceba4e 100644 --- a/nihav-indeo/src/lib.rs +++ b/nihav-indeo/src/lib.rs @@ -6,7 +6,9 @@ extern crate nihav_core; #[allow(clippy::too_many_arguments)] #[allow(clippy::useless_let_if_seq)] #[allow(clippy::verbose_bit_mask)] -pub mod codecs; +mod codecs; + +pub use codecs::indeo_register_all_codecs; #[cfg(test)] extern crate nihav_commonfmt; \ No newline at end of file diff --git a/nihav-rad/src/codecs/bink2.rs b/nihav-rad/src/codecs/bink2.rs index e1d5b59..5f1fefd 100644 --- a/nihav-rad/src/codecs/bink2.rs +++ b/nihav-rad/src/codecs/bink2.rs @@ -1951,8 +1951,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::*; - use crate::codecs::rad_register_all_codecs; - use crate::demuxers::rad_register_all_demuxers; + use crate::rad_register_all_codecs; + use crate::rad_register_all_demuxers; #[test] fn test_bink2() { let mut dmx_reg = RegisteredDemuxers::new(); diff --git a/nihav-rad/src/codecs/binkaud.rs b/nihav-rad/src/codecs/binkaud.rs index 48bc508..7e34739 100644 --- a/nihav-rad/src/codecs/binkaud.rs +++ b/nihav-rad/src/codecs/binkaud.rs @@ -291,8 +291,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::*; - use crate::codecs::rad_register_all_codecs; - use crate::demuxers::rad_register_all_demuxers; + use crate::rad_register_all_codecs; + use crate::rad_register_all_demuxers; #[test] fn test_bink_audio() { diff --git a/nihav-rad/src/codecs/binkvid.rs b/nihav-rad/src/codecs/binkvid.rs index ac434ad..920d8d5 100644 --- a/nihav-rad/src/codecs/binkvid.rs +++ b/nihav-rad/src/codecs/binkvid.rs @@ -1272,8 +1272,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::*; - use crate::codecs::rad_register_all_codecs; - use crate::demuxers::rad_register_all_demuxers; + use crate::rad_register_all_codecs; + use crate::rad_register_all_demuxers; #[test] fn test_binkvid() { let mut dmx_reg = RegisteredDemuxers::new(); diff --git a/nihav-rad/src/codecs/mod.rs b/nihav-rad/src/codecs/mod.rs index eec8c4c..2e279b6 100644 --- a/nihav-rad/src/codecs/mod.rs +++ b/nihav-rad/src/codecs/mod.rs @@ -28,6 +28,7 @@ const RAD_CODECS: &[DecoderInfo] = &[ DecoderInfo { name: "bink2-video", get_decoder: bink2::get_decoder }, ]; +/// Registers all available codecs provided by this crate. pub fn rad_register_all_codecs(rd: &mut RegisteredDecoders) { for decoder in RAD_CODECS.iter() { rd.add_decoder(decoder.clone()); diff --git a/nihav-rad/src/codecs/smacker.rs b/nihav-rad/src/codecs/smacker.rs index 86b022c..b8fe85a 100644 --- a/nihav-rad/src/codecs/smacker.rs +++ b/nihav-rad/src/codecs/smacker.rs @@ -604,8 +604,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::*; - use crate::codecs::rad_register_all_codecs; - use crate::demuxers::rad_register_all_demuxers; + use crate::rad_register_all_codecs; + use crate::rad_register_all_demuxers; #[test] fn test_smkvid() { let mut dmx_reg = RegisteredDemuxers::new(); diff --git a/nihav-rad/src/demuxers/mod.rs b/nihav-rad/src/demuxers/mod.rs index c88fdd6..1bdf74d 100644 --- a/nihav-rad/src/demuxers/mod.rs +++ b/nihav-rad/src/demuxers/mod.rs @@ -17,6 +17,7 @@ const RAD_DEMUXERS: &[&DemuxerCreator] = &[ &bink::BinkDemuxerCreator {}, ]; +/// Registers all available demuxers provided by this crate. pub fn rad_register_all_demuxers(rd: &mut RegisteredDemuxers) { for demuxer in RAD_DEMUXERS.iter() { rd.add_demuxer(*demuxer); diff --git a/nihav-rad/src/lib.rs b/nihav-rad/src/lib.rs index 1b566da..604d0ca 100644 --- a/nihav-rad/src/lib.rs +++ b/nihav-rad/src/lib.rs @@ -9,7 +9,12 @@ extern crate nihav_core; #[allow(clippy::too_many_arguments)] #[allow(clippy::unreadable_literal)] #[allow(clippy::useless_let_if_seq)] -pub mod codecs; +mod codecs; +#[cfg(feature="decoders")] +pub use codecs::rad_register_all_codecs; + #[cfg(feature="demuxers")] #[allow(clippy::cast_lossless)] -pub mod demuxers; \ No newline at end of file +mod demuxers; +#[cfg(feature="demuxers")] +pub use demuxers::rad_register_all_demuxers; diff --git a/nihav-realmedia/src/codecs/cook.rs b/nihav-realmedia/src/codecs/cook.rs index fe5ae71..85c8853 100644 --- a/nihav-realmedia/src/codecs/cook.rs +++ b/nihav-realmedia/src/codecs/cook.rs @@ -685,8 +685,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::*; - use crate::codecs::realmedia_register_all_codecs; - use crate::demuxers::realmedia_register_all_demuxers; + use crate::realmedia_register_all_codecs; + use crate::realmedia_register_all_demuxers; #[test] fn test_cook() { let mut dmx_reg = RegisteredDemuxers::new(); diff --git a/nihav-realmedia/src/codecs/mod.rs b/nihav-realmedia/src/codecs/mod.rs index c5ff9bc..cbcdb83 100644 --- a/nihav-realmedia/src/codecs/mod.rs +++ b/nihav-realmedia/src/codecs/mod.rs @@ -71,6 +71,7 @@ const RM_CODECS: &[DecoderInfo] = &[ DecoderInfo { name: "ralf", get_decoder: ralf::get_decoder }, ]; +/// Registers all available codecs provided by this crate. pub fn realmedia_register_all_codecs(rd: &mut RegisteredDecoders) { for decoder in RM_CODECS.iter() { rd.add_decoder(decoder.clone()); diff --git a/nihav-realmedia/src/codecs/ra144.rs b/nihav-realmedia/src/codecs/ra144.rs index 35090a6..842c4d1 100644 --- a/nihav-realmedia/src/codecs/ra144.rs +++ b/nihav-realmedia/src/codecs/ra144.rs @@ -320,8 +320,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::*; - use crate::codecs::realmedia_register_all_codecs; - use crate::demuxers::realmedia_register_all_demuxers; + use crate::realmedia_register_all_codecs; + use crate::realmedia_register_all_demuxers; #[test] fn test_ra144() { let mut dmx_reg = RegisteredDemuxers::new(); diff --git a/nihav-realmedia/src/codecs/ra288.rs b/nihav-realmedia/src/codecs/ra288.rs index 416c64c..a041d05 100644 --- a/nihav-realmedia/src/codecs/ra288.rs +++ b/nihav-realmedia/src/codecs/ra288.rs @@ -210,8 +210,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::*; - use crate::codecs::realmedia_register_all_codecs; - use crate::demuxers::realmedia_register_all_demuxers; + use crate::realmedia_register_all_codecs; + use crate::realmedia_register_all_demuxers; #[test] fn test_ra288() { let mut dmx_reg = RegisteredDemuxers::new(); diff --git a/nihav-realmedia/src/codecs/ralf.rs b/nihav-realmedia/src/codecs/ralf.rs index c16075b..fde7648 100644 --- a/nihav-realmedia/src/codecs/ralf.rs +++ b/nihav-realmedia/src/codecs/ralf.rs @@ -480,8 +480,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::*; - use crate::codecs::realmedia_register_all_codecs; - use crate::demuxers::realmedia_register_all_demuxers; + use crate::realmedia_register_all_codecs; + use crate::realmedia_register_all_demuxers; #[test] fn test_ralf() { let mut dmx_reg = RegisteredDemuxers::new(); diff --git a/nihav-realmedia/src/codecs/rv10.rs b/nihav-realmedia/src/codecs/rv10.rs index 6a7325f..320968a 100644 --- a/nihav-realmedia/src/codecs/rv10.rs +++ b/nihav-realmedia/src/codecs/rv10.rs @@ -464,8 +464,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::*; - use crate::codecs::realmedia_register_all_codecs; - use crate::demuxers::realmedia_register_all_demuxers; + use crate::realmedia_register_all_codecs; + use crate::realmedia_register_all_demuxers; #[test] fn test_rv10() { let mut dmx_reg = RegisteredDemuxers::new(); diff --git a/nihav-realmedia/src/codecs/rv20.rs b/nihav-realmedia/src/codecs/rv20.rs index 3b79110..b3f1e56 100644 --- a/nihav-realmedia/src/codecs/rv20.rs +++ b/nihav-realmedia/src/codecs/rv20.rs @@ -528,8 +528,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::*; - use crate::codecs::realmedia_register_all_codecs; - use crate::demuxers::realmedia_register_all_demuxers; + use crate::realmedia_register_all_codecs; + use crate::realmedia_register_all_demuxers; #[test] fn test_rv20() { let mut dmx_reg = RegisteredDemuxers::new(); diff --git a/nihav-realmedia/src/codecs/rv30.rs b/nihav-realmedia/src/codecs/rv30.rs index 6da3fe2..e38c89c 100644 --- a/nihav-realmedia/src/codecs/rv30.rs +++ b/nihav-realmedia/src/codecs/rv30.rs @@ -173,8 +173,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::*; - use crate::codecs::realmedia_register_all_codecs; - use crate::demuxers::realmedia_register_all_demuxers; + use crate::realmedia_register_all_codecs; + use crate::realmedia_register_all_demuxers; #[test] fn test_rv30() { let mut dmx_reg = RegisteredDemuxers::new(); diff --git a/nihav-realmedia/src/codecs/rv40.rs b/nihav-realmedia/src/codecs/rv40.rs index 82f75f2..5f95f0a 100644 --- a/nihav-realmedia/src/codecs/rv40.rs +++ b/nihav-realmedia/src/codecs/rv40.rs @@ -366,8 +366,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::*; - use crate::codecs::realmedia_register_all_codecs; - use crate::demuxers::realmedia_register_all_demuxers; + use crate::realmedia_register_all_codecs; + use crate::realmedia_register_all_demuxers; #[test] fn test_rv40() { let mut dmx_reg = RegisteredDemuxers::new(); diff --git a/nihav-realmedia/src/codecs/rv60.rs b/nihav-realmedia/src/codecs/rv60.rs index 14b487d..801f8c2 100644 --- a/nihav-realmedia/src/codecs/rv60.rs +++ b/nihav-realmedia/src/codecs/rv60.rs @@ -1529,8 +1529,8 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_core::test::dec_video::*; - use crate::codecs::realmedia_register_all_codecs; - use crate::demuxers::realmedia_register_all_demuxers; + use crate::realmedia_register_all_codecs; + use crate::realmedia_register_all_demuxers; #[test] fn test_rv60() { let mut dmx_reg = RegisteredDemuxers::new(); diff --git a/nihav-realmedia/src/demuxers/mod.rs b/nihav-realmedia/src/demuxers/mod.rs index c5825b3..e6f8a2c 100644 --- a/nihav-realmedia/src/demuxers/mod.rs +++ b/nihav-realmedia/src/demuxers/mod.rs @@ -16,6 +16,7 @@ const RM_DEMUXERS: &[&DemuxerCreator] = &[ &realmedia::RealIVRDemuxerCreator {}, ]; +/// Registers all available demuxers provided by this crate. pub fn realmedia_register_all_demuxers(rd: &mut RegisteredDemuxers) { for demuxer in RM_DEMUXERS.iter() { rd.add_demuxer(*demuxer); diff --git a/nihav-realmedia/src/lib.rs b/nihav-realmedia/src/lib.rs index 412982e..66e001a 100644 --- a/nihav-realmedia/src/lib.rs +++ b/nihav-realmedia/src/lib.rs @@ -9,10 +9,15 @@ extern crate nihav_core; #[allow(clippy::too_many_arguments)] #[allow(clippy::unreadable_literal)] #[allow(clippy::useless_let_if_seq)] -pub mod codecs; +mod codecs; +#[cfg(feature="decoders")] +pub use codecs::realmedia_register_all_codecs; + #[cfg(feature="demuxers")] #[allow(clippy::cast_lossless)] #[allow(clippy::too_many_arguments)] #[allow(clippy::unreadable_literal)] #[allow(clippy::useless_let_if_seq)] -pub mod demuxers; \ No newline at end of file +mod demuxers; +#[cfg(feature="demuxers")] +pub use demuxers::realmedia_register_all_demuxers; \ No newline at end of file