PES pipeline: InputStream on DiscStream + IsoStream, MkvOutputStream
- DiscStream: next_frame() reads sectors → decrypts → demuxes → returns PesFrame - IsoStream: same pattern, reads from ISO file - MkvOutputStream: accepts PesFrame, writes MKV via MkvMuxer - InputStream trait: next_frame(), info(), codec_private(), headers_ready() - OutputStream trait: write_frame(), finish() - FileSectorReader: SectorReader backed by a file - PesFrame: track + pts + keyframe + data Old Read/Write IOStream impls preserved for backward compatibility. Next: replace pipe() in CLI to use PES pipeline.
This commit is contained in:
@@ -402,6 +402,26 @@ impl crate::pes::InputStream for DiscStream {
|
||||
fn info(&self) -> &DiscTitle {
|
||||
&self.title
|
||||
}
|
||||
|
||||
fn codec_private(&self, track: usize) -> Option<Vec<u8>> {
|
||||
let pid = self.pid_to_track.iter()
|
||||
.find(|(_, idx)| *idx == track)
|
||||
.map(|(pid, _)| *pid)?;
|
||||
self.parsers.iter()
|
||||
.find(|(p, _)| *p == pid)
|
||||
.and_then(|(_, parser)| parser.codec_private())
|
||||
}
|
||||
|
||||
fn headers_ready(&self) -> bool {
|
||||
for (idx, s) in self.title.streams.iter().enumerate() {
|
||||
if let crate::disc::Stream::Video(v) = s {
|
||||
if !v.secondary && self.codec_private(idx).is_none() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
impl Read for DiscStream {
|
||||
|
||||
Reference in New Issue
Block a user