Skip to content

Draft: modules: add scope for inheritency

Draft status

The MR is still draft because I want to change the way I handled the symbol issues, which is very clunky currently (reverted patches).

The review still stands for the following content + commit matching the MR title.

Description

Historically, modules could have as many sub-modules as wanted, but the recursion brought nothing but constraints and the system was reduced to two categories: modules and submodules.

A module will define properties that will fuse into submodules from the same scope.

In dynamic plugins, a "module" scope was defined specifically by the core when loading a plugin before executing the vlc_entry symbol. With static plugins, a similar mechanism was also made when loading one of the entry from the vlc_static_plugins array, so it was also controlled by the core.

This commit introduces a new opcode to allow plugins to request a new module scope from the vlc_entry symbol entrypoint.

Being able to create new scopes from the plugin provides a way to merge plugins together after they have been compiled, typically allowing:

  • merging every plugins into a single dynamic plugin
  • merging every static plugins into a single entrypoint
  • merging plugins like the ffmpeg ones into a single one without compilation guard
  • creating dynamic plugin scope depending on external files

Merge request reports