[dependencies]
nihav_core = { path = "../nihav-core" }
+nihav_commonfmt = { path = "../nihav-commonfmt" }
nihav_game = { path = "../nihav-game" }
nihav_indeo = { path = "../nihav-indeo" }
nihav_realmedia = { path = "../nihav-realmedia" }
\ No newline at end of file
extern crate nihav_core;
+extern crate nihav_commonfmt;
extern crate nihav_game;
extern crate nihav_indeo;
extern crate nihav_realmedia;
-use nihav_core::codecs::{RegisteredDecoders, core_register_all_codecs};
-use nihav_core::demuxers::{RegisteredDemuxers, core_register_all_demuxers};
+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_game::codecs::game_register_all_codecs;
use nihav_game::demuxers::game_register_all_demuxers;
use nihav_realmedia::demuxers::realmedia_register_all_demuxers;
pub fn nihav_register_all_codecs(rd: &mut RegisteredDecoders) {
- core_register_all_codecs(rd);
+ generic_register_all_codecs(rd);
game_register_all_codecs(rd);
indeo_register_all_codecs(rd);
realmedia_register_all_codecs(rd);
}
pub fn nihav_register_all_demuxers(rd: &mut RegisteredDemuxers) {
- core_register_all_demuxers(rd);
+ generic_register_all_demuxers(rd);
game_register_all_demuxers(rd);
realmedia_register_all_demuxers(rd);
}
[package]
-name = "nihav_core"
+name = "nihav_commonfmt"
version = "0.1.0"
authors = ["Kostya Shishkov <kostya.shishkov@gmail.com>"]
edition = "2018"
+[dependencies.nihav_core]
+path = "../nihav-core"
+features = ["h263", "mdct", "fft", "dsp_window"]
+
+[dev-dependencies]
+nihav_realmedia = { path = "../nihav-realmedia" }
+
[features]
default = ["all_decoders", "all_demuxers"]
+decoders = []
demuxers = []
all_demuxers = ["demuxer_avi"]
demuxer_avi = ["demuxers"]
-decoders = []
-h263 = []
-
-dsp = []
-fft = ["dsp"]
-mdct = ["fft", "dsp"]
-dsp_window = ["dsp"]
-
all_decoders = ["all_video_decoders", "all_audio_decoders"]
all_video_decoders = ["decoder_clearvideo"]
all_audio_decoders = ["decoder_pcm", "decoder_ts102366", "decoder_sipro", "decoder_atrac3", "decoder_aac"]
decoder_pcm = ["decoders"]
-decoder_ts102366 = ["decoders", "fft"]
+decoder_ts102366 = ["decoders"]
decoder_sipro = ["decoders"]
-decoder_atrac3 = ["decoders", "mdct"]
-decoder_aac = ["decoders", "mdct", "dsp_window"]
+decoder_atrac3 = ["decoders"]
+decoder_aac = ["decoders"]
-use crate::formats::*;
-use crate::frame::*;
-use crate::codecs::*;
-use crate::dsp::fft::FFTMode;
-use crate::dsp::mdct::IMDCT;
-use crate::dsp::window::*;
-use crate::io::bitreader::*;
-use crate::io::codebook::*;
+use std::rc::Rc;
+use std::cell::RefCell;
+use nihav_core::formats::*;
+use nihav_core::frame::*;
+use nihav_core::codecs::*;
+use nihav_core::dsp::fft::FFTMode;
+use nihav_core::dsp::mdct::IMDCT;
+use nihav_core::dsp::window::*;
+use nihav_core::io::bitreader::*;
+use nihav_core::io::codebook::*;
use std::fmt;
-use crate::io::intcode::*;
+use nihav_core::io::intcode::*;
use std::mem;
use std::ptr;
use std::str::FromStr;
-use crate::formats::*;
-use crate::frame::*;
-use super::*;
-use crate::io::bitreader::*;
-use crate::io::byteio::*;
-use crate::io::codebook::*;
-use crate::dsp::fft::FFTMode;
-use crate::dsp::mdct::IMDCT;
+use std::rc::Rc;
+use std::cell::RefCell;
+use nihav_core::formats::*;
+use nihav_core::frame::*;
+use nihav_core::codecs::*;
+use nihav_core::io::bitreader::*;
+use nihav_core::io::byteio::*;
+use nihav_core::io::codebook::*;
+use nihav_core::dsp::fft::FFTMode;
+use nihav_core::dsp::mdct::IMDCT;
use std::f32::consts;
#[derive(Clone,Copy,PartialEq)]
-use crate::io::byteio::{ByteReader,MemoryReader};
-use crate::io::bitreader::*;
-use crate::io::codebook::*;
-use crate::formats;
-use super::*;
+use std::rc::Rc;
+use std::cell::RefCell;
+use nihav_core::io::byteio::{ByteReader,MemoryReader};
+use nihav_core::io::bitreader::*;
+use nihav_core::io::codebook::*;
+use nihav_core::formats;
+use nihav_core::codecs::*;
+use nihav_core::frame::*;
use std::fmt;
use std::ops::{Add, Sub};
--- /dev/null
+use nihav_core::codecs::*;
+
+macro_rules! validate {
+ ($a:expr) => { if !$a { println!("check failed at {}:{}", file!(), line!()); return Err(DecoderError::InvalidData); } };
+}
+
+#[cfg(feature="decoder_clearvideo")]
+mod clearvideo;
+
+#[cfg(feature="decoder_aac")]
+mod aac;
+#[cfg(feature="decoder_atrac3")]
+mod atrac3;
+#[cfg(feature="decoder_pcm")]
+mod pcm;
+#[cfg(feature="decoder_sipro")]
+mod sipro;
+#[cfg(feature="decoder_ts102366")]
+mod ts102366;
+
+const DECODERS: &[DecoderInfo] = &[
+#[cfg(feature="decoder_clearvideo")]
+ DecoderInfo { name: "clearvideo", get_decoder: clearvideo::get_decoder },
+#[cfg(feature="decoder_clearvideo")]
+ DecoderInfo { name: "clearvideo_rm", get_decoder: clearvideo::get_decoder_rm },
+
+#[cfg(feature="decoder_pcm")]
+ DecoderInfo { name: "pcm", get_decoder: pcm::get_decoder },
+#[cfg(feature="decoder_sipro")]
+ DecoderInfo { name: "sipro", get_decoder: sipro::get_decoder },
+#[cfg(feature="decoder_ts102366")]
+ DecoderInfo { name: "ac3", get_decoder: ts102366::get_decoder },
+#[cfg(feature="decoder_atrac3")]
+ DecoderInfo { name: "atrac3", get_decoder: atrac3::get_decoder },
+#[cfg(feature="decoder_aac")]
+ DecoderInfo { name: "aac", get_decoder: aac::get_decoder },
+];
+
+pub fn generic_register_all_codecs(rd: &mut RegisteredDecoders) {
+ for decoder in DECODERS.into_iter() {
+ rd.add_decoder(decoder.clone());
+ }
+}
-use crate::formats::*;
-use super::*;
+use std::rc::Rc;
+use std::cell::RefCell;
+use nihav_core::formats::*;
+use nihav_core::codecs::*;
+use nihav_core::frame::*;
struct PCMDecoder { chmap: NAChannelMap }
-use crate::formats::*;
-use crate::frame::*;
-use super::*;
-use crate::io::bitreader::*;
+use std::rc::Rc;
+use std::cell::RefCell;
+use nihav_core::formats::*;
+use nihav_core::frame::*;
+use nihav_core::codecs::*;
+use nihav_core::io::bitreader::*;
use std::f32::consts::PI;
-use crate::formats::*;
-use crate::frame::*;
-use super::*;
-use crate::io::bitreader::*;
-use crate::dsp::fft::*;
+use std::rc::Rc;
+use std::cell::RefCell;
+use nihav_core::formats::*;
+use nihav_core::frame::*;
+use nihav_core::codecs::*;
+use nihav_core::io::bitreader::*;
+use nihav_core::dsp::fft::*;
use std::str::FromStr;
use std::f32::consts;
-use super::*;
-use crate::register;
-use super::DemuxerError::*;
-//use io::byteio::*;
-//use frame::*;
-use crate::formats::*;
+use nihav_core::demuxers::*;
+use nihav_core::register;
+use nihav_core::demuxers::DemuxerError::*;
+use nihav_core::io::byteio::*;
+use nihav_core::frame::*;
+use nihav_core::formats::*;
macro_rules! mktag {
($a:expr, $b:expr, $c:expr, $d:expr) => ({
--- /dev/null
+use nihav_core::demuxers::*;
+
+
+macro_rules! validate {
+ ($a:expr) => { if !$a { println!("check failed at {}:{}", file!(), line!()); return Err(DemuxerError::InvalidData); } };
+}
+
+#[cfg(feature="demuxer_avi")]
+mod avi;
+
+const DEMUXERS: &[&'static DemuxerCreator] = &[
+#[cfg(feature="demuxer_avi")]
+ &avi::AVIDemuxerCreator {},
+];
+
+pub fn generic_register_all_demuxers(rd: &mut RegisteredDemuxers) {
+ for demuxer in DEMUXERS.into_iter() {
+ rd.add_demuxer(*demuxer);
+ }
+}
--- /dev/null
+extern crate nihav_core;
+
+#[cfg(feature="decoders")]
+pub mod codecs;
+
+#[cfg(feature="demuxers")]
+pub mod demuxers;
+
+#[cfg(test)]
+extern crate nihav_realmedia;
-[package]
-name = "nihav_core"
-version = "0.1.0"
-authors = ["Kostya Shishkov <kostya.shishkov@gmail.com>"]
-edition = "2018"
-
-[features]
-default = ["all_decoders", "all_demuxers"]
-demuxers = []
-all_demuxers = ["demuxer_avi"]
-demuxer_avi = ["demuxers"]
-
-decoders = []
-h263 = []
-
-dsp = []
-fft = ["dsp"]
-mdct = ["fft", "dsp"]
-dsp_window = ["dsp"]
-
-all_decoders = ["all_video_decoders", "all_audio_decoders"]
-
-all_video_decoders = ["decoder_clearvideo"]
-decoder_clearvideo = ["decoders"]
-
-all_audio_decoders = ["decoder_pcm", "decoder_ts102366", "decoder_sipro", "decoder_atrac3", "decoder_aac"]
-decoder_pcm = ["decoders"]
-decoder_ts102366 = ["decoders", "fft"]
-decoder_sipro = ["decoders"]
-decoder_atrac3 = ["decoders", "mdct"]
-decoder_aac = ["decoders", "mdct", "dsp_window"]
+[package]
+name = "nihav_core"
+version = "0.1.0"
+authors = ["Kostya Shishkov <kostya.shishkov@gmail.com>"]
+edition = "2018"
+
+[features]
+default = ["decoders", "demuxers"]
+
+decoders = []
+demuxers = []
+
+h263 = []
+
+dsp = []
+fft = ["dsp"]
+mdct = ["fft", "dsp"]
+dsp_window = ["dsp"]
#[cfg(any(feature="h263"))]
pub mod blockdsp;
-#[cfg(feature="decoder_clearvideo")]
-mod clearvideo;
-#[cfg(feature="decoder_gdvvid")]
-mod gremlinvideo;
#[cfg(feature="h263")]
pub mod h263;
-#[cfg(feature="decoder_aac")]
-mod aac;
-#[cfg(feature="decoder_atrac3")]
-mod atrac3;
-#[cfg(feature="decoder_pcm")]
-mod pcm;
-#[cfg(feature="decoder_sipro")]
-mod sipro;
-#[cfg(feature="decoder_ts102366")]
-mod ts102366;
-
-const DECODERS: &[DecoderInfo] = &[
-#[cfg(feature="decoder_clearvideo")]
- DecoderInfo { name: "clearvideo", get_decoder: clearvideo::get_decoder },
-#[cfg(feature="decoder_clearvideo")]
- DecoderInfo { name: "clearvideo_rm", get_decoder: clearvideo::get_decoder_rm },
-
-#[cfg(feature="decoder_pcm")]
- DecoderInfo { name: "pcm", get_decoder: pcm::get_decoder },
-#[cfg(feature="decoder_sipro")]
- DecoderInfo { name: "sipro", get_decoder: sipro::get_decoder },
-#[cfg(feature="decoder_ts102366")]
- DecoderInfo { name: "ac3", get_decoder: ts102366::get_decoder },
-#[cfg(feature="decoder_atrac3")]
- DecoderInfo { name: "atrac3", get_decoder: atrac3::get_decoder },
-#[cfg(feature="decoder_aac")]
- DecoderInfo { name: "aac", get_decoder: aac::get_decoder },
-];
-
-pub fn core_register_all_codecs(rd: &mut RegisteredDecoders) {
- for decoder in DECODERS.into_iter() {
- rd.add_decoder(decoder.clone());
- }
-}
-
pub struct RegisteredDecoders {
decs: Vec<DecoderInfo>,
}
($a:expr) => { if !$a { println!("check failed at {}:{}", file!(), line!()); return Err(DemuxerError::InvalidData); } };
}
-#[cfg(feature="demuxer_avi")]
-mod avi;
-
-
-const DEMUXERS: &[&'static DemuxerCreator] = &[
-#[cfg(feature="demuxer_avi")]
- &avi::AVIDemuxerCreator {},
-];
-
pub fn create_demuxer<'a>(dmxcr: &DemuxerCreator, br: &'a mut ByteReader<'a>) -> DemuxerResult<Demuxer<'a>> {
let mut dmx = dmxcr.new_demuxer(br);
let mut str = StreamManager::new();
}
None
}
-}
-
-pub fn core_register_all_demuxers(rd: &mut RegisteredDemuxers) {
- for demuxer in DEMUXERS.into_iter() {
- rd.add_demuxer(*demuxer);
- }
-}
+}
\ No newline at end of file