From 98b31ef77be7fdff7d8b209358b37626a5cb7be7 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Thu, 17 Jan 2019 12:26:49 +0100 Subject: [PATCH] adapt to new split crates --- Cargo.toml | 3 ++- src/frmwriter.rs | 4 ++-- src/main.rs | 24 ++++++++++++++++-------- src/wavwriter.rs | 6 +++--- 4 files changed, 23 insertions(+), 14 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2a5c548..f94d08d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,4 +5,5 @@ authors = ["Kostya Shishkov "] edition = "2018" [dependencies] -nihav = { path="../nihav" } +nihav_core = { path="../nihav-core" } +nihav_allstuff = { path="../nihav-allstuff" } diff --git a/src/frmwriter.rs b/src/frmwriter.rs index d4ea654..a01d8b3 100644 --- a/src/frmwriter.rs +++ b/src/frmwriter.rs @@ -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; diff --git a/src/main.rs b/src/main.rs index 4eafdcb..214427e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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; diff --git a/src/wavwriter.rs b/src/wavwriter.rs index 2296f6f..51700f7 100644 --- a/src/wavwriter.rs +++ b/src/wavwriter.rs @@ -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; -- 2.39.5