From 1454463494ac7b7caa6c8db130192d5dc3fab34f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 8 Aug 2012 00:07:18 +0000 Subject: Make LV2_Buf_Size_Access::get_buf_size take a time parameter and thus actually be sufficient for allocating auxiliary buffers. Other minor improvements to buf-size extension. Bump version to 1.0.7. --- lv2/lv2plug.in/ns/ext/buf-size/buf-size.h | 23 +++++++++++++--------- .../ns/ext/buf-size/lv2-buf-size.doap.ttl | 4 ++-- lv2/lv2plug.in/ns/ext/buf-size/manifest.ttl | 2 +- 3 files changed, 17 insertions(+), 12 deletions(-) (limited to 'lv2/lv2plug.in/ns/ext') diff --git a/lv2/lv2plug.in/ns/ext/buf-size/buf-size.h b/lv2/lv2plug.in/ns/ext/buf-size/buf-size.h index 90b4d38..9a86e3d 100644 --- a/lv2/lv2plug.in/ns/ext/buf-size/buf-size.h +++ b/lv2/lv2plug.in/ns/ext/buf-size/buf-size.h @@ -17,7 +17,6 @@ #ifndef LV2_BUF_SIZE_H #define LV2_BUF_SIZE_H -#include #include #include "lv2/lv2plug.in/ns/ext/urid/urid.h" @@ -56,7 +55,7 @@ typedef struct { The host MUST set this to sizeof(LV2_Buf_Size_Feature). */ - size_t size; + uint32_t size; /** Get properties of the sample_count parameter of LV2_Descriptor::run(). @@ -80,17 +79,23 @@ typedef struct { /** Get the size for buffers of a given type. + This function is useful for plugins that need to allocate auxiliary + buffers for data types other than audio. A typical use case is to first + get the maximum block length with get_sample_count(), then determine the + space required for a Sequence by calling this function with type @ref + LV2_ATOM__Sequence. + @param handle The handle field of this struct. - @param type The type of buffer. This is deliberately loosely defined - and may be a port type or some other type (e.g. an Atom type). - @param subtype Additional type parameter. This may be needed for some - types, otherwise it may be set to zero. - @return The buffer size for the given type, in bytes. + @param buf_size Set to the requested buffer size, or 0 if unknown. + @param type The type of buffer. + @param sample_count The duration of time the buffer must represent. + @return The space required for the buffer, or 0 if unknown. */ - size_t + LV2_Buf_Size_Status (*get_buf_size)(LV2_Buf_Size_Access_Handle handle, + uint32_t* buf_size, LV2_URID type, - LV2_URID subtype); + uint32_t sample_count); } LV2_Buf_Size_Access; #ifdef __cplusplus diff --git a/lv2/lv2plug.in/ns/ext/buf-size/lv2-buf-size.doap.ttl b/lv2/lv2plug.in/ns/ext/buf-size/lv2-buf-size.doap.ttl index b9ffdc9..758d6f5 100644 --- a/lv2/lv2plug.in/ns/ext/buf-size/lv2-buf-size.doap.ttl +++ b/lv2/lv2plug.in/ns/ext/buf-size/lv2-buf-size.doap.ttl @@ -8,10 +8,10 @@ rdfs:seeAlso <../../meta/meta.ttl> ; doap:name "LV2 Buf Size Extension" ; doap:shortdesc "Access to, and restrictions on, buffer sizes." ; - doap:created "2012-05-25" ; + doap:created "2012-08-07" ; doap:developer ; doap:release [ - doap:revision "0.0" ; + doap:revision "0.1" ; dcs:blame ; dcs:changeset [ dcs:item [ diff --git a/lv2/lv2plug.in/ns/ext/buf-size/manifest.ttl b/lv2/lv2plug.in/ns/ext/buf-size/manifest.ttl index c68587c..44dd359 100644 --- a/lv2/lv2plug.in/ns/ext/buf-size/manifest.ttl +++ b/lv2/lv2plug.in/ns/ext/buf-size/manifest.ttl @@ -4,6 +4,6 @@ a lv2:Specification ; lv2:minorVersion 0 ; - lv2:microVersion 0 ; + lv2:microVersion 1 ; rdfs:seeAlso . -- cgit v1.2.1