Follow the data/size argument order convention to make the api
more consistent.
This commit is contained in:
Wim Taymans 2017-11-20 15:26:44 +01:00
parent 7f931464e8
commit 5bebfe022b
50 changed files with 253 additions and 252 deletions

View file

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

View file

@ -144,7 +144,7 @@ struct spa_monitor {
* first item and is updated with an opaque value that should be passed
* unmodified to get the next items.
*
* \param monito: a spa_monitor
* \param monitor a spa_monitor
* \param index state, use 0 for the first item
* \param item result item
* \param builder builder for \a item

View file

@ -272,18 +272,18 @@ struct spa_node {
* This function must be called from the main thread.
*
* \param node a #struct spa_node
* \param n_input_ports size of the \a input_ids array
* \param input_ids array to store the input stream ids
* \param n_output_ports size of the \a output_ids array
* \param n_input_ids size of the \a input_ids array
* \param output_ids array to store the output stream ids
* \param n_output_ids size of the \a output_ids array
* \return 0 on success
* -EINVAL when node is NULL
*/
int (*get_port_ids) (struct spa_node *node,
uint32_t n_input_ports,
uint32_t *input_ids,
uint32_t n_output_ports,
uint32_t *output_ids);
uint32_t n_input_ids,
uint32_t *output_ids,
uint32_t n_output_ids);
/**
* Make a new port with \a port_id. The caller should use get_port_ids() to

View file

@ -35,7 +35,8 @@ struct spa_pod_iter {
uint32_t offset;
};
static inline void spa_pod_iter_init(struct spa_pod_iter *iter, const void *data, uint32_t size, uint32_t offset)
static inline void spa_pod_iter_init(struct spa_pod_iter *iter,
const void *data, uint32_t size, uint32_t offset)
{
iter->data = data;
iter->size = size;

View file

@ -62,8 +62,8 @@ struct spa_source {
typedef int (*spa_invoke_func_t) (struct spa_loop *loop,
bool async,
uint32_t seq,
size_t size,
const void *data,
size_t size,
void *user_data);
/**
@ -89,8 +89,8 @@ struct spa_loop {
int (*invoke) (struct spa_loop *loop,
spa_invoke_func_t func,
uint32_t seq,
size_t size,
const void *data,
size_t size,
bool block,
void *user_data);
};

View file

@ -37,11 +37,11 @@ struct spa_dict_item {
};
struct spa_dict {
uint32_t n_items;
const struct spa_dict_item *items;
uint32_t n_items;
};
#define SPA_DICT_INIT(n_items,items) { n_items, items }
#define SPA_DICT_INIT(items,n_items) { items, n_items }
#define spa_dict_for_each(item, dict) \
for ((item) = (dict)->items; \

View file

@ -86,8 +86,8 @@ static inline int32_t spa_ringbuffer_get_read_index(struct spa_ringbuffer *rbuf,
*
* \param rbuf a #struct spa_ringbuffer
* \param buffer memory to read from
* \param size the size of \a memory
* \param offset offset in \a memory to read from
* \param size the size of \a buffer
* \param offset offset in \a buffer to read from
* \param data destination memory
* \param len number of bytes to read
*/
@ -136,8 +136,8 @@ static inline int32_t spa_ringbuffer_get_write_index(struct spa_ringbuffer *rbuf
*
* \param rbuf a spa_ringbuffer
* \param buffer memory to write to
* \param size the size of \a memory
* \param offset offset in \a memory to write to
* \param size the size of \a buffer
* \param offset offset in \a buffer to write to
* \param data source memory
* \param len number of bytes to write
*/

View file

@ -128,7 +128,7 @@ static int impl_node_set_param(struct spa_node *node, uint32_t id, uint32_t flag
return 0;
}
static int do_send_done(struct spa_loop *loop, bool async, uint32_t seq, size_t size, const void *data, void *user_data)
static int do_send_done(struct spa_loop *loop, bool async, uint32_t seq, const void *data, size_t size, void *user_data)
{
struct state *this = user_data;
@ -137,7 +137,7 @@ static int do_send_done(struct spa_loop *loop, bool async, uint32_t seq, size_t
return 0;
}
static int do_command(struct spa_loop *loop, bool async, uint32_t seq, size_t size, const void *data, void *user_data)
static int do_command(struct spa_loop *loop, bool async, uint32_t seq, const void *data, size_t size, void *user_data)
{
struct state *this = user_data;
int res;
@ -153,8 +153,8 @@ static int do_command(struct spa_loop *loop, bool async, uint32_t seq, size_t si
spa_loop_invoke(this->main_loop,
do_send_done,
seq,
sizeof(res),
&res,
sizeof(res),
false,
this);
}
@ -180,8 +180,8 @@ static int impl_node_send_command(struct spa_node *node, const struct spa_comman
return spa_loop_invoke(this->data_loop,
do_command,
++this->seq,
SPA_POD_SIZE(command),
command,
SPA_POD_SIZE(command),
false,
this);
@ -229,14 +229,14 @@ impl_node_get_n_ports(struct spa_node *node,
static int
impl_node_get_port_ids(struct spa_node *node,
uint32_t n_input_ports,
uint32_t *input_ids,
uint32_t n_output_ports,
uint32_t *output_ids)
uint32_t n_input_ids,
uint32_t *output_ids,
uint32_t n_output_ids)
{
spa_return_val_if_fail(node != NULL, -EINVAL);
if (n_input_ports > 0 && input_ids != NULL)
if (n_input_ids > 0 && input_ids != NULL)
input_ids[0] = 0;
return 0;
@ -600,8 +600,8 @@ static const struct spa_dict_item node_info_items[] = {
};
static const struct spa_dict node_info = {
SPA_N_ELEMENTS(node_info_items),
node_info_items
node_info_items,
SPA_N_ELEMENTS(node_info_items)
};
static const struct spa_node impl_node = {
@ -732,8 +732,8 @@ static const struct spa_dict_item info_items[] = {
};
static const struct spa_dict info = {
info_items,
SPA_N_ELEMENTS(info_items),
info_items
};
const struct spa_handle_factory spa_alsa_sink_factory = {

View file

@ -125,7 +125,7 @@ static int impl_node_set_param(struct spa_node *node, uint32_t id, uint32_t flag
return 0;
}
static int do_send_done(struct spa_loop *loop, bool async, uint32_t seq, size_t size, const void *data, void *user_data)
static int do_send_done(struct spa_loop *loop, bool async, uint32_t seq, const void *data, size_t size, void *user_data)
{
struct state *this = user_data;
@ -134,7 +134,7 @@ static int do_send_done(struct spa_loop *loop, bool async, uint32_t seq, size_t
return 0;
}
static int do_start(struct spa_loop *loop, bool async, uint32_t seq, size_t size, const void *data, void *user_data)
static int do_start(struct spa_loop *loop, bool async, uint32_t seq, const void *data, size_t size, void *user_data)
{
struct state *this = user_data;
int res;
@ -145,15 +145,15 @@ static int do_start(struct spa_loop *loop, bool async, uint32_t seq, size_t size
spa_loop_invoke(this->main_loop,
do_send_done,
seq,
sizeof(res),
&res,
sizeof(res),
false,
this);
}
return res;
}
static int do_pause(struct spa_loop *loop, bool async, uint32_t seq, size_t size, const void *data, void *user_data)
static int do_pause(struct spa_loop *loop, bool async, uint32_t seq, const void *data, size_t size, void *user_data)
{
struct state *this = user_data;
int res;
@ -164,8 +164,8 @@ static int do_pause(struct spa_loop *loop, bool async, uint32_t seq, size_t size
spa_loop_invoke(this->main_loop,
do_send_done,
seq,
sizeof(res),
&res,
sizeof(res),
false,
this);
}
@ -187,14 +187,14 @@ static int impl_node_send_command(struct spa_node *node, const struct spa_comman
if (this->n_buffers == 0)
return -EIO;
return spa_loop_invoke(this->data_loop, do_start, ++this->seq, 0, NULL, false, this);
return spa_loop_invoke(this->data_loop, do_start, ++this->seq, NULL, 0, false, this);
} else if (SPA_COMMAND_TYPE(command) == this->type.command_node.Pause) {
if (!this->have_format)
return -EIO;
if (this->n_buffers == 0)
return -EIO;
return spa_loop_invoke(this->data_loop, do_pause, ++this->seq, 0, NULL, false, this);
return spa_loop_invoke(this->data_loop, do_pause, ++this->seq, NULL, 0, false, this);
} else
return -ENOTSUP;
@ -241,14 +241,14 @@ impl_node_get_n_ports(struct spa_node *node,
static int
impl_node_get_port_ids(struct spa_node *node,
uint32_t n_input_ports,
uint32_t *input_ids,
uint32_t n_output_ports,
uint32_t *output_ids)
uint32_t n_input_ids,
uint32_t *output_ids,
uint32_t n_output_ids)
{
spa_return_val_if_fail(node != NULL, -EINVAL);
if (n_output_ports > 0 && output_ids != NULL)
if (n_output_ids > 0 && output_ids != NULL)
output_ids[0] = 0;
return 0;
@ -642,8 +642,8 @@ static const struct spa_dict_item node_info_items[] = {
};
static const struct spa_dict node_info = {
SPA_N_ELEMENTS(node_info_items),
node_info_items
node_info_items,
SPA_N_ELEMENTS(node_info_items)
};
static const struct spa_node impl_node = {
@ -823,8 +823,8 @@ static const struct spa_dict_item info_items[] = {
};
static const struct spa_dict info = {
SPA_N_ELEMENTS(info_items),
info_items
info_items,
SPA_N_ELEMENTS(info_items)
};
const struct spa_handle_factory spa_alsa_source_factory = {

View file

@ -688,8 +688,8 @@ int spa_alsa_start(struct state *state, bool xrun_recover)
static int do_remove_source(struct spa_loop *loop,
bool async,
uint32_t seq,
size_t size,
const void *data,
size_t size,
void *user_data)
{
struct state *state = user_data;
@ -706,7 +706,7 @@ int spa_alsa_pause(struct state *state, bool xrun_recover)
spa_log_trace(state->log, "alsa %p: pause", state);
spa_loop_invoke(state->data_loop, do_remove_source, 0, 0, NULL, true, state);
spa_loop_invoke(state->data_loop, do_remove_source, 0, NULL, 0, true, state);
if ((err = snd_pcm_drop(state->hndl)) < 0)
spa_log_error(state->log, "snd_pcm_drop %s", snd_strerror(err));

View file

@ -209,10 +209,10 @@ impl_node_get_n_ports(struct spa_node *node,
static int
impl_node_get_port_ids(struct spa_node *node,
uint32_t n_input_ports,
uint32_t *input_ids,
uint32_t n_output_ports,
uint32_t *output_ids)
uint32_t n_input_ids,
uint32_t *output_ids,
uint32_t n_output_ids)
{
struct impl *this;
int i, idx;
@ -222,12 +222,12 @@ impl_node_get_port_ids(struct spa_node *node,
this = SPA_CONTAINER_OF(node, struct impl, node);
if (input_ids) {
for (i = 0, idx = 0; i < this->last_port && idx < n_input_ports; i++) {
for (i = 0, idx = 0; i < this->last_port && idx < n_input_ids; i++) {
if (this->in_ports[i].valid)
input_ids[idx++] = i;
}
}
if (n_output_ports > 0 && output_ids)
if (n_output_ids > 0 && output_ids)
output_ids[0] = 0;
return 0;

View file

@ -462,14 +462,14 @@ impl_node_get_n_ports(struct spa_node *node,
static int
impl_node_get_port_ids(struct spa_node *node,
uint32_t n_input_ports,
uint32_t *input_ids,
uint32_t n_output_ports,
uint32_t *output_ids)
uint32_t n_input_ids,
uint32_t *output_ids,
uint32_t n_output_ids)
{
spa_return_val_if_fail(node != NULL, -EINVAL);
if (n_output_ports > 0 && output_ids != NULL)
if (n_output_ids > 0 && output_ids != NULL)
output_ids[0] = 0;
return 0;
@ -897,8 +897,8 @@ static const struct spa_dict_item node_info_items[] = {
};
static const struct spa_dict node_info = {
SPA_N_ELEMENTS(node_info_items),
node_info_items
node_info_items,
SPA_N_ELEMENTS(node_info_items)
};
static const struct spa_node impl_node = {
@ -1096,8 +1096,8 @@ static const struct spa_dict_item info_items[] = {
};
static const struct spa_dict info = {
SPA_N_ELEMENTS(info_items),
info_items
info_items,
SPA_N_ELEMENTS(info_items)
};
const struct spa_handle_factory spa_audiotestsrc_factory = {

View file

@ -161,17 +161,17 @@ spa_ffmpeg_dec_node_get_n_ports(struct spa_node *node,
static int
spa_ffmpeg_dec_node_get_port_ids(struct spa_node *node,
uint32_t n_input_ports,
uint32_t *input_ids,
uint32_t n_output_ports,
uint32_t *output_ids)
uint32_t n_input_ids,
uint32_t *output_ids,
uint32_t n_output_ids)
{
if (node == NULL)
return -EINVAL;
if (n_input_ports > 0 && input_ids != NULL)
if (n_input_ids > 0 && input_ids != NULL)
input_ids[0] = 0;
if (n_output_ports > 0 && output_ids != NULL)
if (n_output_ids > 0 && output_ids != NULL)
output_ids[0] = 0;
return 0;

View file

@ -164,17 +164,17 @@ spa_ffmpeg_enc_node_get_n_ports(struct spa_node *node,
static int
spa_ffmpeg_enc_node_get_port_ids(struct spa_node *node,
uint32_t n_input_ports,
uint32_t *input_ids,
uint32_t n_output_ports,
uint32_t *output_ids)
uint32_t n_input_ids,
uint32_t *output_ids,
uint32_t n_output_ids)
{
if (node == NULL)
return -EINVAL;
if (n_input_ports > 0 && input_ids != NULL)
if (n_input_ids > 0 && input_ids != NULL)
input_ids[0] = 0;
if (n_output_ports > 0 && output_ids != NULL)
if (n_output_ids > 0 && output_ids != NULL)
output_ids[0] = 0;
return 0;

View file

@ -46,8 +46,8 @@ struct invoke_item {
size_t item_size;
spa_invoke_func_t func;
uint32_t seq;
size_t size;
void *data;
size_t size;
bool block;
void *user_data;
int res;
@ -195,8 +195,8 @@ static int
loop_invoke(struct spa_loop *loop,
spa_invoke_func_t func,
uint32_t seq,
size_t size,
const void *data,
size_t size,
bool block,
void *user_data)
{
@ -206,7 +206,7 @@ loop_invoke(struct spa_loop *loop,
int res;
if (in_thread) {
res = func(loop, false, seq, size, data, user_data);
res = func(loop, false, seq, data, size, user_data);
} else {
int32_t filled, avail;
uint32_t idx, offset, l0;
@ -273,7 +273,7 @@ static void wakeup_func(void *data, uint64_t count)
while (spa_ringbuffer_get_read_index(&impl->buffer, &index) > 0) {
struct invoke_item *item =
SPA_MEMBER(impl->buffer_data, index & (DATAS_SIZE - 1), struct invoke_item);
item->res = item->func(&impl->loop, true, item->seq, item->size, item->data,
item->res = item->func(&impl->loop, true, item->seq, item->data, item->size,
item->user_data);
spa_ringbuffer_read_update(&impl->buffer, index + item->item_size);

View file

@ -385,14 +385,14 @@ impl_node_get_n_ports(struct spa_node *node,
static int
impl_node_get_port_ids(struct spa_node *node,
uint32_t n_input_ports,
uint32_t *input_ids,
uint32_t n_output_ports,
uint32_t *output_ids)
uint32_t n_input_ids,
uint32_t *output_ids,
uint32_t n_output_ids)
{
spa_return_val_if_fail(node != NULL, -EINVAL);
if (n_input_ports > 0 && input_ids != NULL)
if (n_input_ids > 0 && input_ids != NULL)
input_ids[0] = 0;
return 0;

View file

@ -401,14 +401,14 @@ impl_node_get_n_ports(struct spa_node *node,
static int
impl_node_get_port_ids(struct spa_node *node,
uint32_t n_input_ports,
uint32_t *input_ids,
uint32_t n_output_ports,
uint32_t *output_ids)
uint32_t n_input_ids,
uint32_t *output_ids,
uint32_t n_output_ids)
{
spa_return_val_if_fail(node != NULL, -EINVAL);
if (n_output_ports > 0 && output_ids != NULL)
if (n_output_ids > 0 && output_ids != NULL)
output_ids[0] = 0;
return 0;

View file

@ -251,8 +251,8 @@ static int impl_node_set_param(struct spa_node *node,
static int do_pause_done(struct spa_loop *loop,
bool async,
uint32_t seq,
size_t size,
const void *data,
size_t size,
void *user_data)
{
struct impl *this = user_data;
@ -269,8 +269,8 @@ static int do_pause_done(struct spa_loop *loop,
static int do_pause(struct spa_loop *loop,
bool async,
uint32_t seq,
size_t size,
const void *data,
size_t size,
void *user_data)
{
struct impl *this = user_data;
@ -283,8 +283,8 @@ static int do_pause(struct spa_loop *loop,
spa_loop_invoke(this->out_ports[0].main_loop,
do_pause_done,
seq,
sizeof(res),
&res,
sizeof(res),
false,
this);
}
@ -294,8 +294,8 @@ static int do_pause(struct spa_loop *loop,
static int do_start_done(struct spa_loop *loop,
bool async,
uint32_t seq,
size_t size,
const void *data,
size_t size,
void *user_data)
{
struct impl *this = user_data;
@ -309,8 +309,8 @@ static int do_start_done(struct spa_loop *loop,
static int do_start(struct spa_loop *loop,
bool async,
uint32_t seq,
size_t size,
const void *data,
size_t size,
void *user_data)
{
struct impl *this = user_data;
@ -323,8 +323,8 @@ static int do_start(struct spa_loop *loop,
spa_loop_invoke(this->out_ports[0].main_loop,
do_start_done,
seq,
sizeof(res),
&res,
sizeof(res),
false,
this);
}
@ -355,8 +355,8 @@ static int impl_node_send_command(struct spa_node *node, const struct spa_comman
return spa_loop_invoke(this->out_ports[0].data_loop,
do_start,
++this->seq,
SPA_POD_SIZE(command),
command,
SPA_POD_SIZE(command),
false,
this);
} else if (SPA_COMMAND_TYPE(command) == this->type.command_node.Pause) {
@ -370,8 +370,8 @@ static int impl_node_send_command(struct spa_node *node, const struct spa_comman
return spa_loop_invoke(this->out_ports[0].data_loop,
do_pause,
++this->seq,
SPA_POD_SIZE(command),
command,
SPA_POD_SIZE(command),
false,
this);
} else if (SPA_COMMAND_TYPE(command) == this->type.command_node.ClockUpdate) {
@ -418,14 +418,14 @@ impl_node_get_n_ports(struct spa_node *node,
}
static int impl_node_get_port_ids(struct spa_node *node,
uint32_t n_input_ports,
uint32_t *input_ids,
uint32_t n_output_ports,
uint32_t *output_ids)
uint32_t n_input_ids,
uint32_t *output_ids,
uint32_t n_output_ids)
{
spa_return_val_if_fail(node != NULL, -EINVAL);
if (n_output_ports > 0 && output_ids != NULL)
if (n_output_ids > 0 && output_ids != NULL)
output_ids[0] = 0;
return 0;
@ -854,8 +854,8 @@ static const struct spa_dict_item info_items[] = {
};
static const struct spa_dict info = {
SPA_N_ELEMENTS(info_items),
info_items
info_items,
SPA_N_ELEMENTS(info_items)
};
static const struct spa_node impl_node = {

View file

@ -411,14 +411,14 @@ impl_node_get_n_ports(struct spa_node *node,
static int
impl_node_get_port_ids(struct spa_node *node,
uint32_t n_input_ports,
uint32_t *input_ids,
uint32_t n_output_ports,
uint32_t *output_ids)
uint32_t n_input_ids,
uint32_t *output_ids,
uint32_t n_output_ids)
{
spa_return_val_if_fail(node != NULL, -EINVAL);
if (n_output_ports > 0 && output_ids != NULL)
if (n_output_ids > 0 && output_ids != NULL)
output_ids[0] = 0;
return 0;
@ -841,8 +841,8 @@ static const struct spa_dict_item node_info_items[] = {
};
static const struct spa_dict node_info = {
node_info_items,
SPA_N_ELEMENTS(node_info_items),
node_info_items
};
static const struct spa_node impl_node = {
@ -1040,8 +1040,8 @@ static const struct spa_dict_item info_items[] = {
};
static const struct spa_dict info = {
SPA_N_ELEMENTS(info_items),
info_items
info_items,
SPA_N_ELEMENTS(info_items)
};
const struct spa_handle_factory spa_videotestsrc_factory = {

View file

@ -277,16 +277,16 @@ impl_node_get_n_ports(struct spa_node *node,
static int
impl_node_get_port_ids(struct spa_node *node,
uint32_t n_input_ports,
uint32_t *input_ids,
uint32_t n_output_ports,
uint32_t *output_ids)
uint32_t n_input_ids,
uint32_t *output_ids,
uint32_t n_output_ids)
{
spa_return_val_if_fail(node != NULL, -EINVAL);
if (n_input_ports > 0 && input_ids)
if (n_input_ids > 0 && input_ids)
input_ids[0] = 0;
if (n_output_ports > 0 && output_ids)
if (n_output_ids > 0 && output_ids)
output_ids[0] = 0;
return 0;

View file

@ -151,10 +151,10 @@ init_buffer(struct data *data, struct spa_buffer **bufs, struct buffer *ba, int
bufs[i] = &b->buffer;
b->buffer.id = i;
b->buffer.n_metas = 1;
b->buffer.metas = b->metas;
b->buffer.n_datas = 1;
b->buffer.n_metas = 1;
b->buffer.datas = b->datas;
b->buffer.n_datas = 1;
b->header.flags = 0;
b->header.seq = 0;
@ -276,9 +276,9 @@ static void do_remove_source(struct spa_source *source)
static int
do_invoke(struct spa_loop *loop,
spa_invoke_func_t func, uint32_t seq, size_t size, const void *data, bool block, void *user_data)
spa_invoke_func_t func, uint32_t seq, const void *data, size_t size, bool block, void *user_data)
{
return func(loop, false, seq, size, data, user_data);
return func(loop, false, seq, data, size, user_data);
}
static int make_nodes(struct data *data, const char *device)

View file

@ -162,10 +162,10 @@ init_buffer(struct data *data, struct spa_buffer **bufs, struct buffer *ba, int
bufs[i] = &b->buffer;
b->buffer.id = i;
b->buffer.n_metas = 1;
b->buffer.metas = b->metas;
b->buffer.n_datas = 1;
b->buffer.n_metas = 1;
b->buffer.datas = b->datas;
b->buffer.n_datas = 1;
b->header.flags = 0;
b->header.seq = 0;
@ -320,9 +320,9 @@ static void do_remove_source(struct spa_source *source)
static int
do_invoke(struct spa_loop *loop,
spa_invoke_func_t func, uint32_t seq, size_t size, const void *data, bool block, void *user_data)
spa_invoke_func_t func, uint32_t seq, const void *data, size_t size, bool block, void *user_data)
{
return func(loop, false, seq, size, data, user_data);
return func(loop, false, seq, data, size, user_data);
}
static int make_nodes(struct data *data, const char *device)

View file

@ -147,10 +147,10 @@ init_buffer(struct data *data, struct spa_buffer **bufs, struct buffer *ba, int
bufs[i] = &b->buffer;
b->buffer.id = i;
b->buffer.n_metas = 1;
b->buffer.metas = b->metas;
b->buffer.n_datas = 1;
b->buffer.n_metas = 1;
b->buffer.datas = b->datas;
b->buffer.n_datas = 1;
b->header.flags = 0;
b->header.seq = 0;
@ -330,9 +330,9 @@ static void do_remove_source(struct spa_source *source)
static int
do_invoke(struct spa_loop *loop,
spa_invoke_func_t func, uint32_t seq, size_t size, const void *data, bool block, void *user_data)
spa_invoke_func_t func, uint32_t seq, const void *data, size_t size, bool block, void *user_data)
{
return func(loop, false, seq, size, data, user_data);
return func(loop, false, seq, data, size, user_data);
}
static int make_nodes(struct data *data)

View file

@ -83,7 +83,7 @@ static inline void init_type(struct type *type, struct spa_type_map *map)
struct buffer {
struct spa_buffer buffer;
struct spa_meta metas[2];
struct spa_meta metas[1];
struct spa_meta_header header;
struct spa_data datas[1];
struct spa_chunk chunks[1];
@ -129,10 +129,10 @@ init_buffer(struct data *data, struct spa_buffer **bufs, struct buffer *ba, int
bufs[i] = &b->buffer;
b->buffer.id = i;
b->buffer.n_metas = 2;
b->buffer.metas = b->metas;
b->buffer.n_datas = 1;
b->buffer.n_metas = 1;
b->buffer.datas = b->datas;
b->buffer.n_datas = 1;
b->header.flags = 0;
b->header.seq = 0;
@ -262,9 +262,9 @@ static void do_remove_source(struct spa_source *source)
static int
do_invoke(struct spa_loop *loop,
spa_invoke_func_t func, uint32_t seq, size_t size, const void *data, bool block, void *user_data)
spa_invoke_func_t func, uint32_t seq, const void *data, size_t size, bool block, void *user_data)
{
return func(loop, false, seq, size, data, user_data);
return func(loop, false, seq, data, size, user_data);
}
static int make_nodes(struct data *data, const char *device)

View file

@ -305,9 +305,9 @@ static void do_remove_source(struct spa_source *source)
static int
do_invoke(struct spa_loop *loop,
spa_invoke_func_t func, uint32_t seq, size_t size, const void *data, bool block, void *user_data)
spa_invoke_func_t func, uint32_t seq, const void *data, size_t size, bool block, void *user_data)
{
return func(loop, false, seq, size, data, user_data);
return func(loop, false, seq, data, size, user_data);
}
static int make_nodes(struct data *data, const char *device)
@ -349,10 +349,10 @@ static int setup_buffers(struct data *data)
b->texture = NULL;
b->buffer.id = i;
b->buffer.n_metas = 1;
b->buffer.metas = b->metas;
b->buffer.n_datas = 1;
b->buffer.n_metas = 1;
b->buffer.datas = b->datas;
b->buffer.n_datas = 1;
b->header.flags = 0;
b->header.seq = 0;

View file

@ -169,7 +169,7 @@ static void inspect_node(struct data *data, struct spa_node *node)
in_ports = alloca(n_input * sizeof(uint32_t));
out_ports = alloca(n_output * sizeof(uint32_t));
if ((res = spa_node_get_port_ids(node, n_input, in_ports, n_output, out_ports)) < 0)
if ((res = spa_node_get_port_ids(node, in_ports, n_input, out_ports, n_output)) < 0)
printf("can't get port ids: %d\n", res);
for (i = 0; i < n_input; i++) {