MCPcopy Create free account
hub / github.com/DistroAV/DistroAV / obs_module_load

Function obs_module_load

src/plugin-main.cpp:285–505  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283}
284
285bool obs_module_load(void)
286{
287 obs_log(LOG_DEBUG, "+obs_module_load()");
288 obs_log(LOG_INFO, "obs_module_load: you can haz %s (Version %s)", PLUGIN_DISPLAY_NAME, PLUGIN_VERSION);
289 // obs_log(LOG_DEBUG, "obs_module_load: Qt Version: %s (runtime), %s (compiled)", qVersion(), QT_VERSION_STR);
290
291 Config::Initialize();
292
293 // HARD requirement Check START
294 // Process plugin's HARD requirements that would prevent the plugin from loading.
295
296 // OBS-NDI conflict check
297 // The plugin cannot work if the older OBS-NDI plugin is installed.
298 if (is_obsndi_installed()) {
299 obs_log(LOG_ERROR, "ERR-403 - OBS-NDI is detected and needs to be uninstalled before %s can work.",
300 PLUGIN_DISPLAY_NAME);
301 obs_log(LOG_DEBUG,
302 "obs_module_load: OBS-NDI is detected and needs to be uninstalled before %s will load.",
303 PLUGIN_DISPLAY_NAME);
304 showCriticalMessageBoxDelayed(QTStr("NDIPlugin.ErrorObsNdiDetected.Title"),
305 QTStr("NDIPlugin.ErrorObsNdiDetected.Message")
306 .arg(rehostUrl(PLUGIN_REDIRECT_UNINSTALL_OBSNDI_URL)));
307 return false;
308 }
309 obs_log(LOG_DEBUG, "obs_module_load: OBS-NDI leftover check complete. Continuing...");
310
311 // Plugin's minimum functional OBS version check
312 // The plugin cannot work if this minimum version requirement is not met.
313 // This is a different requirement than the minimum OBS version required for features access.
314 // Starting OBS 32+ this will not be required anymore. See PR : https://github.com/obsproject/obs-studio/pull/6916
315 // TO DO : As soon as OBS 32 is used in the buildspec.json as the minimum OBS version, this check can be removed."
316 if (!is_version_supported(obs_get_version_string(), PLUGIN_MIN_OBS_VERSION)) {
317
318 // Bypass this check. Only for advanced users (not recommended)
319 if (Config::CheckObsBypass) {
320 obs_log(LOG_WARNING,
321 "OBS version check ignore enabled - Continuing to load plugin even though OBS version detected (%s) is below the minimum required version (%s). This may lead to instability or crashes.",
322 obs_get_version_string(), PLUGIN_MIN_OBS_VERSION);
323 } else {
324 // Default Beahvior
325 obs_log(LOG_ERROR, "ERR-424 - %s requires at least OBS version %s.", PLUGIN_DISPLAY_NAME,
326 PLUGIN_MIN_OBS_VERSION);
327 obs_log(LOG_DEBUG,
328 "obs_module_load: OBS version detected is not compatible. OBS version detected: %s. OBS version required: %s",
329 obs_get_version_string(), PLUGIN_MIN_OBS_VERSION);
330
331 auto title = "OBS version not supported";
332 auto message =
333 "Error-424: Plugin requires OBS " + QTStr(PLUGIN_MIN_OBS_VERSION) + " or higher <br>";
334 showCriticalMessageBoxDelayed(title, message);
335
336 return false;
337 }
338 }
339 obs_log(LOG_DEBUG, "obs_module_load: Minimum API-level OBS version check complete. Continuing...");
340
341 // HARD requirement Check END
342

Callers

nothing calls this directly

Calls 14

is_obsndi_installedFunction · 0.85
QTStrFunction · 0.85
rehostUrlFunction · 0.85
is_version_supportedFunction · 0.85
load_ndilibFunction · 0.85
StrFunction · 0.85
makeLinkFunction · 0.85
register_plugin_featuresFunction · 0.85
main_output_initFunction · 0.85
preview_output_initFunction · 0.85
main_output_deinitFunction · 0.85

Tested by

no test coverage detected