From 32f7cbe538d71574f7ac05aa51599d2678f5db3f Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Thu, 20 Feb 2020 11:35:16 +0100 Subject: [PATCH] split nihav-registry from nihav-core --- nihav-allstuff/Cargo.toml | 5 ++++- nihav-allstuff/src/lib.rs | 5 ++++- nihav-commonfmt/Cargo.toml | 3 +++ nihav-commonfmt/src/demuxers/avi.rs | 2 +- nihav-commonfmt/src/lib.rs | 1 + nihav-core/src/lib.rs | 3 --- nihav-registry/Cargo.toml | 8 ++++++++ {nihav-core => nihav-registry}/src/detect.rs | 2 +- nihav-registry/src/lib.rs | 6 ++++++ {nihav-core => nihav-registry}/src/register.rs | 0 10 files changed, 28 insertions(+), 7 deletions(-) create mode 100644 nihav-registry/Cargo.toml rename {nihav-core => nihav-registry}/src/detect.rs (99%) create mode 100644 nihav-registry/src/lib.rs rename {nihav-core => nihav-registry}/src/register.rs (100%) diff --git a/nihav-allstuff/Cargo.toml b/nihav-allstuff/Cargo.toml index 023aaa4..b8ef869 100644 --- a/nihav-allstuff/Cargo.toml +++ b/nihav-allstuff/Cargo.toml @@ -11,4 +11,7 @@ nihav_duck = { path = "../nihav-duck" } nihav_game = { path = "../nihav-game" } nihav_indeo = { path = "../nihav-indeo" } nihav_rad = { path = "../nihav-rad" } -nihav_realmedia = { path = "../nihav-realmedia" } \ No newline at end of file +nihav_realmedia = { path = "../nihav-realmedia" } + +[dev-dependencies] +nihav_registry = { path = "../nihav-registry" } diff --git a/nihav-allstuff/src/lib.rs b/nihav-allstuff/src/lib.rs index 2438f89..4c2214a 100644 --- a/nihav-allstuff/src/lib.rs +++ b/nihav-allstuff/src/lib.rs @@ -44,10 +44,13 @@ pub fn nihav_register_all_demuxers(rd: &mut RegisteredDemuxers) { realmedia_register_all_demuxers(rd); } +#[cfg(test)] +extern crate nihav_registry; + #[cfg(test)] mod test { use super::*; - use nihav_core::register::get_codec_description; + use nihav_registry::register::get_codec_description; #[test] fn test_descriptions() { diff --git a/nihav-commonfmt/Cargo.toml b/nihav-commonfmt/Cargo.toml index 396f189..5c0b460 100644 --- a/nihav-commonfmt/Cargo.toml +++ b/nihav-commonfmt/Cargo.toml @@ -7,6 +7,9 @@ edition = "2018" [dependencies.nihav_core] path = "../nihav-core" +[dependencies.nihav_registry] +path = "../nihav-registry" + [dependencies.nihav_codec_support] path = "../nihav-codec-support" features = ["h263", "mdct", "fft", "dsp_window"] diff --git a/nihav-commonfmt/src/demuxers/avi.rs b/nihav-commonfmt/src/demuxers/avi.rs index ec326ff..9b53d14 100644 --- a/nihav-commonfmt/src/demuxers/avi.rs +++ b/nihav-commonfmt/src/demuxers/avi.rs @@ -1,5 +1,5 @@ use nihav_core::demuxers::*; -use nihav_core::register; +use nihav_registry::register; use nihav_core::demuxers::DemuxerError::*; macro_rules! mktag { diff --git a/nihav-commonfmt/src/lib.rs b/nihav-commonfmt/src/lib.rs index cdb70ec..7896f12 100644 --- a/nihav-commonfmt/src/lib.rs +++ b/nihav-commonfmt/src/lib.rs @@ -1,5 +1,6 @@ extern crate nihav_core; extern crate nihav_codec_support; +extern crate nihav_registry; #[cfg(feature="decoders")] #[allow(clippy::unreadable_literal)] diff --git a/nihav-core/src/lib.rs b/nihav-core/src/lib.rs index a53f304..cf97841 100644 --- a/nihav-core/src/lib.rs +++ b/nihav-core/src/lib.rs @@ -15,9 +15,6 @@ pub mod frame; #[allow(clippy::too_many_arguments)] pub mod io; pub mod refs; -pub mod register; -#[allow(clippy::unreadable_literal)] -pub mod detect; pub mod reorder; pub mod scale; pub mod soundcvt; diff --git a/nihav-registry/Cargo.toml b/nihav-registry/Cargo.toml new file mode 100644 index 0000000..0eb6b8c --- /dev/null +++ b/nihav-registry/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "nihav_registry" +version = "0.1.0" +authors = ["Kostya Shishkov "] +edition = "2018" + +[dependencies] +nihav_core = { path = "../nihav-core" } diff --git a/nihav-core/src/detect.rs b/nihav-registry/src/detect.rs similarity index 99% rename from nihav-core/src/detect.rs rename to nihav-registry/src/detect.rs index a693124..44b6e54 100644 --- a/nihav-core/src/detect.rs +++ b/nihav-registry/src/detect.rs @@ -21,7 +21,7 @@ //! } //! ``` use std::io::SeekFrom; -use crate::io::byteio::ByteReader; +use nihav_core::io::byteio::ByteReader; /// Format detection score. #[derive(Debug,Clone,Copy,PartialEq)] diff --git a/nihav-registry/src/lib.rs b/nihav-registry/src/lib.rs new file mode 100644 index 0000000..915f763 --- /dev/null +++ b/nihav-registry/src/lib.rs @@ -0,0 +1,6 @@ +//! Single place for storing information about container and codec formats. +extern crate nihav_core; + +#[allow(clippy::unreadable_literal)] +pub mod detect; +pub mod register; \ No newline at end of file diff --git a/nihav-core/src/register.rs b/nihav-registry/src/register.rs similarity index 100% rename from nihav-core/src/register.rs rename to nihav-registry/src/register.rs -- 2.39.5