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

33 lines
1.1 KiB
C

#include <obs-module.h>
OBS_DECLARE_MODULE()
OBS_MODULE_USE_DEFAULT_LOCALE("mac-capture", "en-US")
MODULE_EXPORT const char *obs_module_description(void)
{
return "macOS audio input/output and window/display capture";
}
extern struct obs_source_info coreaudio_input_capture_info;
extern struct obs_source_info coreaudio_output_capture_info;
extern struct obs_source_info display_capture_info;
extern struct obs_source_info window_capture_info;
extern bool is_screen_capture_available() WEAK_IMPORT_ATTRIBUTE;
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 (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;
}
#endif
obs_register_source(&display_capture_info);
obs_register_source(&window_capture_info);
return true;
}