aboutsummaryrefslogtreecommitdiffstats
path: root/lv2
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-08-08 00:07:18 +0000
committerDavid Robillard <d@drobilla.net>2012-08-08 00:07:18 +0000
commit1454463494ac7b7caa6c8db130192d5dc3fab34f (patch)
tree478ce3546a37bf28c24b80d3280872f328c41cff /lv2
parent0a0dac8162f963586d4d78fb0c4d7dc613047049 (diff)
downloadlv2-1454463494ac7b7caa6c8db130192d5dc3fab34f.tar.xz
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.
Diffstat (limited to 'lv2')
-rw-r--r--lv2/lv2plug.in/ns/ext/buf-size/buf-size.h23
-rw-r--r--lv2/lv2plug.in/ns/ext/buf-size/lv2-buf-size.doap.ttl4
-rw-r--r--lv2/lv2plug.in/ns/ext/buf-size/manifest.ttl2
3 files changed, 17 insertions, 12 deletions
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 <stddef.h>
#include <stdint.h>
#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 <http://drobilla.net/drobilla#me> ;
doap:release [
- doap:revision "0.0" ;
+ doap:revision "0.1" ;
dcs:blame <http://drobilla.net/drobilla#me> ;
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 @@
<http://lv2plug.in/ns/ext/buf-size>
a lv2:Specification ;
lv2:minorVersion 0 ;
- lv2:microVersion 0 ;
+ lv2:microVersion 1 ;
rdfs:seeAlso <buf-size.ttl> .