[domistream] Host: video and audio packetizers #9

Merged
mnovak merged 6 commits from feature/host-packetizers into main 2026-12-04 12:44:36 +01:00
Owner

Lumen L1, host side of the media streams: video::packetizer and audio::packetizer (sans-I/O), tests first.

  • VideoPacketizer: access unit → RTP + NV-header datagrams (PROTOCOL.md 5.2/5.3), FEC blocks (up to 4) with Cauchy Reed-Solomon parity over whole packets, parity headers written after the parity, the client's minimum parity respected, optional video encryption mirroring VideoCipher::decrypt (U19 still unverified against a real client). The 8-byte frame header lives in one function (U13).
  • AudioPacketizer: Opus → RTP with AES-128-CBC mirroring AudioCipher; no parity (AudioParity::None, non-exhaustive) because the audio matrix (U16) is GPL-provenance and unsettled.
  • Host-side notes in PROTOCOL.md 5.3 and 6.4 (block split, minimum-parity percentage, audio first sequence a multiple of 4 because our depacketizer counts from the block start).

Evidence: 28 new tests (fixed byte vectors per field, parity against PROTOCOL's [01 8e f4], round trips through the existing VideoDepacketizer/AudioDepacketizer with loss up to m per block, more loss → FrameLost, reorder/duplicate, wrap-around, largest frame, cipher vectors, proptest); workspace 270 passed / 0 failed; clippy, fmt, rustdoc clean. Fuzz video_packetizer_roundtrip: 113,740 runs in 76 s, 0 crashes.

Clean-room checklist

  • Sources read: none new (PROTOCOL.md, this repo, existing vectors). No CLEAN_ROOM row needed.
  • No forbidden source; no GPL-provenance value (audio matrix explicitly not used).
  • Constants trace to PROTOCOL.md sections (5.2, 5.3, 6.2-6.4).
  • Public repo: nothing private.

Self-review: checked the diff for unsafe/unwrap/expect/panic (none in library code), that the encryption mirror only exists because the client decrypt already does, and that parity is computed before parity headers are written (5.3). Choices that are ours (block split, minimum-parity rounding) are documented as host-side notes for the capture to compare.

Lumen L1, host side of the media streams: `video::packetizer` and `audio::packetizer` (sans-I/O), tests first. - `VideoPacketizer`: access unit → RTP + NV-header datagrams (PROTOCOL.md 5.2/5.3), FEC blocks (up to 4) with Cauchy Reed-Solomon parity over whole packets, parity headers written after the parity, the client's minimum parity respected, optional video encryption mirroring `VideoCipher::decrypt` (U19 still unverified against a real client). The 8-byte frame header lives in one function (U13). - `AudioPacketizer`: Opus → RTP with AES-128-CBC mirroring `AudioCipher`; **no parity** (`AudioParity::None`, non-exhaustive) because the audio matrix (U16) is GPL-provenance and unsettled. - Host-side notes in PROTOCOL.md 5.3 and 6.4 (block split, minimum-parity percentage, audio first sequence a multiple of 4 because our depacketizer counts from the block start). Evidence: 28 new tests (fixed byte vectors per field, parity against PROTOCOL's `[01 8e f4]`, round trips through the existing `VideoDepacketizer`/`AudioDepacketizer` with loss up to m per block, more loss → `FrameLost`, reorder/duplicate, wrap-around, largest frame, cipher vectors, proptest); workspace 270 passed / 0 failed; clippy, fmt, rustdoc clean. Fuzz `video_packetizer_roundtrip`: 113,740 runs in 76 s, 0 crashes. **Clean-room checklist** - [x] Sources read: none new (PROTOCOL.md, this repo, existing vectors). No CLEAN_ROOM row needed. - [x] No forbidden source; no GPL-provenance value (audio matrix explicitly not used). - [x] Constants trace to PROTOCOL.md sections (5.2, 5.3, 6.2-6.4). - [x] Public repo: nothing private. **Self-review**: checked the diff for `unsafe`/`unwrap`/`expect`/`panic` (none in library code), that the encryption mirror only exists because the client decrypt already does, and that parity is computed before parity headers are written (5.3). Choices that are ours (block split, minimum-parity rounding) are documented as host-side notes for the capture to compare.
mnovak added 6 commits 2026-12-04 12:44:30 +01:00
mnovak merged commit 33b7b90b65 into main 2026-12-04 12:44:36 +01:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mnovak/DomiStream#9