Skip to content

Scale capture to the receiver's advertised display size - #25

Open
0xFerreira wants to merge 1 commit into
omarroth:mainfrom
0xFerreira:scale-to-receiver-display
Open

Scale capture to the receiver's advertised display size#25
0xFerreira wants to merge 1 commit into
omarroth:mainfrom
0xFerreira:scale-to-receiver-display

Conversation

@0xFerreira

@0xFerreira 0xFerreira commented Aug 2, 2026

Copy link
Copy Markdown

The receiver reports the largest frame its decoder accepts in /info, but the capture is always encoded at the portal's native size. On a HiDPI panel that means a 2880x1800 stream sent to a receiver that advertised 1920x1080 — the receiver takes the first IDR, stops consuming, and the mirror freezes on frame one.

  • Clamp the encoded frame to the size from ReceiverInfo.DisplaySize(), which was already parsed but only used for the codec header
  • vapostproc does the downscale on the GPU; videoscale is the fallback where VA-API is unavailable
  • add-borders=true letterboxes so the aspect ratio survives when the two differ
  • -no-scale keeps the old behaviour for receivers known to accept the native size

Likely fixes #21 — same symptom, and that reporter is on an Apple TV HD, which is 1080p-only.

Tested on a Samsung Q60AA (advertises 1920x1080) from a 2880x1800 laptop under Hyprland/PipeWire with VA-API. Before: one frame, then a stalled pipeline at ~0% encoder CPU. After: sustained mirroring, SPS reports 1920x1080.

Unrelated, noticed while here: the man page still documents -width/-height, which the binary no longer accepts.

This is not a revert of #5. Capture still runs at the screen's native resolution; only the encode is clamped, and add-borders=true centres rather than left-aligns — the behaviour #5 asked for.

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.

Mirroring only sends one frame

1 participant