fix(cv2-capture): land getCaptureStats+capture-rearm to main (complete SoT) #40
Closed
triform-admin
wants to merge 27 commits from
capstats-plus-rearm into main
pull from: capstats-plus-rearm
merge into: triform:main
triform:main
triform:adm/move-out-of-compile-lane
triform:c8/three-unbuilt-tests
triform:c3/config-surface
triform:c7/transport-seam
triform:c5/reject-unknown-params
triform:verify/c4-with-tests
triform:c4b/wire-envelope-tests
triform:verify/tests-run-for-real
triform:fix/base-public-deps
triform:c4/wire-envelope-dialects
triform:fix/conformance-readme-media
triform:track6/docs-map
triform:track7/conformance-kit
triform:chore/guest-release-0a0d28c
triform:fix/ci-registry-login
triform:fix/step7-ldpath
triform:fix/t7-lane-restore-unittests
triform:feat/client-session-split
triform:fix/profile-var-rename-severed-x264
triform:agent/cb-fidelity-wave1
triform:agent/cb-api-pins-7727
triform:agent/a4-guest-provenance
triform:repin-buildjob-main
triform:cv2-capture-rearm-land
triform:cv2/ideal-guest-45b6899-capstats
triform:agent/cv2-capture-stats-health-gate
triform:cv2/gpu-death-recycle
triform:cv2/gpu-crash-watchdog
triform:cv2/idle-refresh-capturer
triform:cv2/walls-on-deployed
triform:fix/cv2-walls-guest
triform:exp/answer-buffer
triform:cv2/warm-snapshot-native-session
triform:build/cv2-ice-beginframe-v5
triform:cv2/wave-3-integration
triform:build/cv2-ice-beginframe-v4
triform:build/cv2-ice-beginframe-v3
triform:build/cv2-ice-beginframe-v2
triform:build/cv2-ice-beginframe-2e5d147
triform:cv2/framesink-retarget-resolution
triform:codex/cv2-framesink-retarget-20260609
triform:codex/controller-response-signaling-cache
triform:codex/native-ice-env-220646
triform:codex/native-env-controller-212857
triform:codex/session-reconcile-conflict-retry
triform:codex/revive-ended-browser-sessions
triform:codex/browserless-emptydir-budget
triform:cv2-96-dcsctp-verbose-capture
triform:cv2-95-dispatch-tail-trace
triform:cv2-95-input-dc-receive-trace
triform:cv2-95-setactivecapture-on-capture-start
triform:cv2-95-dc-before-transceiver
triform:fix/cv2-offerer-getstats-threading
triform:cv2/wave-2-integration
triform:cv2-guest-rtp-stats-obs
triform:cv2-ws-large-frame-reassembly
triform:cv2-compositor-redraw
triform:cv2-ice-observability
triform:cv2-89-svg-contentclient
triform:cv2-89-svg-pak-scale-fix
triform:codex/cv2-wave2-verification-20260522
triform:codex/cv2-91-native-frames
triform:build/cv2-83-65d65f0
triform:build/cv2-83-286f520
triform:build/cv2-83-6cb777d
triform:codex/cv2-wave2-recovery-20260522
triform:cv2/m5.5-pulse-env-runtime-wire
triform:cv2/m4-typed-dispatcher-runtime-wire
triform:cv2/wave-1-integration
triform:cv2/m3-r5-dc-host-adoption
triform:cv2/m3-r5-dc-host-adoption-rename
triform:cv2/m5-r1-screen-impl
triform:cv2/m4-m5-m6-runtime-wire
triform:cv2/m7-integration-staged
triform:cv2/m2-r5-rearch-rebased
triform:cv2/m2-track-source-deps
triform:cv2/m7-integration
triform:cv2/m2-r5-rearch
triform:integration/native-peer
triform:cv2/m0-ci-gate
triform:cv2/m1-native-pcf
triform:team-lead/native-webrtc-review-2026-05-13
triform:codex/chromeless-context-profile-isolation
triform:codex/chromeless-input-target-session
triform:codex/triform-sw-pool-pod-watchdog
triform:codex/phase2-idle-watchdog-env
triform:codex/chromeless-pattern-c-warm-pool
triform:codex/triform-disable-streamer-autostart
triform:codex/streamer-ice-servers
triform:codex/streamer-cdp-page-session
triform:codex/skip-disabled-signaling-smoke
triform:codex/chromeless-runtime-pool-wiring
triform:codex/chromeless-gateway-signaling-url
triform:codex/streamer-signaling-url
triform:codex/idle-watchdog-env
triform:feat/otlp-logs
triform:feat/wave-1-emitters
triform:wip/pre-rename-20260504-1622
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set.
Reference
triform/chromeless!40
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "capstats-plus-rearm"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Durable follow-up: main already has the capture-rearm fix (
b3359fb) but LACKS the getCaptureStats health-gate (CV2-CAPTURE-STATS). capstats-plus-rearm (f5dcb60) is the verified both-features tree currently deployed as cr7727-f5dcb6087fa9. Landing it makes main a complete source-of-truth so a future auto-rebuild from main cannot silently drop capstats. No functional change to what is deployed (same image).a71b0d0' into cv2/ideal-guest-45b6899-capstats 151c078951THE root cause of cold-boot frozen video. A cold-boot cb-chromium guest starts on about:blank; capture is armed on that page's FrameSinkId; then the navigation to real content swaps the RenderViewHost (and its FrameSinkId), but nothing re-points the capturer at the new sink. It stays bound to the dead pre-nav sink -> VERDICT=RENDERER-STARVED, frames_encoded=0, no video. Warm-restored golden sessions dodge this (they resume already-on-content with no about:blank->nav transition), which is why cold-boot was the sole frozen path -- and why the isolator cold-boot fallback, though correct at the allocation layer, produced a connected-but-frozen stream. Fix: make capture self-healing at the layer that owns both the observer and the capturer. CbActiveWebContentsResolver already observes the captured WebContents and receives RenderViewHostChanged, but is content-layer glue with no capturer handle (the FrameSink capturer is deliberately content-agnostic -- FrameSinkIds only). So the resolver gains an optional re-arm closure (SetRecaptureOnRvhSwapCallback) that CloudBrowserBrowserMainParts supplies; on an RVH swap of the active capture the resolver POSTs it (the new RWH's view/FSID may not be the WC's live primary synchronously at RenderViewHostChanged -- a same-turn UI PostTask runs after the swap settles). The owner (RearmCaptureAfterRvhSwap) re-resolves WC->RWHV->RWH->GetFrameSinkId, forces the fresh view SHOWING (the post-nav RWH boots HIDDEN -> renderer throttled, same gating Cb.startFrameSinkCapture applies), calls cb_track_source_->StartCapture on the new sink, and refreshes the resolver's active target. capturer.cc:138-164 confirms StartCapture on a NEW FrameSinkId re-targets (ChangeTarget), not a no-op -- so the re-arm is effective. For a terminal nav whose fresh RWHV isn't attached by the task turn (no later swap to retrigger), the owner re-posts itself up to 5x/50ms (bounded) rather than strand the capturer. Stale "Start is a no-op" comments in cb_devtools_agent.cc + cb_framesink_video_track_source.{h,cc} that predated the retarget path are corrected so this fix can't be mistakenly reverted as dead code. Layering preserved (capturer stays content-agnostic; re-arm lives in build-integration where content deps already exist). Optional callback: unset -> legacy invalidate-only behaviour, so tests/no-capturer builds are unaffected. Adversarially reviewed (lifetime/UAF, re-entrancy, threading, StartCapture-idempotency, includes, Show() walk) -- no correctness bugs. Composes with the isolator cold-boot fallback (now a COMPLETE fix, not frozen) and the per-language warm-slot fix. Guest change -- needs a cb-chromium rootfs bake to deploy. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>Closing as superseded — every payload this branch carries is now on
mainby patch-id:f5dcb60b3359fb561b3361…identicala71b0d0(via151c078)48adabc(PR #43)8bf63f5a…identical0a997b2cd741fb, on main)The residual
origin/main...capstats-plus-rearmdiff is merge plumbing only (no infra/build deltas remain). The deployed sw-pool imagecr7727-78e5bb4== this branch tip, and the convergence build onto main (C1/C2 of the current plan) replaces it with a main-lineage image — after which this branch is retired entirely.Pull request closed