All streams complete — DVD PS demux, network/stdio PES, MKV input

- DiscStream: BD (TsDemuxer) or DVD (PsDemuxer) auto-detected
- NetworkStream: Stream impl with PES serialize/deserialize
- StdioStream: Stream impl with PES serialize/deserialize
- MkvStream: Stream read returns PesFrame from EBML blocks
- M2tsStream: Stream read via TsDemuxReader
- PesFrame: serialize/deserialize for wire format
- TsDemuxReader: shared BD-TS demux helper
- All inputs and outputs support PES
This commit is contained in:
MattJackson
2026-04-15 04:03:56 +00:00
parent 394ce226f9
commit 8ae05bc388
4 changed files with 87 additions and 27 deletions
+20
View File
@@ -40,6 +40,26 @@ impl StdioStream {
}
}
impl crate::pes::Stream for StdioStream {
fn read(&mut self) -> io::Result<Option<crate::pes::PesFrame>> {
match &mut self.reader {
Some(r) => crate::pes::PesFrame::deserialize(r),
None => Err(io::Error::new(io::ErrorKind::Unsupported, "stdio opened for writing")),
}
}
fn write(&mut self, frame: &crate::pes::PesFrame) -> io::Result<()> {
match &mut self.writer {
Some(w) => frame.serialize(w),
None => Err(io::Error::new(io::ErrorKind::Unsupported, "stdio opened for reading")),
}
}
fn finish(&mut self) -> io::Result<()> {
if let Some(w) = &mut self.writer { w.flush()?; }
Ok(())
}
fn info(&self) -> &DiscTitle { &self.disc_title }
}
impl IOStream for StdioStream {
fn info(&self) -> &DiscTitle {
&self.disc_title