Skip to content

Fix display pixel density in adaptive stream#1024

Open
hiroshihorie wants to merge 4 commits into
mainfrom
hiroshi/adaptive-stream-pixel-density
Open

Fix display pixel density in adaptive stream#1024
hiroshihorie wants to merge 4 commits into
mainfrom
hiroshi/adaptive-stream-pixel-density

Conversation

@hiroshihorie
Copy link
Copy Markdown
Member

@hiroshihorie hiroshihorie commented May 29, 2026

Summary

  • scale adaptive-stream sizes from logical points to physical pixels on high-density displays
  • add VideoView.AdaptiveStreamPixelDensity with .auto and .fixed(Double) controls
  • resolve display scale per platform and guard invalid densities before capping to maxDensity

Testing

  • swift test --filter AdaptiveStreamPixelDensityTests

VideoView fed its logical (point) frame size straight into UpdateTrackSettings
via adaptiveStreamSize, so on retina/HiDPI displays it under-requested by the
screen scale and the server returned an upscaled/soft layer. Server simulcast/
SVC layers are sized in physical pixels.

- Add VideoView.AdaptiveStreamPixelDensity { auto, fixed(Double) } (capped at
  3x), mirroring the JS pixelDensity / Flutter AdaptiveStreamPixelDensity.
- Add a per-view adaptiveStreamPixelDensity property (default .auto).
- Capture the view's own screen scale at performLayout (UIScreen.scale /
  NSScreen.backingScaleFactor / traitCollection.displayScale) into State.
- adaptiveStreamSize now returns rendererSize x resolved density (physical px).

Because the scale is read per-view, a track shown on screens with different
scales (e.g. built-in retina + external 1x) requests correctly for each.
@hiroshihorie hiroshihorie changed the title Hiroshi/adaptive stream pixel density fix: account for display pixel density in adaptive stream May 31, 2026
@hiroshihorie hiroshihorie changed the title fix: account for display pixel density in adaptive stream Fix display pixel density in adaptive stream May 31, 2026
@hiroshihorie hiroshihorie marked this pull request as ready for review May 31, 2026 09:32
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