annotate src/vamp-plugin-sdk-2.5/README.compat @ 83:ae30d91d2ffe

Replace these with versions built using an older toolset (so as to avoid ABI compatibilities when linking on Ubuntu 14.04 for packaging purposes)
author Chris Cannam
date Fri, 07 Feb 2020 11:51:13 +0000
parents 619f715526df
children
rev   line source
Chris@23 1
Chris@23 2 Backward Compatibility Statement for Vamp Plugin SDK version 2.0
Chris@23 3 ================================================================
Chris@23 4
Chris@23 5 Plugin binary compatibility
Chris@23 6 ---------------------------
Chris@23 7 Version 2.0 of the Vamp plugin binary interface is backward compatible
Chris@23 8 with version 1.0.
Chris@23 9
Chris@23 10 A plugin that was compiled and (statically) linked using version 1.x
Chris@23 11 of the SDK should load and run without modification in a host that was
Chris@23 12 compiled and linked using version 2.0 of the SDK.
Chris@23 13
Chris@23 14 A plugin that was compiled and (statically) linked using version 2.0
Chris@23 15 of the SDK should load and run in a host that was compiled and linked
Chris@23 16 using version 1.x of the SDK. However, the 1.x host will be unable to
Chris@23 17 see any durations that the plugin specifies for its returned features,
Chris@23 18 as there was no support for duration in version 1 of the Vamp plugin
Chris@23 19 interface.
Chris@23 20
Chris@23 21 Plugin/host version discrimination
Chris@23 22 ----------------------------------
Chris@23 23 A Vamp plugin library receives the Vamp SDK version number for the
Chris@23 24 host as the first argument to its vampGetPluginDescriptor function.
Chris@23 25 It may use this information to provide different behaviour depending
Chris@23 26 on the version of the host.
Chris@23 27
Chris@23 28 For example, the plugin may structure its outputs differently in older
Chris@23 29 hosts that do not support feature duration. Or, if the plugins rely
Chris@23 30 on version 2.0 features, the library could make itself invisible to
Chris@23 31 older hosts (returning no plugin descriptors).
Chris@23 32
Chris@23 33 The version argument passed to vampGetPluginDescriptor will be 1 for
Chris@23 34 Vamp 1.x hosts or 2 for Vamp 2.0 hosts. (Plugin libraries should
Chris@23 35 behave as for version 2 if passed a version number greater than 2.)
Chris@23 36
Chris@23 37 Plugin SDK library compatibility
Chris@23 38 --------------------------------
Chris@23 39 For plugin code, version 2.0 of the Vamp plugin SDK is source
Chris@23 40 compatible but not library ABI compatible with version 1.x.
Chris@23 41
Chris@23 42 Plugins written for version 1.x should compile and link without
Chris@23 43 modification using version 2.0. Plugins dynamically linked against
Chris@23 44 version 1.x SDK libraries will need to be rebuilt if they are to work
Chris@23 45 with version 2.0 libraries. To avoid dynamic library resolution
Chris@23 46 issues, it is generally preferable to link the SDK statically when
Chris@23 47 distributing binary plugins.
Chris@23 48
Chris@23 49 Host SDK library compatibility
Chris@23 50 ------------------------------
Chris@23 51 For host code, version 2.0 of the Vamp plugin SDK is neither source
Chris@23 52 nor binary compatible with version 1.x.
Chris@23 53
Chris@23 54 The host SDK header include location has moved for version 2.0; hosts
Chris@23 55 should now only include headers from the vamp-hostsdk/ include
Chris@23 56 directory -- the vamp-sdk/ directory is reserved for inclusion in
Chris@23 57 plugin code only. There is also no longer a separate subdirectory for
Chris@23 58 hostext headers.
Chris@23 59
Chris@23 60 Hosts written for version 1.x will therefore need to have their
Chris@23 61 #include directives updated as follows:
Chris@23 62
Chris@23 63 Old New
Chris@23 64
Chris@23 65 <vamp-sdk/PluginBase.h> <vamp-hostsdk/PluginBase.h>
Chris@23 66 <vamp-sdk/Plugin.h> <vamp-hostsdk/Plugin.h>
Chris@23 67 <vamp-sdk/RealTime.h> <vamp-hostsdk/RealTime.h>
Chris@23 68 <vamp-sdk/hostext/PluginLoader.h> <vamp-hostsdk/PluginLoader.h>
Chris@23 69 <vamp-sdk/hostext/PluginBufferingAdapter.h> <vamp-hostsdk/PluginBufferingAdapter.h>
Chris@23 70 <vamp-sdk/hostext/PluginChannelAdapter.h> <vamp-hostsdk/PluginChannelAdapter.h>
Chris@23 71 <vamp-sdk/hostext/PluginInputDomainAdapter.h> <vamp-hostsdk/PluginInputDomainAdapter.h>
Chris@23 72 <vamp-sdk/PluginHostAdapter.h> <vamp-hostsdk/PluginHostAdapter.h>
Chris@23 73
Chris@23 74 For most hosts, these should be the only changes necessary; the actual
Chris@23 75 code remains the same.
Chris@23 76
Chris@23 77 Hosts that incorporate plugin code
Chris@23 78 ----------------------------------
Chris@23 79 One of the changes in this version of the SDK is that separate
Chris@23 80 top-level C++ namespaces are used for classes compiled into plugins
Chris@23 81 (the _VampPlugin namespace) and hosts (the _VampHost namespace), to
Chris@23 82 avoid any confusion between host and plugin namespaces in unusual
Chris@23 83 linkage situations (as the host and plugin SDKs contain many of the
Chris@23 84 same classes, there is a risk that the wrong class may be picked up by
Chris@23 85 a stupid dynamic linker in cases where the host and plugin SDK
Chris@23 86 versions do not match). This additional namespace is added and opened
Chris@23 87 silently in a manner that is transparent in most circumstances, and
Chris@23 88 neither plugin nor host authors will normally need to know about it.
Chris@23 89
Chris@23 90 However, hosts that directly incorporate code from plugins, for
Chris@23 91 example to provide functionality that is the same as those plugins
Chris@23 92 without having to explicitly load them, will find that they cannot
Chris@23 93 resolve plugin symbols at link time because of this namespace
Chris@23 94 mismatch. To avoid this, you may define the preprocessor symbol
Chris@23 95 _VAMP_PLUGIN_IN_HOST_NAMESPACE when compiling the plugin code in the
Chris@23 96 context of the host, to ensure that both host and plugin code exist
Chris@23 97 within the same namespace.
Chris@23 98
Chris@23 99 (If your host does this, why not make it load the plugins dynamically
Chris@23 100 instead using the normal Vamp plugin loader method? There are many
Chris@23 101 advantages to that.)
Chris@23 102