diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-04-16 12:32:55 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-04-16 12:32:55 +0000 |
commit | b90424cf800617025bc84ee8e9c5e0415dd25dd4 (patch) | |
tree | 45c026494a60b5d8cad6ff12f9c4cc91fcfc34a4 /libs/vamp-sdk/vamp | |
parent | 1ff9e8afc018f621b0f59474612e276d0449d561 (diff) |
merge new directory/file structure from newer vamp version via 2.0 (3993:4905)
git-svn-id: svn://localhost/ardour2/branches/3.0@4983 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/vamp-sdk/vamp')
-rw-r--r-- | libs/vamp-sdk/vamp/vamp.h | 57 |
1 files changed, 53 insertions, 4 deletions
diff --git a/libs/vamp-sdk/vamp/vamp.h b/libs/vamp-sdk/vamp/vamp.h index 4f0145ab59..08a83ee6ac 100644 --- a/libs/vamp-sdk/vamp/vamp.h +++ b/libs/vamp-sdk/vamp/vamp.h @@ -50,7 +50,7 @@ extern "C" { * See also the vampApiVersion field in the plugin descriptor, and the * hostApiVersion argument to the vampGetPluginDescriptor function. */ -#define VAMP_API_VERSION 1 +#define VAMP_API_VERSION 2 /** * C language API for Vamp plugins. @@ -160,6 +160,15 @@ typedef struct _VampOutputDescriptor "Resolution" of result, if sampleType is vampVariableSampleRate. */ float sampleRate; + /** 1 if the returned results for this output are known to have a + duration field. + + This field is new in Vamp API version 2; it must not be tested + for plugins that report an older API version in their plugin + descriptor. + */ + int hasDuration; + } VampOutputDescriptor; typedef struct _VampFeature @@ -184,13 +193,46 @@ typedef struct _VampFeature } VampFeature; +typedef struct _VampFeatureV2 +{ + /** 1 if the feature has a duration. */ + int hasDuration; + + /** Seconds component of duratiion. */ + int durationSec; + + /** Nanoseconds component of duration. */ + int durationNsec; + +} VampFeatureV2; + +typedef union _VampFeatureUnion +{ + // sizeof(featureV1) >= sizeof(featureV2) for backward compatibility + VampFeature v1; + VampFeatureV2 v2; + +} VampFeatureUnion; + typedef struct _VampFeatureList { /** Number of features in this feature list. */ unsigned int featureCount; - /** Features in this feature list. May be NULL if featureCount is zero. */ - VampFeature *features; + /** Features in this feature list. May be NULL if featureCount is + zero. + + If present, this array must contain featureCount feature + structures for a Vamp API version 1 plugin, or 2*featureCount + feature unions for a Vamp API version 2 plugin. + + The features returned by an API version 2 plugin must consist + of the same feature structures as in API version 1 for the + first featureCount array elements, followed by featureCount + unions that contain VampFeatureV2 structures (or NULL pointers + if no V2 feature structures are present). + */ + VampFeatureUnion *features; } VampFeatureList; @@ -289,7 +331,7 @@ typedef struct _VampPluginDescriptor handle, or releaseOutputDescriptor for this descriptor. Host must call releaseOutputDescriptor after use. */ VampOutputDescriptor *(*getOutputDescriptor)(VampPluginHandle, - unsigned int); + unsigned int); /** Destroy a descriptor for a feature output. */ void (*releaseOutputDescriptor)(VampOutputDescriptor *); @@ -312,6 +354,7 @@ typedef struct _VampPluginDescriptor } VampPluginDescriptor; + /** Get the descriptor for a given plugin index in this library. Return NULL if the index is outside the range of valid indices for this plugin library. @@ -324,10 +367,16 @@ typedef struct _VampPluginDescriptor field for its actual compatibility level, the host should be able to do the right thing with it: use it if possible, discard it otherwise. + + This is the only symbol that a Vamp plugin actually needs to + export from its shared object; all others can be hidden. See the + accompanying documentation for notes on how to achieve this with + certain compilers. */ const VampPluginDescriptor *vampGetPluginDescriptor (unsigned int hostApiVersion, unsigned int index); + /** Function pointer type for vampGetPluginDescriptor. */ typedef const VampPluginDescriptor *(*VampGetPluginDescriptorFunction) (unsigned int, unsigned int); |