comparison README.compat @ 256:3d98dd2ba0d6

* Add documentation about backward compatibility
author cannam
date Fri, 14 Nov 2008 10:59:48 +0000
parents
children 4454843ff384
comparison
equal deleted inserted replaced
255:88ef5ffdbe8d 256:3d98dd2ba0d6
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 classes compiled
80 into plugins are now internally enclosed in a special C++ namespace
81 (the _VampPlugin namespace) to avoid any confusion between host and
82 plugin namespaces in unusual linkage situations. This is handled
83 transparently in most circumstances, and neither plugin nor host
84 authors will normally need to care about it.
85
86 However, hosts that directly incorporate code from plugins, for
87 example to provide functionality that is the same as those plugins
88 without having to explicitly load them, may find that they can no
89 longer resolve plugin functions at link time because of this namespace
90 mismatch. To avoid this, the host build process should define the
91 preprocessor flag VAMP_NO_PLUGIN_NAMESPACE when compiling the plugin
92 code to ensure that both host and plugin code exist at the same level
93 of namespace.
94
95 (If your host does this, why not make it load the plugins dynamically
96 instead using the normal Vamp plugin loader method? There are many
97 advantages to that.)