feat: add auto-port-reset opt-out - #24
Merged
Merged
Conversation
… access unit The element advertises `alignment=au` on both pad templates but pushed one GstBuffer per NAL unit, so any multi-slice picture (common at 2160p) fragmented across multiple buffers that each claimed to be a whole access unit. Downstream (`h264parse`, `v4l2slh264dec`/`mppvideodec`, the muxers) trusts that claim to find frame boundaries. Fix: `frame_callback()` now partitions each libuvc delivery into access units via `split_access_units()` and emits exactly one buffer per AU. Boundary detection, in priority order: an Access Unit Delimiter when present (exact, no heuristic), else first-slice-of-new-picture detection via a one-bit test on the slice payload (H.264 `first_mb_in_slice`/H.265 `first_slice_segment_in_pic_flag`), else never split (deliberately biased toward under-splitting). PTS convention: an aggregated AU carries the delivery's arrival running-time, identical to what its first slice would have received under the old per-NAL path. No caps change, no new timing constant. Board-proven at both resolutions on the Osmo Pocket 3 (192.168.78.131, 2026-07-30 ~08:26-08:43Z): 1080p30 parses cleanly through `h264parse`, byte-identical to the pre-aggregation path; 2160p30 parses cleanly with full SPS-derived caps (3840x2160/high/5.2/4:2:0); exact 90-in/90-out buffer count verified via identity probes on both sides of `h264parse` for a 90-buffer 2160p30 request, confirming the contract holds with zero drift at the resolution most likely to expose a splitting bug. Local gate: 103/103 baseline ctest, both new AU-alignment cases red before the fix (3 buffers / 2 buffers where 1 was expected), 106/106 after (103 + 3 new), 161/161 under `-DENABLE_SANITIZERS=ON` with zero ASan/TSan findings. `compat_caps_contract` unmodified; `alignment=au` unchanged. Board-Evidence-SHA256: 4585c999f72a419edd079cf5b10e1af86105d0eee6cfbfbf76b7ab43e8683800
Board-Evidence-SHA256: 15daa61f1a40f7112b25bc7f37fdc0809973468de33f5c06bb5f5c9258a3be8c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add the public
auto-port-resetboolean property, defaulting to true, with mock coverage for the false path and documentation.Verification
ctest --test-dir build --output-on-failure: 169/169 passed877fd59ff523e8bf0cf243304a1528506c083383871271c96da5fe9d37e28a87Evidence
Board-Evidence-SHA256: 15daa61f1a40f7112b25bc7f37fdc0809973468de33f5c06bb5f5c9258a3be8cis on the documentation commit and identifies the retry record.Risks
No default behavior change; setting FALSE intentionally skips USB port reset and uses normal disconnect handling.