improve buffer import

Add generic pointer metadata type that is copied on import
Pass array of pointers to SpaBuffers in use_buffers.
Make sure we use the same data and metadata as the imported buffer.
This commit is contained in:
Wim Taymans 2016-07-11 17:45:54 +02:00
parent c5a31acf8c
commit 4c7cee6b28
10 changed files with 120 additions and 110 deletions

View file

@ -36,6 +36,7 @@ typedef struct _SpaBuffer SpaBuffer;
typedef enum {
SPA_META_TYPE_INVALID = 0,
SPA_META_TYPE_HEADER,
SPA_META_TYPE_POINTER,
} SpaMetaType;
/**
@ -66,6 +67,11 @@ typedef struct {
int64_t dts_offset;
} SpaMetaHeader;
typedef struct {
const char *type;
void *ptr;
} SpaMetaPointer;
/**
* SpaMeta:
* @type: metadata type
@ -118,7 +124,6 @@ typedef struct {
* @datas: array of @n_datas data pointers
*/
struct _SpaBuffer {
uint32_t id;
volatile int refcount;
SpaNotify notify;
size_t size;

View file

@ -316,7 +316,7 @@ struct _SpaNode {
SpaResult (*port_use_buffers) (SpaHandle *handle,
uint32_t port_id,
SpaBuffer *buffers,
SpaBuffer **buffers,
uint32_t n_buffers);
SpaResult (*port_alloc_buffers) (SpaHandle *handle,
uint32_t port_id,