Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions obs-studio-client/source/nodeobs_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,17 +383,11 @@ Napi::Value service::OBS_service_startVirtualCam(const Napi::CallbackInfo &info)
if (!conn)
return info.Env().Undefined();

#if defined(__APPLE__)
// On macOS, we will wait for a response. Our situation is more complicated due to the vcam SystemExtension
// which will return errors that we need to display to the user.
std::vector<ipc::value> response = conn->call_synchronous_helper("NodeOBS_Service", "OBS_service_startVirtualCam", {});
if (response.size() > 1) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we throw if the response is empty?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good callout. I thought about updating the code path to return OK when all goes well and also tidy up the frontend code to check for OK. Right now, it just wraps this code in a try/catch on FE side and displays a popup if its' returned an exception.

// We encountered an error setting up the vcam
Napi::Error::New(info.Env(), response[1].value_str).ThrowAsJavaScriptException();
}
#else
conn->call("NodeOBS_Service", "OBS_service_startVirtualCam", {});
#endif
return info.Env().Undefined();
}

Expand Down
Loading