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