annotate src/vamp-plugin-sdk-2.4/README.compat @ 108:1813f30f2f15

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