obs-studio
obs-studio copied to clipboard
obs-module: Add basic plugin manager
Description
This is a draft PR of an initial plugin manager for OBS. This PR adds the following changes/api calls/etc.
- Adds a
Plugin Managermenu item to the OBS tools menu, which opens a Plugin Manager Dialog, showing all installed third party plugins, with check boxes to enable/disable them for the next launch of OBS. - Upon enabling or disabling a plugin, a modal informs the user that OBS must be restarted for changes to take effect, and gives the user a restart button.
- Adds a plugin manager preferences file/directory under
config/basic/plugin-manager. This config file holds all known installed 3rd party plugins, the ids of any sources, outputs, encoders, or services that those plugins provide (which are added the first time the plugin loads in OBS), as well as identifying metadata about the plugin, and if the plugin is enabled or disabled. - Adds tracking of Core and Disabled modules to the OBS Core structure.
- Adds api calls to OBS core to:
- Add a core module.
void obs_add_core_module(const char* name); - Add a disabled module
void obs_add_disabled_module(const char* name); - Check if a given module can be disabled
bool obs_get_module_allow_disable(const char* name); - Retrieve the module that provides a source:
obs_module_t* obs_source_get_module(const char* id);
- Add a core module.
- For sources, encoders, services, and outputs, adds a pointer back to providing module in the corresponding info struct, along with functions to retrieve the pointer.
- Modules load data into their info struct from an optional metadata file located in the modules data directory.
- Added calls to
OBSBasicto determine if a given source/output/encoder/service id is provided by a disabled module, thus allowing for UI updates indicating a disabled state.
Motivation and Context
OBS Needs a plugin manager. See idea here: https://ideas.obsproject.com/posts/14/add-a-plugin-manager
How Has This Been Tested?
- This draft PR code has been tested on Windows, but being a draft PR will require significantly more testing, which will be done.
- Concerns include ensuring that during the module loading phase, we do not cause any unintended side effects by suppressing the loading of certain modules. Additionally, for Encoders, Outputs, and Services, moving to storing copies of the relevant info structs rather than using those provided by the plugin.
Types of changes
- New feature (non-breaking change which adds functionality)
Checklist:
- [ ] My code has been run through clang-format.
- [x] I have read the contributing document.
- [x] My code is not on the master branch.
- [x] The code has been tested.
- [ ] All commit messages are properly formatted and commits squashed where appropriate.
- [ ] I have included updates to all appropriate documentation.