Skip to content

Share one screen sharing product profile between the host and the bench (851-3593) - #894

Merged
pondorasti merged 1 commit into
mainfrom
alexandru/851-3593-screen-sharing-v2-t4-tier-1-in-process-loopback-benchmark-profile
Oct 29, 2026
Merged

pondorasti merged 1 commit into
mainfrom
alexandru/851-3593-screen-sharing-v2-t4-tier-1-in-process-loopback-benchmark-profile

Conversation

@pondorasti

Copy link
Copy Markdown
Member

Part of 851-3593

Summary

Adds ScreenSharingProductProfile (in ScreenSharingWebRTC): one place for the product's screen sharing settings, so the product and the Tier 1 benchmark (next PR) can't drift apart.

  • Codec order (HEVC 4:4:4, then HEVC, then H.264), the 45 Mbit/s ceiling, the 2560×1440 capture box, the WebRTC field trials, the 60 s keyframe interval, the encoder's 3 pending frames, and the adaptive-quality reference bitrate (6 Mbit/s) and warm-up (5 s).
  • ScreenSharingHostService/ScreenSharingHostSession, ScreenSharingCodecFactory, ScreenSharingFieldTrials, ScreenSharingPeerOptions and the quality loop now read these values instead of their own constants.
  • ScreenSharingQualityLoop moves from CodevisorCoreMac to ScreenSharingWebRTC (public, logic unchanged), so the bench can run it too. The simulator host keeps using it as before.

No values change, and nothing changes for the product's performance.

Proof that behaviour is unchanged

ScreenSharingProductProfileTests.aProductSenderStreamsWithTheProductSettings streams a frame through a default product sender and receiver, then checks what the encoder and sender actually used:

  • the negotiated codec (HEVC 4:4:4);
  • encoderMaximumPendingFrames = 3;
  • encoderKeyframeIntervalSeconds = 60;
  • the sender's maxBitrateBps = 45,000,000.

I wrote it first against unmodified main, where it passed (1.8 s). It still passes after the refactor. The field trials and the default codec order are already pinned by ScreenSharingFieldTrialsTests and ScreenSharingCodecFactoryTests. The capture-size test moves from CodevisorCoreMacTests to the profile and now also checks the bitrate and frame rate.

Checks

  • swift test for ScreenSharingProductProfileTests, ScreenSharingFieldTrialsTests, ScreenSharingPeerLoopbackTests, ScreenSharingCodecFactoryTests and ScreenSharingHDRLoopbackTests: 30 passed.
  • The pre-commit bun run check passed: Swift tests, the iOS build, format and lint.
  • code-review at level high. I fixed the long lines and removed assertions that duplicated other tests. I'm leaving three findings as they are:
    • making the profile injectable: no caller needs that;
    • the virtual-display resize sizing: it has its own HiDPI rules, which this PR doesn't touch;
    • moving the profile to the ScreenSharing core module: the profile includes the WebRTC field trials, so it belongs in ScreenSharingWebRTC.

No tophat assets: there is no UI change.

🤖 Generated with Claude Code

…ch (851-3593)

ScreenSharingProductProfile (ScreenSharingWebRTC) now holds the product
settings that the host service, the codec factory, the field trials, the
peer defaults and the adaptive quality loop read: codec order, the 45 Mbit/s
ceiling, the 2560x1440 capture box, the WebRTC field trials, the keyframe
interval, the encoder's pending-frame bound and the quality loop's reference
bitrate and warm-up. The quality loop moves from CodevisorCoreMac into
ScreenSharingWebRTC so the Tier 1 bench can run it too. Values are unchanged.

ScreenSharingProductProfileTests streams a frame through a product sender and
checks the codec, pending frames, keyframe interval and bitrate ceiling the
encoder and sender actually use. It passed on main before the refactor and
passes after it. The capture-size test moves from CodevisorCoreMacTests to the
profile.

Part of 851-3593

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@pondorasti
pondorasti merged commit f6e53b8 into main Oct 29, 2026
@pondorasti
pondorasti deleted the alexandru/851-3593-screen-sharing-v2-t4-tier-1-in-process-loopback-benchmark-profile branch October 29, 2026 03:07
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.

1 participant