Skip to content

Add ScreenCaptureKit screen capture for Mac Catalyst#259

Closed
Copilot wants to merge 3 commits intomac-catalystfrom
copilot/add-mac-catalyst-screen-capture
Closed

Add ScreenCaptureKit screen capture for Mac Catalyst#259
Copilot wants to merge 3 commits intomac-catalystfrom
copilot/add-mac-catalyst-screen-capture

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 28, 2026

Mac Catalyst has no broadcast extension support, so the existing ReplayKit-based screen capture is non-functional. This adds in-process screen capture via ScreenCaptureKit, wired into the existing buffered video pipeline. The "Screen capture" video source option already exists in scenes/widgets UI — this makes it work on Mac Catalyst.

Changes

  • Moblin/Various/MacScreenCapture.swift (new) — SCStream wrapper capturing the primary display at 2x (Retina) resolution, 30 FPS, BGRA. Delivers CMSampleBuffer frames via delegate. Entire file is #if targetEnvironment(macCatalyst).

  • Moblin/Various/Model/ModelScreenCapture.swift — Extracted shared helpers (handleScreenCaptureStarted/Stopped/SampleBuffer) and split delegate conformance by platform: MacScreenCaptureDelegate on macCatalyst (zero latency, in-process), SampleBufferReceiverDelegate on iOS (0.2s latency for ReplayKit IPC).

  • Moblin/Various/Model/Model.swift — Added macScreenCapture property and conditional setup in setupSampleBufferReceiver() to start ScreenCaptureKit on macCatalyst instead of the Unix socket listener.

Design

Follows the AVCaptureSession pattern (direct in-process capture) rather than the iOS approach (out-of-process broadcast extension + socket IPC). Frames feed into the same addBufferedVideo/appendBufferedVideoSampleBuffer pipeline used by all non-camera video sources.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI and others added 2 commits February 28, 2026 22:22
Create MacScreenCapture class that uses ScreenCaptureKit to capture the
whole screen on macCatalyst, delivering frames through the existing
buffered video pipeline. On iOS, the existing ReplayKit broadcast
extension approach is preserved.

- New file: Moblin/Various/MacScreenCapture.swift
- Modified: ModelScreenCapture.swift (platform-conditional delegate)
- Modified: Model.swift (macScreenCapture property and setup)

Co-authored-by: eerimoq <176810+eerimoq@users.noreply.github.com>
Co-authored-by: eerimoq <176810+eerimoq@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for screen capture in Mac Catalyst build Add ScreenCaptureKit screen capture for Mac Catalyst Feb 28, 2026
@eerimoq eerimoq closed this Mar 1, 2026
@eerimoq eerimoq deleted the copilot/add-mac-catalyst-screen-capture branch March 11, 2026 02:14
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.

2 participants