Skip to content

Harden Zoom screen share on Windows and macOS - #290

Merged
iamfatness merged 3 commits into
mainfrom
fix/share-solid-mac-win
Nov 14, 2026
Merged

iamfatness merged 3 commits into
mainfrom
fix/share-solid-mac-win

Conversation

@iamfatness

Copy link
Copy Markdown
Owner

Summary

Screen share was reported as unreliable on both platforms. It was being graded, recovered and scaled by the rules written for camera feeds. This PR fixes five defects:

  • An ended share stayed frozen on program. Nothing cleared the share source when the presenter stopped. The source now goes empty about 3 s after the share ends: the roster must show no sharer for 2 s and frames must have stopped for 1 s. If a sharer reappears while the output is empty, the source resubscribes. Share sources show no color bars.
  • A static slide read as a broken feed. It went Video stale at 3 s and then looped on recovery. Any share that was not 1080-line read "lower resolution" and looped on quality upgrades. Share outputs now use a 10 s stale threshold, never recover while nobody is sharing, and never enter the quality-upgrade loop. The rules live in src/share-output-policy.h.
  • Recovery did nothing on either engine. A subscribe for a share the engine already held a renderer for short-circuited. Both engines now rebuild a renderer that has delivered nothing for 8 s, on a resubscribe or a Resume, and only if the viewable-share scan still reports that share (src/share-renderer-policy.h). Windows now handles Sharing_Resume.
  • Shared text was shredded. Share frames were nearest-neighbour decimated at ratios like 1.48x. They now use an area/bilinear scaler (src/i420-scale.h) costing 2.2–3.6 ms per frame, against 1.6–2.8 ms for the old path. Camera feeds keep the old path.
  • macOS could drop the first frame of a share. The share lock is now split the same way as the v0.1.49 Windows fix, so the frame callback no longer drops frames with try_lock. A dropped first frame of a static slide meant an empty output until the slide changed. Also fixes a delegate leak when the SDK destroys the renderer itself.

Tests

  • New: CoreVideoI420Scale, CoreVideoShareOutputPolicy.
  • CoreVideoEngineShareReentrancy gains idle-rebuild and Resume cases. It now also runs on macOS and Linux CI, because the tracked Windows headers have a POSIX branch.
  • Each new rule was checked by mutation: deleting the rule makes its test fail.
  • 86/86 pass on macOS arm64.

Not done

  • Live validation is pending on both platforms. The checklist is in docs/VALIDATION_MATRIX.md and needs a remote participant sharing.
  • Out of scope: share computer audio, Talkback on macOS, and the multi-hour macOS soak.

🤖 Generated with Claude Code

A share output was graded, recovered and scaled by the camera rules:

- An ended share stayed frozen on program; nothing cleared the source. It
  is now cleared once the roster has shown no sharer for 2 s and frames have
  stopped for 1 s, and the roster's return on an empty output resubscribes.
  Share sources show no color bars.
- A static slide went "Video stale" at 3 s and looped on recovery; any
  non-1080-line share read "lower resolution" and looped on upgrades. Share
  outputs use a 10 s stale threshold, never recover while nobody shares and
  never enter the quality-upgrade loop.
- Recovery was a no-op on both engines while a renderer existed. Both now
  rebuild a share renderer idle for 8 s (if the viewable-share scan still
  reports it) on a resubscribe or Resume; Windows handles Sharing_Resume.
- Share frames were nearest-neighbour decimated into the canvas, shredding
  text. They use a new area/bilinear scaler (src/i420-scale.h) at roughly the
  old path's cost; cameras keep the old path.
- macOS: the share lock is split like Windows' so the frame callback no
  longer try_lock-drops (a lost first frame of a static slide meant an empty
  output); a delegate leak on SDK-initiated renderer destroy is fixed.

New tests: CoreVideoI420Scale, CoreVideoShareOutputPolicy; the Windows
CoreVideoEngineShareReentrancy test gains idle-rebuild/Resume cases and now
also runs on macOS/Linux. 86/86 on macOS arm64. Live validation pending.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread src/zoom-source.cpp
!share_wants_stale_recovery(
m_share_roster_available.load(std::memory_order_acquire)))
return false;
const uint64_t stale_ns = video_stale_threshold_ns(screen_share, kStaleVideoNs);
Comment thread src/zoom-source.cpp
m_share_roster_available.load(std::memory_order_acquire)))
return false;
const uint64_t stale_ns = video_stale_threshold_ns(screen_share, kStaleVideoNs);
const uint64_t no_signal_ns =
iamfatness and others added 2 commits November 14, 2026 12:56
Both throws are the point of their tests (exception containment in the
share engine; a regression signal caught by main()). They made the
Cppcheck hard-fail gate red on main since October.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread src/i420-scale.h

if (src_w == dst_w && src_h == dst_h) {
for (uint32_t y = 0; y < dst_h; ++y)
std::memcpy(dst + static_cast<size_t>(y) * dst_stride,
@iamfatness
iamfatness merged commit a4decb2 into main Nov 14, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants