diff --git a/quest/m1/README.md b/quest/m1/README.md index fee0f21d4ef..c9ec10f55a0 100644 --- a/quest/m1/README.md +++ b/quest/m1/README.md @@ -60,7 +60,6 @@ QUIC studies there on that rule. - [Legacy end overshoot](/quest/m1/legacy-end-overshoot.md) - browser playback survives a group that starts inside the previous group's estimated end - [Plan: max-delay](/quest/m1/plan-max-delay.md) - decide whether `max_age` becomes `max_delay` across the CLI, APIs, and bindings - [Wire compatibility](/quest/m1/wire-compat.md) - a nightly run tests this checkout against the last published release for tokens, session wire, and catalog/container -- [TS PSI reassembly](/quest/m1/ts-psi-reassembly.md) - `import ts` reads a PAT or PMT that spans packets or follows a nonzero pointer_field instead of aborting, and one corrupted section costs a repetition and a counted `CRC_error`, not the import - [TS damaged units](/quest/m1/ts-damaged-units.md) - one malformed PES or access unit is dropped, counted as `damaged`, and resynced at the next keyframe instead of ending the import - [RTMP interleaving](/quest/m1/rtmp-interleaving.md) - isolate partial messages before optimizing assembly copies - [Merge main into dev](/quest/m1/dev-sync.md) - dev picks up `ts::stats` from main diff --git a/quest/m1/ts-damaged-units.md b/quest/m1/ts-damaged-units.md index 8de2efbd990..e7124059e68 100644 --- a/quest/m1/ts-damaged-units.md +++ b/quest/m1/ts-damaged-units.md @@ -19,10 +19,10 @@ packet (clears `pending[pid]` and calls `stream.desync()`), and it is the model. Decided (maintainer, 2026-09-30): -- Fail-loud holds at unit granularity, as [TS PSI reassembly](/quest/m1/ts-psi-reassembly.md) - holds it at section granularity: a damaged unit is refused whole, never half +- Fail-loud holds at unit granularity, as the importer + holds it at section granularity for PSI (#4584): a damaged unit is refused whole, never half published, and counted, and nothing else about the feed changes. PSI damage - stays that quest's. + is already handled. - Drop the unit the way the TEI branch does: clear the PID's pending PES and desync its stream, so a codec that needs one waits for the next keyframe. Make sure the scratch buffer still advances past the packet on this path @@ -47,10 +47,6 @@ wherever the TS stats fields are described. Public API: additive, one stats field. Wire: none. -## Required - -- [TS PSI reassembly](/quest/m1/ts-psi-reassembly.md) - moq-mux owns the demux and PES header parsing this drops through - ## Closes - [#4581](https://github.com/moq-dev/moq/issues/4581) - one malformed packet ends the TS import diff --git a/quest/m1/ts-psi-reassembly.md b/quest/m1/ts-psi-reassembly.md deleted file mode 100644 index ee0b00e3756..00000000000 --- a/quest/m1/ts-psi-reassembly.md +++ /dev/null @@ -1,68 +0,0 @@ -# [L] TS PSI reassembly - -## Goal - -The MPEG-TS importer reads a PAT or PMT whose section spans several packets or -starts after a nonzero `pointer_field`, instead of aborting the import. Today -the `mpeg2ts` 0.6.1 reader parses PSI from a single packet and rejects a nonzero -`pointer_field`, and its error ends the whole import, so a valid long PMT (many -audio languages, long descriptors) or a PAT with more than about 40 programs -cannot be imported. `ts::Programs` finds such a PAT too. - -## Plan - -Settled decisions: - -- moq-mux owns the packet demux, and the import stops using - `mpeg2ts::ts::TsPacketReader`. It can't be fixed from outside: the reader's - PAT and PMT parsers are private to the crate, and it learns PES PIDs only - from PMTs it parsed itself. Feeding it a synthesized one-packet PMT to - register PIDs was rejected as fragile coupling, and fixing it upstream in - sile/mpeg2ts was rejected as slower and outside this repository. Switching to - `mpeg2ts-reader` was rejected too: it is a callback-driven demux framework - (last release January 2025), and moq-mux already owns the hard part in - `SectionReassembler`. Owning the demux also deletes the importer's - workarounds for the reader: the `Feed` mutex it reads through, and the - `pmt_pids`/`streams` gate that keeps unknown PIDs away from it. `mpeg2ts` - stays for export, tests, and plain types such as `StreamType`. -- PID 0 and every PMT PID go through the existing `SectionReassembler`, which - already handles `pointer_field`, split headers, and continuity gaps. The - PAT (`transport_stream_id`, version, program loop, possibly several sections) - and the PMT (program number, PCR PID, program descriptors, and the - elementary-stream loop with descriptors) are parsed in moq-mux. PES is - routed by the PIDs of the parsed PMT, and its header (PTS/DTS) is also parsed - in moq-mux. -- Each reassembled section's CRC-32/MPEG-2 is checked with the `crc` crate, - which moq-mux already depends on. A section with a bad CRC is dropped and - the last good table stays in force, so the import continues; it no longer - aborts as the `mpeg2ts` reader does. The section is refused whole, never - half-applied, so fail-loud holds at section granularity. A malformed - adaptation field on the PAT or a PMT PID, which ends the import today too, - costs that section the same way. A feed that never delivers a good PAT and - PMT still publishes nothing. Line noise on a live feed then costs one - repetition (0.5 s at most), not the broadcast; today one flipped CRC byte on - `bbb.ts` makes `decode` return `CRC32 mismatch` and `moq import ts` exit. -- Each section dropped for a CRC mismatch is counted in `Import::stats` as a - cumulative `crc_error`, so a corrupt feed is visible rather than silently - held on a stale table. It is stream-wide on `Stats`, since the PAT and PMT - PIDs have no elementary-stream row, and named for the TR 101 290 check that - [TS import health](/quest/m2/ts-import-health.md) adopts. A section dropped - for another reason (a malformed adaptation field, a parse failure) is not a - `crc_error`; that quest counts it under `PAT_error` or `PMT_error`. `Stats` - is `#[non_exhaustive]`, so the new field is additive; its docs (today per - elementary stream) and `is_empty` widen to cover it, and `ts::stats::Log` - reports it. -- `ts::Programs` reads through the same PAT path, so a PAT spanning packets - is found before any program publishes. -- One quest, because the demux refactor alone changes nothing observable. - -Keep every existing TS import test and fixture passing unchanged. Add tests for -a PMT spanning two packets, a PAT behind a nonzero `pointer_field`, a -multi-packet PAT with enough programs to need it (read by `ts::Programs` and -by `with_program`), and a PAT and a PMT with a corrupt CRC, each between good -repetitions, that is dropped and counted once while the import keeps its -previous layout and a later good PMT revision still applies. A positive -control: a feed whose only PAT is corrupt publishes nothing and counts it. - -Folded in from `ts-import-psi-crc` while landing the TR 101 290 plan (#4496): -that quest duplicated this one's bad-CRC drop and `CRC_error` count. diff --git a/quest/m1/ts-stats-module.md b/quest/m1/ts-stats-module.md index c7125f5a526..6835c6cc1e9 100644 --- a/quest/m1/ts-stats-module.md +++ b/quest/m1/ts-stats-module.md @@ -30,10 +30,9 @@ Decided while planning the follow-ups of downcast. - Update moq-cli's `publish.rs`, the only consumer that names these types. moq-srt only uses `stats::Log`. -- Main quests still add fields under the old names: - [TS PSI reassembly](/quest/m1/ts-psi-reassembly.md) and - [TS import health](/quest/m2/ts-import-health.md). `Export::stats` (#4577) - also returns the old `ts::Stats`. The rename carries those at merge time. Update the type names in the quests still open +- Main still adds fields under the old names: #4584 added `crc_error`, and + [TS import health](/quest/m2/ts-import-health.md) adds more. `Export::stats` + (#4577) also returns the old `ts::Stats`. The rename carries those at merge time. Update the type names in the quests still open when this lands, including [media stats schema](/quest/m1/stats/schema.md) and [Rust reporters](/quest/m1/stats/rust.md). diff --git a/quest/m2/ts-import-health.md b/quest/m2/ts-import-health.md index 77188dc12b8..4ef2a6f64b1 100644 --- a/quest/m2/ts-import-health.md +++ b/quest/m2/ts-import-health.md @@ -46,7 +46,7 @@ Decided while planning [#1838](https://github.com/moq-dev/moq/issues/1838): - **`CRC_error` covers PAT and PMT only.** TR 101 290 names CAT, PAT, PMT, NIT, EIT, BAT, SDT and TOT, and its table 5.1b cuts that to PAT and PMT for systems with reduced SI, which a contribution feed is. The importer parses - only PAT and PMT, and [TS PSI reassembly](/quest/m1/ts-psi-reassembly.md) + only PAT and PMT, and since #4584 it already drops a bad-CRC section and counts it as `crc_error`; this quest adopts that field. SI captured verbatim (NIT, SDT, EIT, BAT, TOT) is not CRC-checked, and CAT is out with the scrambled services below. @@ -106,10 +106,6 @@ Implementation: else. A TEI packet that also jumps its continuity counter counts one `Transport_error` and no `Continuity_count_error`. -## Required - -- [TS PSI reassembly](/quest/m1/ts-psi-reassembly.md) - the bad-CRC PAT or PMT the importer survives and counts as `crc_error` - ## Related - [TS health stats](/quest/m2/ts-health-stats.md) - where these counters are published