]> git.nihav.org Git - nihav-player.git/commitdiff
sndplay: use custom decoder crates configuration
authorKostya Shishkov <kostya.shishkov@gmail.com>
Mon, 5 Apr 2021 16:11:46 +0000 (18:11 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Mon, 5 Apr 2021 16:32:13 +0000 (18:32 +0200)
sndplay/Cargo.toml
sndplay/src/allreg.rs [new file with mode: 0644]
sndplay/src/main.rs

index 34124419eb3a7a9657d00cf454eb5c85c3181675..1661282ab7b149dfaeac15fff42ecbfdb967bdcb 100644 (file)
@@ -7,6 +7,17 @@ edition = "2018"
 [dependencies]
 nihav_core = { path="../../nihav-core" }
 nihav_registry = { path="../../nihav-registry" }
-nihav_allstuff = { path="../../nihav-allstuff" }
+nihav_commonfmt = { path="../../nihav-commonfmt", default-features=false, features = ["all_demuxers", "all_audio_decoders"] }
+nihav_duck = { path = "../../nihav-duck", default-features=false, features = ["all_audio_decoders"] }
+nihav_game = { path = "../../nihav-game", default-features=false, features = ["all_demuxers", "all_audio_decoders"] }
+nihav_indeo = { path = "../../nihav-indeo", default-features=false, features = ["all_audio_decoders"] }
+#nihav_itu = { path = "../../nihav-itu" }
+nihav_llaudio = { path = "../../nihav-llaudio" }
+nihav_ms = { path = "../../nihav-ms", default-features=false, features = ["all_audio_decoders"] }
+nihav_qt = { path = "../../nihav-qt", default-features=false, features = ["all_audio_decoders"] }
+nihav_rad = { path = "../../nihav-rad", default-features=false, features = ["all_demuxers", "all_audio_decoders"] }
+nihav_realmedia = { path = "../../nihav-realmedia", default-features=false, features = ["all_demuxers", "all_audio_decoders"] }
+nihav_vivo = { path = "../../nihav-vivo", default-features=false, features = ["all_demuxers", "all_audio_decoders"] }
+
 libc = "^0.2"
 sdl2-sys = "^0.34"
diff --git a/sndplay/src/allreg.rs b/sndplay/src/allreg.rs
new file mode 100644 (file)
index 0000000..d0c6b39
--- /dev/null
@@ -0,0 +1,51 @@
+use nihav_core::codecs::RegisteredDecoders;
+use nihav_core::demuxers::RegisteredDemuxers;
+
+use nihav_commonfmt::generic_register_all_decoders;
+use nihav_commonfmt::generic_register_all_demuxers;
+
+use nihav_duck::duck_register_all_decoders;
+
+use nihav_game::game_register_all_decoders;
+use nihav_game::game_register_all_demuxers;
+
+use nihav_indeo::indeo_register_all_decoders;
+
+use nihav_llaudio::llaudio_register_all_decoders;
+use nihav_llaudio::llaudio_register_all_demuxers;
+
+use nihav_ms::ms_register_all_decoders;
+
+use nihav_qt::qt_register_all_decoders;
+
+use nihav_rad::rad_register_all_decoders;
+use nihav_rad::rad_register_all_demuxers;
+
+use nihav_realmedia::realmedia_register_all_decoders;
+use nihav_realmedia::realmedia_register_all_demuxers;
+
+use nihav_vivo::vivo_register_all_decoders;
+use nihav_vivo::vivo_register_all_demuxers;
+
+pub fn register_all_decoders(rd: &mut RegisteredDecoders) {
+    generic_register_all_decoders(rd);
+    duck_register_all_decoders(rd);
+    game_register_all_decoders(rd);
+    indeo_register_all_decoders(rd);
+    llaudio_register_all_decoders(rd);
+    ms_register_all_decoders(rd);
+    qt_register_all_decoders(rd);
+    rad_register_all_decoders(rd);
+    realmedia_register_all_decoders(rd);
+    vivo_register_all_decoders(rd);
+}
+
+pub fn register_all_demuxers(rd: &mut RegisteredDemuxers) {
+    generic_register_all_demuxers(rd);
+    game_register_all_demuxers(rd);
+    llaudio_register_all_demuxers(rd);
+    rad_register_all_demuxers(rd);
+    realmedia_register_all_demuxers(rd);
+    vivo_register_all_demuxers(rd);
+}
+
index e1b8472886a93aab83ed46cecd65846b1d47d67b..bdd64dcdaa60a4a501917f622a607e2a02f10686 100644 (file)
@@ -2,7 +2,6 @@ extern crate libc;
 extern crate sdl2_sys;
 extern crate nihav_core;
 extern crate nihav_registry;
-extern crate nihav_allstuff;
 
 use std::fs::File;
 use std::io::prelude::*;
@@ -17,8 +16,8 @@ use nihav_core::codecs::*;
 use nihav_core::demuxers::*;
 use nihav_core::soundcvt::*;
 use nihav_registry::detect;
-use nihav_allstuff::*;
 
+mod allreg;
 mod command;
 use command::*;
 
@@ -214,9 +213,9 @@ fn format_time(ms: u64) -> String {
 impl Player {
     fn new() -> Self {
         let mut dmx_reg = RegisteredDemuxers::new();
-        nihav_register_all_demuxers(&mut dmx_reg);
+        allreg::register_all_demuxers(&mut dmx_reg);
         let mut dec_reg = RegisteredDecoders::new();
-        nihav_register_all_decoders(&mut dec_reg);
+        allreg::register_all_decoders(&mut dec_reg);
 
         unsafe {
             if sdl2_sys::SDL_Init(sdl2_sys::SDL_INIT_AUDIO) != 0 {