Browse Source

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.
gxalpha 3 years ago
parent
commit
332c1b4176

+ 1 - 0
plugins/mac-capture/data/locale/en-US.ini

@@ -22,5 +22,6 @@ Crop.origin.y="Crop top"
 Crop.size.width="Crop right"
 Crop.size.height="Crop bottom"
 SCK.Name="macOS Screen Capture"
+SCK.Name.Beta="macOS Screen Capture (BETA)"
 SCK.AudioUnavailable="Audio capture requires macOS 13 or newer."
 SCK.Method="Method"

+ 4 - 1
plugins/mac-capture/mac-screen-capture.m

@@ -668,7 +668,10 @@ static void screen_capture_video_render(void *data, gs_effect_t *effect
 
 static const char *screen_capture_getname(void *unused __attribute__((unused)))
 {
-	return obs_module_text("SCK.Name");
+	if (@available(macOS 13.0, *))
+		return obs_module_text("SCK.Name");
+	else
+		return obs_module_text("SCK.Name.Beta");
 }
 
 static uint32_t screen_capture_getwidth(void *data)

+ 6 - 2
plugins/mac-capture/plugin-main.c

@@ -22,8 +22,12 @@ bool obs_module_load(void)
 	if (is_screen_capture_available()) {
 		extern struct obs_source_info screen_capture_info;
 		obs_register_source(&screen_capture_info);
-		display_capture_info.output_flags |= OBS_SOURCE_DEPRECATED;
-		window_capture_info.output_flags |= OBS_SOURCE_DEPRECATED;
+		if (__builtin_available(macOS 13.0, *)) {
+			display_capture_info.output_flags |=
+				OBS_SOURCE_DEPRECATED;
+			window_capture_info.output_flags |=
+				OBS_SOURCE_DEPRECATED;
+		}
 	}
 #endif
 	obs_register_source(&display_capture_info);