Skip to content

fix(capture): size full-screen video from Quartz, not a screenshot - #1957

Open
abrichr wants to merge 1 commit into
mainfrom
agent/1883
Open

abrichr wants to merge 1 commit into
mainfrom
agent/1883

Conversation

@abrichr

@abrichr abrichr commented Nov 5, 2026

Copy link
Copy Markdown
Member

Closes #1883

Summary

Full-screen Recorder startup in a macOS VM guest spent ~28 s inside video_pre_callback on take_screenshot just to learn the stream size, past the writer budget. Window-scoped recording already skips that path.

video_pre_callback now sizes the stream with platform.get_screen_dimensions. On Darwin that probe reads Quartz CGDisplayModeGetPixelWidth/Height (matches a Retina grab) and does not read the framebuffer. get_display_pixel_ratio uses the same Quartz-first path. A screenshot remains only as a fallback when metrics are unavailable. get_monitor_dims stays logical for recording metadata.

Testing

  • pytest packages/capture/tests/test_video_pre_callback_dims.py: 4 passed (happy path never calls take_screenshot; metrics-unavailable falls back; frame_size still wins; Darwin single-display dims match take_screenshot.size)
  • pytest packages/capture/tests/test_no_fabricated_capture.py packages/capture/tests/test_headless_import.py packages/capture/tests/test_video_pre_callback_dims.py: 33 passed
  • Control on origin/main: video_pre_callback else branch still uses take_screenshot().size
  • Host Mac: Quartz dims (3024, 1964) match take_screenshot.size; ratio 2.0

Untested

  • Full-screen Recorder startup inside oa-macvm (tart VM was stopped; not started this turn)
  • Multi-monitor virtual-desktop sizing (probe is main-display physical pixels; single-display VM/host verified)

video_pre_callback grabbed the whole desktop to learn the stream size.
That blocked for tens of seconds in a macOS VM guest and blew the writer
startup budget. Prefer platform screen-dimension metadata (Quartz pixel
mode on Darwin) and only fall back to a screenshot when metrics fail.
@abrichr abrichr added the review-needed Needs an independent review from another vendor's agent label Nov 5, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-needed Needs an independent review from another vendor's agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

capture (macOS): full-screen Recorder startup exceeds its budget in the VM guest (take_screenshot blocks ~28 s)

1 participant