mpv/DOCS
Kacper Michajłow eab3842d8b cplugin: allow loading mpv_* symbols dynamically
Defining MPV_CPLUGIN_DYNAMIC_SYM during plugin compilation will replace mpv_*
functions with function pointers. Those pointer will be initialized when
loading the plugin.

It is recommended to use this symbol table when targeting Windows. The loader
does not have notion of global symbols. Loading cplugin into mpv process will
not allow this plugin to call any of the symbols that may be available in
other modules. Instead cplugin has to link explicitly to specific PE binary,
libmpv-2.dll/mpv.exe or any other binary that may have linked mpv statically.
This limits portability of cplugin as it would need to be compiled separately
for each of target PE binary that includes mpv's symbols. Which in practice
is unrealictis, as we want one cplugin to be loaded without those restrictions.

Instead of linking to any PE binary, we create function pointer for all mpv's
exported symbols. For convinience names of entrypoints are redefined to those
pointer so no changes are required in cplugin source code, except defining
MPV_CPLUGIN_DYNAMIC_SYM. Those function pointer are exported to make them
available for mpv to init with correct values during runtime, before calling
`mpv_open_cplugin`.

Note that those pointer are decorated with `selectany` attribute, so no need
to worry about multiple definitions, linker will keep only single instance.

This fixes cplugin usability on Windows. Without any API changes, only
recompilation with -DMPV_CPLUGIN_DYNAMIC_SYM is needed.
2023-09-20 02:16:45 +00:00
..
man cplugin: allow loading mpv_* symbols dynamically 2023-09-20 02:16:45 +00:00
client-api-changes.rst DOCS/client-api-changes.rst: move mpv_del_property to 0.36.0 2023-02-21 17:07:57 +00:00
compatibility.rst
compile-windows.md DOCS/compile-windows.md: update MSYS2 packages 2023-01-28 01:03:12 +00:00
contribute.md DOCS/contrinute: add commit title example prefixes 2021-08-15 22:15:27 +03:00
edl-mpv.rst edl: add a way to add tags 2021-05-11 22:18:40 +02:00
encoding.rst DOCS/encoding: remove the legacy option syntax 2022-07-07 21:12:57 -04:00
interface-changes.rst builtin.conf: modernize internal profiles 2023-09-19 22:26:56 +02:00
mplayer-changes.rst player/command: remove video-aspect property 2023-08-31 17:37:42 +00:00
release-policy.md DOCS/release-policy.md: add additional advice 2023-07-17 11:55:45 +02:00
tech-overview.txt various: fix typos 2022-04-25 09:07:18 -04:00