let edata = info.get_extradata().unwrap();
validate!(edata.len() >= 8);
- let mut mr = MemoryReader::new_read(&edata);
- let mut br = ByteReader::new(&mut mr);
+ let mut br = MemoryReader::new_read(&edata);
let magic = br.read_u32be()?;
let flags = br.read_u32le()?;
let edata = info.get_extradata().unwrap();
validate!(edata.len() >= 8);
- let mut mr = MemoryReader::new_read(&edata);
- let mut br = ByteReader::new(&mut mr);
+ let mut br = MemoryReader::new_read(&edata);
let magic = br.read_u32be()?;
let flags = br.read_u32le()?;
self.stride = w;
self.frame.resize(w * h, 0);
- let mut mr = MemoryReader::new_read(&edata);
- let mut br = ByteReader::new(&mut mr);
+ let mut br = MemoryReader::new_read(&edata);
let magic = br.read_tag()?;
self.flags = br.read_u32le()?;
let mmap_size = br.read_u32le()?;
use nihav_core::demuxers::*;
-use nihav_core::io::byteio::ByteReader;
+use nihav_core::io::byteio::ByteIO;
struct AudioTrack {
id: usize,
}
struct BinkDemuxer<'a> {
- src: &'a mut ByteReader<'a>,
+ src: &'a mut dyn ByteIO,
cur_frame: usize,
frames: usize,
video_id: usize,
}
impl<'a> BinkDemuxer<'a> {
- fn new(io: &'a mut ByteReader<'a>) -> Self {
+ fn new(io: &'a mut dyn ByteIO) -> Self {
Self {
src: io,
cur_frame: 0,
pub struct BinkDemuxerCreator { }
impl DemuxerCreator for BinkDemuxerCreator {
- fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box<dyn DemuxCore<'a> + 'a> {
+ fn new_demuxer<'a>(&self, br: &'a mut dyn ByteIO) -> Box<dyn DemuxCore<'a> + 'a> {
Box::new(BinkDemuxer::new(br))
}
fn get_name(&self) -> &'static str { "bink" }
// let mut file = File::open("assets/RAD/Snd0a110c51.dee").unwrap();
// let mut file = File::open("assets/RAD/NEW.BIK").unwrap();
// let mut file = File::open("assets/RAD/ge_video_86l.bk2").unwrap();
- let mut fr = FileReader::new_read(&mut file);
- let mut br = ByteReader::new(&mut fr);
+ let mut br = FileReader::new_read(&mut file);
let mut dmx = BinkDemuxer::new(&mut br);
let mut sm = StreamManager::new();
let mut si = SeekIndex::new();
}
struct SmackerVideoDemuxer<'a> {
- src: &'a mut ByteReader<'a>,
+ src: &'a mut dyn ByteIO,
frames: usize,
pts_inc: u64,
cur_pts: u64,
}
impl<'a> SmackerVideoDemuxer<'a> {
- fn new(io: &'a mut ByteReader<'a>) -> Self {
+ fn new(io: &'a mut dyn ByteIO) -> Self {
SmackerVideoDemuxer {
src: io,
frames: 0,
pub struct SMKDemuxerCreator { }
impl DemuxerCreator for SMKDemuxerCreator {
- fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box<dyn DemuxCore<'a> + 'a> {
+ fn new_demuxer<'a>(&self, br: &'a mut dyn ByteIO) -> Box<dyn DemuxCore<'a> + 'a> {
Box::new(SmackerVideoDemuxer::new(br))
}
fn get_name(&self) -> &'static str { "smacker" }
// let mut file = File::open("assets/RAD/ajfstr1.smk").unwrap();
// let mut file = File::open("assets/RAD/credits.smk").unwrap();
// let mut file = File::open("assets/RAD/wetlogo.smk").unwrap();
- let mut fr = FileReader::new_read(&mut file);
- let mut br = ByteReader::new(&mut fr);
+ let mut br = FileReader::new_read(&mut file);
let mut dmx = SmackerVideoDemuxer::new(&mut br);
let mut sm = StreamManager::new();
let mut si = SeekIndex::new();
const ASSEMBLE_DEPTH: usize = 32;
struct BinkMuxer<'a> {
- bw: &'a mut ByteWriter<'a>,
+ bw: &'a mut dyn ByteIO,
naudio: usize,
maxsize: u32,
nframes: usize,
}
impl<'a> BinkMuxer<'a> {
- fn new(bw: &'a mut ByteWriter<'a>) -> Self {
+ fn new(bw: &'a mut dyn ByteIO) -> Self {
Self {
bw,
naudio: 0,
pub struct BinkMuxerCreator {}
impl MuxerCreator for BinkMuxerCreator {
- fn new_muxer<'a>(&self, bw: &'a mut ByteWriter<'a>) -> Box<dyn MuxCore<'a> + 'a> {
+ fn new_muxer<'a>(&self, bw: &'a mut dyn ByteIO) -> Box<dyn MuxCore<'a> + 'a> {
Box::new(BinkMuxer::new(bw))
}
fn get_name(&self) -> &'static str { "bink" }