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 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'lv2/lv2plug.in/ns/ext/buf-size/buf-size.h') 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 -- cgit v1.2.1