]> git.nihav.org Git - nihav-tool.git/commitdiff
adapt to new split crates
authorKostya Shishkov <kostya.shishkov@gmail.com>
Thu, 17 Jan 2019 11:26:49 +0000 (12:26 +0100)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Thu, 17 Jan 2019 11:26:49 +0000 (12:26 +0100)
Cargo.toml
src/frmwriter.rs
src/main.rs
src/wavwriter.rs

index 2a5c5483f4394aa7036c5cd359db60a0595b480f..f94d08dc8288dfdb94a3f050b088b3078994ed92 100644 (file)
@@ -5,4 +5,5 @@ authors = ["Kostya Shishkov <kostya.shishkov@gmail.com>"]
 edition = "2018"
 
 [dependencies]
-nihav = { path="../nihav" }
+nihav_core = { path="../nihav-core" }
+nihav_allstuff = { path="../nihav-allstuff" }
index d4ea654f707d970e80fc2bec919709432c537d14..a01d8b3d5f943a75425574240b43760fe3fc5883 100644 (file)
@@ -1,6 +1,6 @@
-extern crate nihav;
+extern crate nihav_core;
 
-use nihav::frame::*;
+use nihav_core::frame::*;
 use std::io::prelude::*;
 use std::fs::File;
 use std::cell::Ref;
index 4eafdcb9a96dc32af5c7a90dcc02298c32c2b216..214427ec296889d9130a8dde15e7079a684bb258 100644 (file)
@@ -1,13 +1,15 @@
-extern crate nihav;
+extern crate nihav_core;
+extern crate nihav_allstuff;
 
 use std::io::SeekFrom;
 use std::fs::File;
 use std::path::Path;
-use nihav::io::byteio::{FileReader, ByteReader};
-use nihav::frame::*;
-use nihav::codecs::*;
-use nihav::demuxers::*;
-use nihav::detect;
+use nihav_core::io::byteio::{FileReader, ByteReader};
+use nihav_core::frame::*;
+use nihav_core::codecs::*;
+use nihav_core::demuxers::*;
+use nihav_core::detect;
+use nihav_allstuff::*;
 use std::env;
 
 mod frmwriter;
@@ -117,7 +119,13 @@ fn main() {
     }
     let (dmx_name, _) = res.unwrap();
 println!("trying demuxer {} on {}", dmx_name, name);
-    dmx_fact = find_demuxer(dmx_name).unwrap();
+
+    let mut dmx_reg = RegisteredDemuxers::new();
+    nihav_register_all_demuxers(&mut dmx_reg);
+    let mut dec_reg = RegisteredDecoders::new();
+    nihav_register_all_codecs(&mut dec_reg);
+
+    dmx_fact = dmx_reg.find_demuxer(dmx_name).unwrap();
     br.seek(SeekFrom::Start(0)).unwrap();
     let mut dmx = create_demuxer(dmx_fact, &mut br).unwrap();
 
@@ -127,7 +135,7 @@ println!("trying demuxer {} on {}", dmx_name, name);
     for i in 0..dmx.get_num_streams() {
         let s = dmx.get_stream(i).unwrap();
         let info = s.get_info();
-        let decfunc = find_decoder(info.get_name());
+        let decfunc = dec_reg.find_decoder(info.get_name());
 println!("stream {} - {} {}", i, s, info.get_name());
         let str_id = s.get_id();
         let mut has_out = false;
index 2296f6f456f1d5753f1d68b69f9eab69a8224b1f..51700f7b7502badfd852c7216f35fec9cba3b79c 100644 (file)
@@ -1,7 +1,7 @@
-extern crate nihav;
+extern crate nihav_core;
 
-use nihav::io::byteio::*;
-use nihav::frame::*;
+use nihav_core::io::byteio::*;
+use nihav_core::frame::*;
 use std::fs::File;
 use std::io::SeekFrom;