diff options
author | gxalpha <beckmann.sebastian@outlook.de> | 2023-10-07 17:16:45 +0200 |
---|---|---|
committer | Lain <lain@obsproject.com> | 2023-10-09 18:28:02 -0600 |
commit | e85b257562f19e30fd89bcebf14dd37ccfdf69f3 (patch) | |
tree | 9f0c4dd711fcd88e9455763aee2255adbc204aa1 | |
parent | 1781289f226fb202cfd751f1aa479df06e860568 (diff) |
mac-virtualcam: Check result of finished extension installation30.0.0-rc1
Adds a switch to distinguish between the possible results that could
occur. While we expect to received RequestCompleted for our camera
extension (RequestWillCompleteAfterReboot is usually more of a network
extension thing), we can't be sure that this always is what we receive
unless we check it.
-rw-r--r-- | plugins/mac-virtualcam/src/obs-plugin/data/locale/en-US.ini | 1 | ||||
-rw-r--r-- | plugins/mac-virtualcam/src/obs-plugin/plugin-main.mm | 13 |
2 files changed, 12 insertions, 2 deletions
diff --git a/plugins/mac-virtualcam/src/obs-plugin/data/locale/en-US.ini b/plugins/mac-virtualcam/src/obs-plugin/data/locale/en-US.ini index ba11cc8cc..75301ff8e 100644 --- a/plugins/mac-virtualcam/src/obs-plugin/data/locale/en-US.ini +++ b/plugins/mac-virtualcam/src/obs-plugin/data/locale/en-US.ini @@ -4,5 +4,6 @@ Error.SystemExtension.CameraUnavailable="Could not find virtual camera.\n\nPleas Error.SystemExtension.CameraNotStarted="Unable to start virtual camera.\n\nPlease try again." Error.SystemExtension.InstallationError="An error has occured while installing the virtual camera:" Error.SystemExtension.WrongLocation="OBS cannot install the virtual camera if it's not in \"/Applications\". Please move OBS to the \"/Applications\" directory." +Error.SystemExtension.CompleteAfterReboot="The installation of the virtual camera will complete after a system reboot." Error.DAL.NotInstalled="The virtual camera could not be installed or updated.\n\nPlease try again and enter the name and password of an administrator when prompted." Error.DAL.NotUninstalled="Could not remove the legacy virtual camera.\n\nPlease try again and enter the name and password of an administrator when prompted." diff --git a/plugins/mac-virtualcam/src/obs-plugin/plugin-main.mm b/plugins/mac-virtualcam/src/obs-plugin/plugin-main.mm index 56b4c6130..c25151d97 100644 --- a/plugins/mac-virtualcam/src/obs-plugin/plugin-main.mm +++ b/plugins/mac-virtualcam/src/obs-plugin/plugin-main.mm @@ -96,8 +96,17 @@ struct virtualcam_data { - (void)request:(nonnull OSSystemExtensionRequest *)request didFinishWithResult:(OSSystemExtensionRequestResult)result { - self.installed = YES; - blog(LOG_INFO, "macOS Camera Extension activated successfully."); + switch (result) { + case OSSystemExtensionRequestCompleted: + self.installed = YES; + blog(LOG_INFO, "macOS Camera Extension activated successfully."); + break; + case OSSystemExtensionRequestWillCompleteAfterReboot: + self.lastErrorMessage = + [NSString stringWithUTF8String:obs_module_text("Error.SystemExtension.CompleteAfterReboot")]; + blog(LOG_INFO, "macOS Camera Extension will activate after reboot."); + break; + } } - (void)requestNeedsUserApproval:(nonnull OSSystemExtensionRequest *)request |