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.
This commit is contained in:
PatTheMav 2022-07-24 19:43:20 +02:00 committed by Patrick Heyer
parent 48819def6d
commit 790c5b66f6
2 changed files with 7 additions and 3 deletions

View File

@ -3,10 +3,14 @@
bool is_screen_capture_available(void)
{
return (NSClassFromString(@"SCStream") != NULL);
if (@available(macOS 12.5, *)) {
return true;
} else {
return false;
}
}
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 120500 // __MAC_12_5
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 120300 // __MAC_12_3
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunguarded-availability-new"

View File

@ -18,7 +18,7 @@ bool obs_module_load(void)
{
obs_register_source(&coreaudio_input_capture_info);
obs_register_source(&coreaudio_output_capture_info);
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 120500 // __MAC_12_5
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 120300 // __MAC_12_3
if (is_screen_capture_available()) {
extern struct obs_source_info screen_capture_info;
obs_register_source(&screen_capture_info);