Skip to content

feat: unlock 1080p60 on capable devices via StreamCapability - #28

Merged
joeblau merged 1 commit into
mainfrom
fix/17-unlock-1080p60
Jul 4, 2026
Merged

feat: unlock 1080p60 on capable devices via StreamCapability#28
joeblau merged 1 commit into
mainfrom
fix/17-unlock-1080p60

Conversation

@joeblau

@joeblau joeblau commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #17. Replaces the hard-coded maxStreamShortEdge = 720 / min(fps, 30) ceilings — which made the headline 1080p60 target unreachable — with a device-derived StreamCapability.

  • New StreamCapability (StreamCore): a pure, injectable derivation of the resolution/fps ceiling from real device signals (core count + physical memory):
    • 6 GB+ & ≥6 cores → 1080p60 (headline target)
    • 4 GB → 1080p30
    • ≤3 GB → 720p30
    • current reads live ProcessInfo (app only); device(processorCount:physicalMemory:) is injectable so tests never depend on the CI runner's hardware.
  • StreamSettings: encodeSize(...) now takes a maxShortEdge, and a new encodeFrameRate(maxFrameRate:) clamps fps — both fed by the capability. The old scattered min(frameRate, 30) is gone.
  • Capture + publishers: ScreenCaptureController, RTMPPublisher, and SessionPublisher cap encode size and pacing to the device ceiling. The ABR controller's frame-rate clamp is raised from 30 to a sane 120 hardware max, which makes the previously-dead > 30 congestion tier reachable.
  • Thermal safety preserved: ThermalPowerGovernor + the adaptive controller still pull the live rate down from this static ceiling when the device runs warm or low on power.
  • Settings UI: Quality/Frame Rate menus gain 60 fps and 10/12 Mbps options, filtered to the device ceiling; a stored pick above the ceiling displays and streams as the capped value.

Testing

  • StreamCoreTests: 57 tests in 14 suites passed — including new StreamCapabilityTests, StreamSettingsFrameRateTests, and updated StreamSettingsEncodeSizeTests (1080p reachable on capable ceiling, honestly clamped on 720 devices, aspect preserved, even dimensions).
  • xcodebuild build for the Stream scheme on the iOS 27 simulator SDK: BUILD SUCCEEDED.
  • CI validates StreamCore only (runners lack the iOS 27 SDK); live 1080p60 behavior is verified on a physical iOS 27 device.

Rebased onto current main (on top of the settings drawer #25, mic-mute FAB #26, and stop-confirmation #27).

🤖 Generated with Claude Code

Replace the hard-coded 720px / 30fps encode ceilings with a device-
derived StreamCapability (1080p60 on 6GB+ / 6-core hardware, 1080p30 on
4GB, 720p30 on 3GB). encodeSize now takes a maxShortEdge and a new
encodeFrameRate(maxFrameRate:) clamps fps, both fed by the capability so
a high-end pick never asks a device for more than it can sustain. The
thermal governor and adaptive controller continue to pull the live rate
down from this static ceiling at runtime. Settings pickers gain 60fps and
10/12 Mbps options, filtered to the device ceiling. Closes #17.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@joeblau
joeblau merged commit 5ca4bb2 into main Jul 4, 2026
1 check passed
@joeblau
joeblau deleted the fix/17-unlock-1080p60 branch July 4, 2026 20:19
joeblau added a commit that referenced this pull request Jul 4, 2026
#17) (#29)

The 1080p60 unlock (#28) gated the Quality and Frame Rate pickers by
StreamCapability but left the collapsed Video launcher summary
interpolating the raw persisted videoQuality/frameRate. On a device
whose ceiling is below a stored value — e.g. a settings blob restored via
iCloud/backup from a more capable phone — the row rendered "1080p · … ·
60 fps" while the pickers and the actual encoded stream were correctly
capped, reintroducing the exact over-promise #17 set out to remove. Show
the effective (min'd) values so the summary matches what streams.

Also pins two StreamCore contracts an adversarial review flagged as
untested: the StreamCapability core-count boundary at exactly 6 (5 cores
+ ample RAM -> 30 fps) and the zero-dimension encodeSize fallback at a
1080 ceiling and under clamping.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

M2 · Unlock 1080p60 (capability/thermal-gated)

1 participant