ReviewOS

also looking at this

home-lang/home

feat(video): add checked elementary packet and PTS outputs

#919
Merged chris wants to merge feat/packet-output-streams into main
4 files +148 -0
8 days ago

Reusable encoded-output consumers need an explicit streaming boundary without importing the broader decoded/accumulating sink graph. Add standalone checked AVC/HEVC NAL-length to Annex B conversion, exact integer PTS formatting, and a monotonic sink-backed PTS writer. Export and document the helpers; no files, threads, packet accumulation or FFmpeg/Libav dependency is introduced.

Conversion validates the complete input and capacity before writing output. PTS formatting preserves zero and the full u64 microsecond range as milliseconds with three decimals/LF. Rejected timestamps leave the sink untouched; sink errors poison the writer. Caller-owned buffers and synchronous borrowed sink slices make ownership explicit.

Validation: three focused tests pass on Zig 0.15.2 and Home's current development toolchain, covering malformed multi-NAL input, small-buffer state preservation, exact maximum PTS, monotonicity and sink failures. Targeted pickier passes. Add focused Linux x86/ARM workflows for both toolchains. zig-camera integration uses these helpers for reusable native/Python outputs, Annex B parameter sets and sidecar/container timestamp checks; the broader Home sink graph is not claimed as tested.

4 changed files on the files tab, with 0 review threads.

Sign in to comment on this pull request.