Repository navigation
Conversation
|
Thanks — the VPS fix is the real catch here, and I've kept it as-is: the mask just needed grouping before the comparison, and the SPS and PPS checks right below it already read that way. For the framing, I've routed it through our existing I'm going to hold the test harness and the CI job back for now, though — not a reflection on them at all. I'd just rather settle on one consistent way to lay out tests here before I take pieces of it into the tree, and I'd like to pick it (and your fixtures) back up once that's decided. |
The VPS type test compared the wrong way around: & binds looser than ==, so nalptr[0] >> 1 & 0x3F == H265_NAL_TYPE_VPS evaluated as (nalptr[0] >> 1) & 0 and a type-32 NAL never populated the VPS cache. Group the shift and mask before the comparison, matching the SPS and PPS checks below it, and reject VPS payloads shorter than four bytes before they reach the MIME encoder. The RTP packer only took the Annex-B path when a pack opened with a four-byte start code, so a three-byte prefix, or a run of leading zeros before either prefix, was sent as a raw NAL with the framing bytes still in the payload. Count the leading zeros, accept either prefix, and hand the pack to the existing splitter. Extracted from #59, authored by Daniel Piers.
HEVC VPS detection compared the mask before applying it, so type-32 NALs did not populate the VPS cache. Group the type extraction before comparison and reject short VPS payloads before MIME encoding.
The RTP consumer also recognized Annex-B input only when the pack began with a four-byte prefix. Recognize three- and four-byte prefixes plus extra initial zero bytes, then use the existing splitter. Otherwise valid Annex-B access units took the raw-NAL path and transmitted framing bytes as payload. The raw-NAL fallback and packetization helpers remain unchanged.
Add self-contained tests of the actual parameter-cache and public RTP paths. Frozen locally generated, decode-checked AVC/HEVC fixtures exercise single packets, fragmentation/reconstruction, mixed prefixes, extra leading zeros, timestamp/sequence wrap, input preservation and partial send failure. Tests capture UDP sends without starting a server or opening sockets; they need no camera, firmware, external bridge, FFmpeg or network at test time.
A separate ten-minute Ubuntu CI job now runs
make -C tests teston the existing pull-request, master-push and manual triggers, with read-only repository permission. Hosted execution is pending approval; the existing cross-build/release job is unchanged.Validation:
make -C tests testpasses on macOS Apple Clang and pinned Debian 12 AArch64 GCC 12, with native and ASan/UBSan builds. Each framing run passes 1,786 checks; each cache run passes 1,805 checks, plus the existing three-check corrected short-VPS guard case. The standalone framing regression fails semantically on the pre-fix consumer, and all four final builds serialize identical packet bytes.This does not change RTP marker policy, parameter-set replacement or shared-timestamp concurrency, and does not claim actual network delivery or hardware acquisition support.