annotate src/vamp-plugin-sdk-2.4/README.compat @ 23:619f715526df sv_v2.1

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