buffer: remove buffer id

The buffer id is not needed/used, we use the index of the buffer in the
buffer array when configuring the port.
This commit is contained in:
Wim Taymans 2019-01-07 17:57:03 +01:00
parent e918f9f77c
commit 5b7ddb0105
33 changed files with 167 additions and 65 deletions

View file

@ -89,7 +89,7 @@ static inline int spa_buffer_alloc_fill_info(struct spa_buffer_alloc_info *info,
static inline struct spa_buffer *
spa_buffer_alloc_layout(struct spa_buffer_alloc_info *info,
void *skel_mem, void *data_mem, uint32_t id)
void *skel_mem, void *data_mem)
{
struct spa_buffer *b = skel_mem;
size_t size;
@ -97,7 +97,6 @@ spa_buffer_alloc_layout(struct spa_buffer_alloc_info *info,
void **dp, *skel, *data;
struct spa_chunk *cp;
b->id = id;
b->n_metas = info->n_metas;
b->metas = SPA_MEMBER(b, sizeof(struct spa_buffer), struct spa_meta);
b->n_datas = info->n_datas;
@ -154,9 +153,9 @@ spa_buffer_alloc_layout_array(struct spa_buffer_alloc_info *info,
uint32_t i;
size_t data_size = info->data_size + info->meta_size + info->chunk_size;
for (i = 0; i < n_buffers; i++) {
buffers[i] = spa_buffer_alloc_layout(info, skel_mem, data_mem, i);
skel_mem = SPA_MEMBER(skel_mem, info->skel_size, void);
data_mem = SPA_MEMBER(data_mem, data_size, void);
buffers[i] = spa_buffer_alloc_layout(info, skel_mem, data_mem);
skel_mem = SPA_MEMBER(skel_mem, info->skel_size, void);
data_mem = SPA_MEMBER(data_mem, data_size, void);
}
return 0;
}

View file

@ -71,11 +71,10 @@ struct spa_data {
/** A Buffer */
struct spa_buffer {
uint32_t id; /**< the id of this buffer */
struct spa_meta *metas; /**< array of metadata */
uint32_t n_metas; /**< number of metadata */
struct spa_data *datas; /**< array of data members */
uint32_t n_datas; /**< number of data members */
struct spa_meta *metas; /**< array of metadata */
struct spa_data *datas; /**< array of data members */
};
/** Find metadata in a buffer */

View file

@ -53,8 +53,8 @@ enum spa_meta_type {
*/
struct spa_meta {
uint32_t type; /**< metadata type, one of enum spa_meta_type */
void *data; /**< pointer to metadata */
uint32_t size; /**< size of metadata */
void *data; /**< pointer to metadata */
};
#define spa_meta_first(m) ((m)->data)