0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 21:13:04 +02:00
Commit Graph

179 Commits

Author SHA1 Message Date
PatTheMav
fb9b5c829a mac-capture: Switch to UUID-based display management
Using UUIDs to store display references in obs-studio's settings file
allows us to "rediscover" devices even between restarts
(as CGDirectDisplayID changes between those) and select the same device.
2023-05-20 16:50:16 -07:00
Lain
106c7aa61f Update copyrights/names 2023-05-20 01:31:18 -07:00
PatTheMav
585152c566 mac-capture: Add option to hide OBS windows in desktop capture 2023-05-13 16:55:11 -07:00
PatTheMav
f20f788d0b mac-capture: Fix possible division by zero error
Possibility of `mChannelsPerFrame` being 0 is not properly covered by
current code, which will result in a division-by-zero error.
2023-05-06 16:15:30 -07:00
Translation Updater
a0fbdc3c34 Update translations from Crowdin 2023-05-01 23:11:13 +00:00
PatTheMav
ee3c2d0e8a CI: Fix build errors with Xcode 14.3 and platform SDK 13.3
Xcode 14.3 and the macOS 13.3 platform SDK introduced a few breaking
changes:

* Updated AppleClang emits warnings about unqualified std cast calls
  when using C++ - as `move` is too broad a word, developers are to use
  `std::move` to make this explicit. Alas this is exactly what `json11`
  uses and because that library is archived, there is no possibility
  of an upstream update.

* Apple guarded calls to old screen capture APIs as "available but
  deprecated", but seems to have chosen the wrong lower version
  boundary: The calls are flagged as being available for macOS 13 and
  macOS 14 only.

  To fix this, the existing macOS platform SDK header is replaced by a
  local copy that uses macOS 11 as the lower boundary (the oldest macOS
  version supported by obs-studio anyway)
2023-04-04 17:27:59 +00:00
gxalpha
eaf6444236 mac-capture: Simplify coreaudio_get_device_id
The current method would enum though all devices looking for a matching
uid instead of directly asking for kAudioHardwarePropertyDeviceForUID.
Asking directly instead would also enable finding hidden devices that
can only be found directly via uid and not via enumerating (were we ever
to need to find such a device).
2023-04-01 16:13:17 -07:00
Translation Updater
7c5560bf1b Update translations from Crowdin 2023-03-27 13:39:03 +00:00
PatTheMav
349372b3b3 cmake: Add changes for CMake build framework 3.0
New code path only taken if OBS_CMAKE_VERSION is set to 3.0.0 or
greater, old functionality remains unchanged.
2023-03-26 18:20:38 -04:00
gxalpha
433c85bcd7 mac-capture: Fix various SCK memory leaks
Detected by clang analyzer.
2023-02-21 17:40:56 +01:00
PatTheMav
f98c2d2514 mac-capture: Fix compiler warnings
CMake build framework 3.0 introduces more strict typing checks, which
require additional code fixes to silence.

* Fixes warnings about multi-character assignments
* Fixes warnings about implicit casts
* Fixes warnings about shadowing variables
2023-02-18 15:22:33 -08:00
Norihiro Kamae
be2e082961 mac-capture: Remove unused macros 2023-01-28 19:03:55 -08:00
Translation Updater
783bd52197 Update translations from Crowdin 2023-01-08 04:10:37 +00:00
PatTheMav
7cedd324e1 mac-capture: Disable all SCK modes besides WindowCapture on macOS 12
SCK has too many open issues on macOS 12 to enable full functionality
on that version. Window Capture has the biggest performance uplift and
so far the least amount of quirks, so leave this variant (with the
"Beta" qualifier) for macOS versions before Ventura.
2022-11-12 18:17:49 -05:00
PatTheMav
826c602b84
mac-capture: Replace invocations of sprintf with snprintf
Fixes deprecation warnings in Xcode 14/clang on macOS and reduces
chance of buffer overflows.
2022-11-11 19:51:27 +01:00
jpark37
d84a9dad8a mac-capture: Support P3 for HDR recordings 2022-11-09 22:34:50 -08:00
Translation Updater
f065f20ce1 Update translations from Crowdin 2022-10-25 22:32:14 +00:00
gxalpha
277dafab98 mac-capture: Log CoreAudio device sample rate 2022-10-09 17:09:07 -07:00
PatTheMav
6b56cfddb6 mac-capture: Allow fetching source properties without source
Per OBS API documentation, `get_properties` can be used to get the
properties of a source, but also of a source type. The latter would
pass a NULL pointer for a given source.

This adds the necessary change to avoid crashing OBS by passing such
a null pointer.
2022-09-21 14:28:59 -04:00
gxalpha
332c1b4176 mac-capture: Undeprecate traditional capture sources on macOS 12
SCK has too many bugs on macOS 12 that don't like they will get fixed or
backported for it to be the recommended capture source.
This commit removes the "Deprecated" flag from traditional capture
source if the user is on macOS 12 (even if SCK is available) and marks
SCK as Beta.
2022-09-20 18:49:13 +02:00
Translation Updater
cc2d0791ca Update translations from Crowdin 2022-08-30 09:00:44 +00:00
gxalpha
dbcafb62ff
mac-capture: Remove explicit call to setBackgroundColor
This was necessary since the default background color was meant to be
clear, but wasn't set properly. The bug is fixed in macOS 13 Beta 6, so
we can remove this statement.
2022-08-29 14:38:52 +02:00
jpark37
a9c68c4623 mac-capture: Replace false with 0
Param is uint32_t, not bool.
2022-08-27 08:37:44 -07:00
jpark37
38d8a844de mac-capture: Use cleaner render patterns
Render code seems unnecessarily custom. Use normal patterns.
2022-08-22 16:38:50 -07:00
jpark37
270d299258 mac-capture: Clip gamut to sRGB
Mac likes P3, but OBS only supports sRGB for SDR.
2022-08-20 16:39:37 -07:00
shiina424
d056dce428 mac-capture: Add missing locale text 2022-08-20 01:34:03 -07:00
Translation Updater
4aaa07f93d Update translations from Crowdin 2022-08-17 04:22:50 +00:00
gxalpha
6644fed7b1 mac-capture: Fix macOS 12 SCK Display Capture workaround
Adding all windows manually means that any windows opened after the
session was started won't appear. This instead excludes the Control
Center from Display Capture. While unfortunate, it seems to be the only
thing on the display that can't be disabled.
2022-08-09 16:18:28 +02:00
gxalpha
9f370bd36e mac-capture: Show "hidden" checkbox for app capture on update as well 2022-08-04 00:44:29 +02:00
Translation Updater
81734be37c Update translations from Crowdin 2022-07-31 23:40:53 +00:00
PatTheMav
43bdc627ea mac-capture: Remove display name code path for Mac OS X before 10.15 2022-07-31 12:21:35 +02:00
gxalpha
728d919bde mac-capture: Make background transparent in SCK App Capture on macOS 13+ 2022-07-31 11:22:48 +10:00
gxalpha
5f40084d25 mac-capture: Don't exclude desktop windows in SCK display capture
This fixes the desktop wallpaper missing on Display Capture on macOS 12
2022-07-30 15:24:35 +02:00
gxalpha
0207531910 mac-capture: Inline content_changed function 2022-07-30 15:24:35 +02:00
PatTheMav
93adc0a88c mac-capture: Fix creation of invalid window stream on source creation
When the ScreenCaptureKit-based source is generated, the window ID
read from the settings will be empty and interpreted as window ID "0".

This window ID doesn't represent a valid window, but the capture stream
is nevertheless successfully initialized with that value, but will not
generate any output.

Worse, the activated stream should be destroyed when a new stream is
created, but creation will throw an error.

This commit ensures that a valid window ID is used if no good default
value is available, ensuring a working (and destroyable) stream.

Also removes any remaining usage of the old window-utils.
2022-07-26 21:29:48 +02:00
PatTheMav
2bea178fb7 mac-capture: Fix issue with desktop capture introduced by macOS 12.5
Initializing a display stream with a content filter which excludes an
empty list of windows leads to a broken stream. Initializing with a list
of all available windows as a workaround re-enables functionality.
2022-07-26 21:29:48 +02:00
PatTheMav
2d2a5cad59 mac-capture: Cleanup code to improve efficiency
Reduces the amount of calls to the update callback (also reduces amount
of calls to check for available capture content).

Also moves some code to only update data for currently selected capture
type.
2022-07-26 21:29:48 +02:00
PatTheMav
790c5b66f6 mac-capture: Fix availability on macOS 12.5
Whereas the `availability` checks will correctly detect macOS 12.5,
the `__MAC_OS_X_VERSION_MAX_ALLOWED` macro is dependent on the platform
SDK. The most current platform SDK is 12.3, hence why this version
needs to be checked for.
2022-07-26 21:29:48 +02:00
gxalpha
17a4d9166a mac-capture: Improve SCK locale strings 2022-07-26 15:30:47 +02:00
gxalpha
b72f15dcef mac-capture: Don't show apps with empty name in SCK
SCK's application list has one entry with empty name and bundle ID which
belongs to WindowServer. This is not worth exposing since an empty entry
would confuse users and nothing would get captured if selected.
2022-07-24 13:59:09 +02:00
gxalpha
22baff138b mac-capture: Add deprecated flag to traditional captures if SCK exists
Marking a source as deprecated will make it harder for users to find
when creating a new source. We don't currently plan on removing
traditional display and window capture, however ScreenCaptureKit will be
the preferred capture method going forward.
2022-07-24 13:59:09 +02:00
gxalpha
33a48a6e9c mac-capture: Add label about missing audio on macOS 12 to SCK 2022-07-24 13:59:09 +02:00
PatTheMav
94cf50a8ce mac-capture: Add more verbose log warning for missing permissions 2022-07-24 13:59:09 +02:00
PatTheMav
1d11c2d933 mac-capture: Fix compiler warnings for unused variables and data loss 2022-07-24 13:59:09 +02:00
PatTheMav
0df6c74f7d mac-capture: Make properties window reactive to selected capture type 2022-07-24 13:59:09 +02:00
PatTheMav
ca1a37586f mac-capture: Increase required macOS version for ScreenCaptureKit 2022-07-24 13:59:09 +02:00
Developer-Ecosystem-Engineering
81b631a855 Add support in "macOS ScreenCapture" for capturing audio through ScreenCaptureKit in macOS 13. By default, OBS will capture the audio for the frame content its capturing and exclude OBS own audio. For additional information
on the capabilities of audio capture refer to the documentation https://developer.apple.com/documentation/screencapturekit/ or watch the session "Meet ScreenCaptureKit".

Currently audio capture typically happens via virtual devices set up with 3rd party products. This requires additional installation and configuration by users.
Including the audio with the existing CMBuffers will make it easier to manage audio sync with video frames. Additionally, you can capture distinct audio tracks from multiple apps at once,
like a call with friends +  screen content.

macOS 13 on a 2019 16" MacBook Pro
macOS 13 on a 2022 M1 Pro Macbook Pro

Tested with multiple games + Discord, FaceTime, Apple Music and Safari tabs playing audio content.

* Bug fix (non-breaking change which fixes an issue)
* Performance enhancement (non-breaking change which improves efficiency)

* Additional control over what audio content to capture
* Logic to manage audio & frame sync
2022-07-24 13:59:09 +02:00
Developer-Ecosystem-Engineering
9ed5062e59 mac-capture: Add support for improved window capture in macOS 12.3
Add a new capture plugin called General Capture that allows for capture
of an entire desktop, a single window, or all windows of an application
2022-07-24 13:59:09 +02:00
Norihiro Kamae
7e3656ab33 plugins: Cleanup unused-parameters
- Remove unnecessary UNUSED_PARAMETER
- Add OBS_UNUSED attribute to unused parameters
- Also removes unused variables
2022-07-19 11:01:00 -04:00
Dossy Shiobara
4405072e29 mac-capture: Improve window capture performance
Replaces the current implementation of Window Capture, which uses Core
Graphics to render a bitmap raster, with one that accesses the window's
CGImage bitmap directly, blits it, and hands that off as a frame to OBS
instead.

Co-Authored-By: Sebastian Beckmann <beckmann.sebastian@outlook.de>
2022-05-07 16:21:25 -07:00