Chapters, DVD subtitle palette, MKV track flags, progress total_bytes

Chapters:
- MPLS PlayList marks parsed (mark_type 1 = chapter)
- Chapter struct on DiscTitle (time_secs, name)
- MKV Chapters element with EditionEntry/ChapterAtom per mark
- 3 MPLS mark tests + 2 MKV chapter tests

DVD subtitle palette:
- IFO palette extraction (PGC offset 0xA4, 16 × YCbCr colors)
- YCbCr→RGB conversion for VobSub .idx format
- DvdSubParser codec_private returns formatted palette
- codec_data field on SubtitleStream flows through pipeline
- 5 palette tests (YCbCr conversion, formatting, overflow)

MKV track flags:
- FlagDefault: primary video/audio = 1, secondary = 0
- FlagForced: forced subtitles = 1
- Language: set from stream language code
- Already implemented, verified with 4 new tests

Progress total_bytes:
- IOStream trait: total_bytes() -> Option<u64>
- DiscStream, IsoStream: from disc_title.size_bytes
- M2tsStream, MkvStream: from file metadata on open
- NetworkStream, StdioStream, NullStream: None

316 tests total, all passing.
This commit is contained in:
MattJackson
2026-04-11 17:43:47 +00:00
parent 9cb0c369e4
commit c91d6e371f
21 changed files with 690 additions and 12 deletions
+11
View File
@@ -45,8 +45,10 @@ fn sample_disc_title() -> DiscTitle {
codec: Codec::Pgs,
language: "eng".into(),
forced: false,
codec_data: None,
}),
],
chapters: Vec::new(),
extents: Vec::new(),
content_format: ContentFormat::BdTs,
}
@@ -436,6 +438,7 @@ fn meta_codec_roundtrip() {
codec,
language: "eng".into(),
forced: false,
codec_data: None,
}));
}
@@ -446,6 +449,7 @@ fn meta_codec_roundtrip() {
size_bytes: 0,
clips: Vec::new(),
streams,
chapters: Vec::new(),
extents: Vec::new(),
content_format: ContentFormat::BdTs,
};
@@ -479,6 +483,7 @@ fn meta_empty_streams() {
size_bytes: 0,
clips: Vec::new(),
streams: Vec::new(),
chapters: Vec::new(),
extents: Vec::new(),
content_format: ContentFormat::BdTs,
};
@@ -498,6 +503,7 @@ fn meta_all_stream_types() {
duration_secs: 3600.0,
size_bytes: 0,
clips: Vec::new(),
chapters: Vec::new(),
content_format: ContentFormat::BdTs,
streams: vec![
Stream::Video(VideoStream {
@@ -524,6 +530,7 @@ fn meta_all_stream_types() {
codec: Codec::Pgs,
language: "fra".into(),
forced: true,
codec_data: None,
}),
Stream::Audio(AudioStream {
pid: 0x1110,
@@ -641,6 +648,7 @@ fn mkvstream_roundtrip_bdts() {
secondary: false,
label: "English".into(),
})],
chapters: Vec::new(),
extents: Vec::new(),
content_format: ContentFormat::BdTs,
};
@@ -710,14 +718,17 @@ fn mkvstream_meta_preserves_all_streams() {
codec: Codec::Pgs,
language: "eng".into(),
forced: false,
codec_data: None,
}),
Stream::Subtitle(SubtitleStream {
pid: 0x1201,
codec: Codec::Pgs,
language: "fra".into(),
forced: true,
codec_data: None,
}),
],
chapters: Vec::new(),
extents: Vec::new(),
content_format: ContentFormat::BdTs,
};