Expand description
Audio-plugin ABI version encoding and compatibility rules.
Every plugin cdylib must expose two extern "C" symbols describing its
ABI contract with the host:
audio_plugin_abi_magic() -> u32— must equalAUDIO_PLUGIN_ABI_MAGIC(0x41504C47, ASCII"APLG").audio_plugin_abi_version() -> u32— a version word encoded withencode_abi_version: the upper 16 bits are the major version, the lower 16 bits are the minor version.
§Compatibility
A plugin is ABI-compatible with the host when both hold:
- its magic equals
AUDIO_PLUGIN_ABI_MAGIC, and - its version major equals the host major (see
is_abi_compatible).
The minor version may differ: minor is reserved for additive, backwards-compatible changes (new optional entry symbols, new metadata fields). A major bump is a breaking change and the host will refuse to load the plugin.
The magic is a separate symbol from the version word, so the loader checks
it independently — compare the plugin’s audio_plugin_abi_magic() return
value against AUDIO_PLUGIN_ABI_MAGIC.
Structs§
- AbiVersion
- A typed, validated wrapper around an encoded ABI version word.
Constants§
- AUDIO_
PLUGIN_ ABI_ MAGIC - Magic word every plugin must return from
audio_plugin_abi_magic(). - AUDIO_
PLUGIN_ ABI_ VERSION - ABI version exposed by this host:
1.0.
Functions§
- abi_
major - Decode the major component (upper 16 bits) of an encoded ABI version word.
- abi_
minor - Decode the minor component (lower 16 bits) of an encoded ABI version word.
- encode_
abi_ version - Encode a
(major, minor)pair into a single ABI version word. - is_
abi_ compatible - Return
truewhenhost_versionandplugin_versionare ABI-compatible, i.e. their major components are equal.