Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mac-capture: Add support for macOS sharing picker for screen capture #11139

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PatTheMav
Copy link
Member

Description

Adds the macOS sharing picker as a capture type for screen capture sources.

Motivation and Context

macOS provides a global picker for shared windows, applications, desktops, and also combinations of multiple windows or applications.

This enables users to change the input of a screen capture source from within the OS without the need to switch to OBS to change a source's properties.

Starting with macOS 15, this is the only way to capture visible screen content without adding a temporary capture system permission, but as macOS only recognizes a single(!) capture target, one cannot use a picker-based screen capture and audio capture source (hence why this has not been added to the audio capture source).

Likewise a second screen capture source using the picker source will not receive any input, but also not influence the function of the first source.

How Has This Been Tested?

Tested on macOS 14:

  • Selected Desktop capture from sharing picker
  • Selected single window and multiple windows from sharing picker
  • Selected single application and multiple applications from sharing picker
  • Ended sharing from within captured applications and windows
  • Added second screen capture source with picker type
  • Captured single and multiple windows with active audio

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@PatTheMav PatTheMav added Seeking Testers Build artifacts on CI macOS Affects macOS labels Aug 15, 2024
@jcm93
Copy link
Contributor

jcm93 commented Aug 17, 2024

When the picker mode is selected in the source properties window, would it be possible to add a button that will activate/invoke the picker directly?

Screenshot 2024-08-17 at 1 15 31 PM

Per this screenshot, it's a bit confusing when you first select this mode to actually see how to activate the picker (the answer is, you click that grey circle in the menu bar capture popover, or else happen upon the unintuitive window stoplight controls; maybe there is a third way of which I'm unaware).

@PatTheMav
Copy link
Member Author

When the picker mode is selected in the source properties window, would it be possible to add a button that will activate/invoke the picker directly?

Screenshot 2024-08-17 at 1 15 31 PM Per this screenshot, it's a bit confusing when you first select this mode to actually see how to activate the picker (the answer is, you click that grey circle in the menu bar capture popover, or else happen upon the unintuitive window stoplight controls; maybe there is a third way of which I'm unaware).

That's not what I get on macOS 14:

Bildschirmfoto 2024-08-17 um 20 38 28

I can directly choose whether to capture a window, app, or the entire desktop. Admittedly I have to click on the menu bar widget first (which only appears once a SCK source becomes active).

Also I haven't been able to automatically trigger/show the picker programmatically, in my tests the call just doesn't do anything.

@PatTheMav PatTheMav marked this pull request as draft August 17, 2024 19:53
@PatTheMav
Copy link
Member Author

Put back into draft stage because there are a lot of side-effects with activating the picker for an application that were not taken into account by the pull request.

macOS provides a global picker for shared windows, applications,
desktops, and also combinations of multiple windows or applications.

This enables users to change the input of a screen capture source from
within the OS without the need to switch to OBS to change a source's
properties.

Starting with macOS 15, this is the only way to capture visible screen
content without adding a temporary capture system permission, but as
macOS only recognizes a single(!) capture target, one cannot use a
picker-based screen capture and audio capture source (hence why this
has not been added to the audio capture source).

Likewise a second screen capture source using the picker source will not
receive any input, but also not influence the function of the first
source.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
macOS Affects macOS Seeking Testers Build artifacts on CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants