[PR #261] [CLOSED] Move Mac screen capture lifecycle to VideoUnit, driven by scene configuration #258

Closed
opened 2026-03-02 04:00:57 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/eerimoq/moblin/pull/261
Author: @Copilot
Created: 3/1/2026
Status: Closed

Base: mainHead: copilot/move-mac-screen-capture-to-videounit


📝 Commits (2)

  • e197e33 Initial plan
  • 1e3af9d Move Mac screen capture logic from Model to VideoUnit

📊 Changes

7 files changed (+102 additions, -62 deletions)

View changed files

📝 Moblin/Media/HaishinKit/Media/Video/VideoUnit.swift (+44 -0)
📝 Moblin/Various/Media.swift (+4 -2)
📝 Moblin/Various/Model/Model.swift (+7 -8)
📝 Moblin/Various/Model/ModelScreenCapture.swift (+46 -40)
📝 Moblin/Various/Model/ModelStream.swift (+0 -1)
📝 Moblin/Various/Settings/SettingsDebug.swift (+1 -5)
📝 Moblin/View/Settings/Debug/DebugSettingsView.swift (+0 -6)

📄 Description

Mac screen capture was always running when a debug toggle was enabled, regardless of whether the current scene needed it. Now it starts/stops automatically based on whether the active scene or its widgets use screen capture as a video source.

Core change

  • Added macScreenCapture: Bool to VideoUnitAttachParams
  • VideoUnit.attach() calls updateMacScreenCapture(enabled:) to start/stop MacScreenCapture.shared
  • VideoUnit implements MacScreenCaptureDelegate on macCatalyst, managing buffered video directly

Scene detection

  • Added sceneNeedsMacScreenCapture(scene:) — checks the scene's main video source and recursively checks widgets (videoSource, vTuber, pngTuber, nested scenes) for .screenCapture usage

Cleanup

  • Removed database.debug.macScreenCapture toggle, reloadMacScreenCapture(), and Model's MacScreenCaptureDelegate conformance
  • Non-macCatalyst path (SampleBufferReceiverDelegate) unchanged

🔒 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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/eerimoq/moblin/pull/261 **Author:** [@Copilot](https://github.com/apps/copilot-swe-agent) **Created:** 3/1/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `copilot/move-mac-screen-capture-to-videounit` --- ### 📝 Commits (2) - [`e197e33`](https://github.com/eerimoq/moblin/commit/e197e33cdde7d537a64d0f3ea62a126e18d59f59) Initial plan - [`1e3af9d`](https://github.com/eerimoq/moblin/commit/1e3af9d0c611e0d872e9b4b034c40bf8f7e89db8) Move Mac screen capture logic from Model to VideoUnit ### 📊 Changes **7 files changed** (+102 additions, -62 deletions) <details> <summary>View changed files</summary> 📝 `Moblin/Media/HaishinKit/Media/Video/VideoUnit.swift` (+44 -0) 📝 `Moblin/Various/Media.swift` (+4 -2) 📝 `Moblin/Various/Model/Model.swift` (+7 -8) 📝 `Moblin/Various/Model/ModelScreenCapture.swift` (+46 -40) 📝 `Moblin/Various/Model/ModelStream.swift` (+0 -1) 📝 `Moblin/Various/Settings/SettingsDebug.swift` (+1 -5) 📝 `Moblin/View/Settings/Debug/DebugSettingsView.swift` (+0 -6) </details> ### 📄 Description Mac screen capture was always running when a debug toggle was enabled, regardless of whether the current scene needed it. Now it starts/stops automatically based on whether the active scene or its widgets use screen capture as a video source. ### Core change - Added `macScreenCapture: Bool` to `VideoUnitAttachParams` - `VideoUnit.attach()` calls `updateMacScreenCapture(enabled:)` to start/stop `MacScreenCapture.shared` - `VideoUnit` implements `MacScreenCaptureDelegate` on macCatalyst, managing buffered video directly ### Scene detection - Added `sceneNeedsMacScreenCapture(scene:)` — checks the scene's main video source and recursively checks widgets (videoSource, vTuber, pngTuber, nested scenes) for `.screenCapture` usage ### Cleanup - Removed `database.debug.macScreenCapture` toggle, `reloadMacScreenCapture()`, and Model's `MacScreenCaptureDelegate` conformance - Non-macCatalyst path (`SampleBufferReceiverDelegate`) unchanged <!-- START COPILOT CODING AGENT TIPS --> --- 🔒 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.](https://gh.io/cca-advanced-security) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 04:00:57 +03:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/moblin#258
No description provided.