mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
cleanups
Follow the data/size argument order convention to make the api more consistent.
This commit is contained in:
parent
7f931464e8
commit
5bebfe022b
50 changed files with 253 additions and 252 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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; \
|
||||
|
|
|
|||
|
|
@ -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
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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++) {
|
||||
|
|
|
|||
|
|
@ -204,12 +204,12 @@ static int impl_get_n_ports(struct spa_node *node,
|
|||
}
|
||||
|
||||
static int impl_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 (n_input_ports > 0)
|
||||
if (n_input_ids > 0)
|
||||
input_ids[0] = 0;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -120,12 +120,12 @@ static int impl_get_n_ports(struct spa_node *node,
|
|||
}
|
||||
|
||||
static int impl_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 (n_output_ports > 0)
|
||||
if (n_output_ids > 0)
|
||||
output_ids[0] = 0;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -199,12 +199,12 @@ static int impl_get_n_ports(struct spa_node *node,
|
|||
}
|
||||
|
||||
static int impl_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 (n_input_ports > 0)
|
||||
if (n_input_ids > 0)
|
||||
input_ids[0] = 0;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -246,7 +246,7 @@ on_stream_format_changed(void *_data, struct spa_pod *format)
|
|||
void *d;
|
||||
|
||||
if (format == NULL) {
|
||||
pw_stream_finish_format(stream, 0, 0, NULL);
|
||||
pw_stream_finish_format(stream, 0, NULL, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -254,7 +254,7 @@ on_stream_format_changed(void *_data, struct spa_pod *format)
|
|||
|
||||
sdl_format = id_to_sdl_format(data, data->format.format);
|
||||
if (sdl_format == SDL_PIXELFORMAT_UNKNOWN) {
|
||||
pw_stream_finish_format(stream, -EINVAL, 0, NULL);
|
||||
pw_stream_finish_format(stream, -EINVAL, NULL, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -279,7 +279,7 @@ on_stream_format_changed(void *_data, struct spa_pod *format)
|
|||
":", t->param_meta.type, "I", t->meta.Header,
|
||||
":", t->param_meta.size, "i", sizeof(struct spa_meta_header));
|
||||
|
||||
pw_stream_finish_format(stream, 0, 2, params);
|
||||
pw_stream_finish_format(stream, 0, params, 2);
|
||||
}
|
||||
|
||||
static const struct pw_stream_events stream_events = {
|
||||
|
|
@ -362,7 +362,7 @@ static void on_state_changed(void *_data, enum pw_remote_state old, enum pw_remo
|
|||
PW_DIRECTION_INPUT,
|
||||
data->path,
|
||||
PW_STREAM_FLAG_AUTOCONNECT | PW_STREAM_FLAG_INACTIVE,
|
||||
1, params);
|
||||
params, 1);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ on_stream_format_changed(void *_data, struct spa_pod *format)
|
|||
struct spa_pod *params[2];
|
||||
|
||||
if (format == NULL) {
|
||||
pw_stream_finish_format(stream, 0, 0, NULL);
|
||||
pw_stream_finish_format(stream, 0, NULL, 0);
|
||||
return;
|
||||
}
|
||||
spa_format_video_raw_parse(format, &data->format, &data->type.format_video);
|
||||
|
|
@ -196,7 +196,7 @@ on_stream_format_changed(void *_data, struct spa_pod *format)
|
|||
":", t->param_meta.type, "I", t->meta.Header,
|
||||
":", t->param_meta.size, "i", sizeof(struct spa_meta_header));
|
||||
|
||||
pw_stream_finish_format(stream, 0, 2, params);
|
||||
pw_stream_finish_format(stream, 0, params, 2);
|
||||
}
|
||||
|
||||
static const struct pw_stream_events stream_events = {
|
||||
|
|
@ -245,7 +245,7 @@ static void on_state_changed(void *_data, enum pw_remote_state old, enum pw_remo
|
|||
pw_stream_connect(data->stream,
|
||||
PW_DIRECTION_OUTPUT,
|
||||
NULL, PW_STREAM_FLAG_NONE,
|
||||
1, params);
|
||||
params, 1);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@ gst_pipewire_sink_class_init (GstPipeWireSinkClass * klass)
|
|||
process_mem_data_quark = g_quark_from_static_string ("GstPipeWireSinkProcessMemQuark");
|
||||
}
|
||||
|
||||
#define SPA_PROP_RANGE(min,max) 2,min,max
|
||||
#define PROP_RANGE(min,max) 2,min,max
|
||||
|
||||
static void
|
||||
pool_activated (GstPipeWirePool *pool, GstPipeWireSink *sink)
|
||||
|
|
@ -235,15 +235,15 @@ pool_activated (GstPipeWirePool *pool, GstPipeWireSink *sink)
|
|||
spa_pod_builder_push_object (&b, t->param.idBuffers, t->param_buffers.Buffers);
|
||||
if (size == 0)
|
||||
spa_pod_builder_add (&b,
|
||||
":", t->param_buffers.size, "iru", 0, SPA_PROP_RANGE(0, INT32_MAX), NULL);
|
||||
":", t->param_buffers.size, "iru", 0, PROP_RANGE(0, INT32_MAX), NULL);
|
||||
else
|
||||
spa_pod_builder_add (&b,
|
||||
":", t->param_buffers.size, "ir", size, SPA_PROP_RANGE(size, INT32_MAX), NULL);
|
||||
":", t->param_buffers.size, "ir", size, PROP_RANGE(size, INT32_MAX), NULL);
|
||||
|
||||
spa_pod_builder_add (&b,
|
||||
":", t->param_buffers.stride, "ir", 0, SPA_PROP_RANGE(0, INT32_MAX),
|
||||
":", t->param_buffers.stride, "ir", 0, PROP_RANGE(0, INT32_MAX),
|
||||
":", t->param_buffers.buffers, "iru", min_buffers,
|
||||
SPA_PROP_RANGE(min_buffers,
|
||||
PROP_RANGE(min_buffers,
|
||||
max_buffers ? max_buffers : INT32_MAX),
|
||||
":", t->param_buffers.align, "i", 16,
|
||||
NULL);
|
||||
|
|
@ -256,7 +256,7 @@ pool_activated (GstPipeWirePool *pool, GstPipeWireSink *sink)
|
|||
|
||||
|
||||
pw_thread_loop_lock (sink->main_loop);
|
||||
pw_stream_finish_format (sink->stream, 0, 2, port_params);
|
||||
pw_stream_finish_format (sink->stream, 0, port_params, 2);
|
||||
pw_thread_loop_unlock (sink->main_loop);
|
||||
}
|
||||
|
||||
|
|
@ -610,8 +610,8 @@ gst_pipewire_sink_setcaps (GstBaseSink * bsink, GstCaps * caps)
|
|||
PW_DIRECTION_OUTPUT,
|
||||
pwsink->path,
|
||||
flags,
|
||||
possible->len,
|
||||
(const struct spa_pod **) possible->pdata);
|
||||
(const struct spa_pod **) possible->pdata,
|
||||
possible->len);
|
||||
|
||||
while (TRUE) {
|
||||
state = pw_stream_get_state (pwsink->stream, &error);
|
||||
|
|
|
|||
|
|
@ -664,8 +664,8 @@ gst_pipewire_src_negotiate (GstBaseSrc * basesrc)
|
|||
PW_DIRECTION_INPUT,
|
||||
pwsrc->path,
|
||||
PW_STREAM_FLAG_AUTOCONNECT,
|
||||
possible->len,
|
||||
(const struct spa_pod **)possible->pdata);
|
||||
(const struct spa_pod **)possible->pdata,
|
||||
possible->len);
|
||||
g_ptr_array_free (possible, TRUE);
|
||||
|
||||
while (TRUE) {
|
||||
|
|
@ -738,7 +738,7 @@ on_format_changed (void *data,
|
|||
|
||||
if (format == NULL) {
|
||||
GST_DEBUG_OBJECT (pwsrc, "clear format");
|
||||
pw_stream_finish_format (pwsrc->stream, 0, 0, NULL);
|
||||
pw_stream_finish_format (pwsrc->stream, 0, NULL, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -766,10 +766,10 @@ on_format_changed (void *data,
|
|||
":", t->param_meta.size, "i", sizeof (struct spa_meta_header));
|
||||
|
||||
GST_DEBUG_OBJECT (pwsrc, "doing finish format");
|
||||
pw_stream_finish_format (pwsrc->stream, 0, 2, params);
|
||||
pw_stream_finish_format (pwsrc->stream, 0, params, 2);
|
||||
} else {
|
||||
GST_WARNING_OBJECT (pwsrc, "finish format with error");
|
||||
pw_stream_finish_format (pwsrc->stream, -EINVAL, 0, NULL);
|
||||
pw_stream_finish_format (pwsrc->stream, -EINVAL, NULL, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -278,10 +278,10 @@ spa_proxy_node_get_n_ports(struct spa_node *node,
|
|||
|
||||
static int
|
||||
spa_proxy_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 proxy *this;
|
||||
int c, i;
|
||||
|
|
@ -292,13 +292,13 @@ spa_proxy_node_get_port_ids(struct spa_node *node,
|
|||
this = SPA_CONTAINER_OF(node, struct proxy, node);
|
||||
|
||||
if (input_ids) {
|
||||
for (c = 0, i = 0; i < MAX_INPUTS && c < n_input_ports; i++) {
|
||||
for (c = 0, i = 0; i < MAX_INPUTS && c < n_input_ids; i++) {
|
||||
if (this->in_ports[i].valid)
|
||||
input_ids[c++] = i;
|
||||
}
|
||||
}
|
||||
if (output_ids) {
|
||||
for (c = 0, i = 0; i < MAX_OUTPUTS && c < n_output_ports; i++) {
|
||||
for (c = 0, i = 0; i < MAX_OUTPUTS && c < n_output_ids; i++) {
|
||||
if (this->out_ports[i].valid)
|
||||
output_ids[c++] = i;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -817,12 +817,12 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_client_node_
|
|||
const struct pw_protocol_marshal pw_protocol_native_client_node_marshal = {
|
||||
PW_TYPE_INTERFACE__ClientNode,
|
||||
PW_VERSION_CLIENT_NODE,
|
||||
PW_CLIENT_NODE_PROXY_METHOD_NUM,
|
||||
&pw_protocol_native_client_node_method_marshal,
|
||||
&pw_protocol_native_client_node_method_demarshal,
|
||||
PW_CLIENT_NODE_PROXY_EVENT_NUM,
|
||||
PW_CLIENT_NODE_PROXY_METHOD_NUM,
|
||||
&pw_protocol_native_client_node_event_marshal,
|
||||
pw_protocol_native_client_node_event_demarshal,
|
||||
PW_CLIENT_NODE_PROXY_EVENT_NUM,
|
||||
};
|
||||
|
||||
struct pw_protocol *pw_protocol_native_ext_client_node_init(struct pw_core *core)
|
||||
|
|
|
|||
|
|
@ -324,7 +324,7 @@ handle_register_port(struct client *client)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int do_add_node(struct spa_loop *loop, bool async, uint32_t seq, size_t size, const void *data,
|
||||
static int do_add_node(struct spa_loop *loop, bool async, uint32_t seq, const void *data, size_t size,
|
||||
void *user_data)
|
||||
{
|
||||
struct jack_client *jc = user_data;
|
||||
|
|
@ -333,7 +333,7 @@ static int do_add_node(struct spa_loop *loop, bool async, uint32_t seq, size_t s
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int do_remove_node(struct spa_loop *loop, bool async, uint32_t seq, size_t size, const void *data,
|
||||
static int do_remove_node(struct spa_loop *loop, bool async, uint32_t seq, const void *data, size_t size,
|
||||
void *user_data)
|
||||
{
|
||||
struct jack_client *jc = user_data;
|
||||
|
|
@ -380,7 +380,7 @@ handle_activate_client(struct client *client)
|
|||
jc->realtime = is_real_time;
|
||||
if (is_real_time)
|
||||
pw_loop_invoke(jc->node->node->data_loop,
|
||||
do_add_node, 0, 0, NULL, false, jc);
|
||||
do_add_node, 0, NULL, 0, false, jc);
|
||||
}
|
||||
|
||||
for (i = 0; (i < PORT_NUM_FOR_CLIENT) && (input_ports[i] != EMPTY); i++)
|
||||
|
|
@ -407,7 +407,7 @@ static int client_deactivate(struct impl *impl, int ref_num)
|
|||
jc->activated = false;
|
||||
if (jc->realtime)
|
||||
pw_loop_invoke(jc->node->node->data_loop,
|
||||
do_remove_node, 0, 0, NULL, false, jc);
|
||||
do_remove_node, 0, NULL, 0, false, jc);
|
||||
}
|
||||
|
||||
conn = jack_graph_manager_next_start(mgr);
|
||||
|
|
@ -1078,8 +1078,8 @@ static struct client *client_new(struct impl *impl, int fd)
|
|||
static int do_graph_order_changed(struct spa_loop *loop,
|
||||
bool async,
|
||||
uint32_t seq,
|
||||
size_t size,
|
||||
const void *data,
|
||||
size_t size,
|
||||
void *user_data)
|
||||
{
|
||||
struct impl *impl = user_data;
|
||||
|
|
@ -1118,7 +1118,7 @@ static void jack_node_pull(void *data)
|
|||
jack_graph_manager_try_switch(mgr, &res);
|
||||
if (res) {
|
||||
pw_loop_invoke(pw_core_get_main_loop(impl->core),
|
||||
do_graph_order_changed, 0, 0, NULL, false, impl);
|
||||
do_graph_order_changed, 0, NULL, 0, false, impl);
|
||||
}
|
||||
|
||||
/* mix all input */
|
||||
|
|
|
|||
|
|
@ -172,19 +172,19 @@ static int node_get_n_ports(struct spa_node *node,
|
|||
}
|
||||
|
||||
static int 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 node_data *nd = SPA_CONTAINER_OF(node, struct node_data, node_impl);
|
||||
int i, c;
|
||||
|
||||
for (c = i = 0; i < PORT_NUM_FOR_CLIENT && c < n_input_ports; i++) {
|
||||
for (c = i = 0; i < PORT_NUM_FOR_CLIENT && c < n_input_ids; i++) {
|
||||
if (nd->port_data[SPA_DIRECTION_INPUT][i])
|
||||
input_ids[c++] = nd->port_data[SPA_DIRECTION_INPUT][i]->port.port->port_id;
|
||||
}
|
||||
for (c = i = 0; i < PORT_NUM_FOR_CLIENT && c < n_output_ports; i++) {
|
||||
for (c = i = 0; i < PORT_NUM_FOR_CLIENT && c < n_output_ids; i++) {
|
||||
if (nd->port_data[SPA_DIRECTION_OUTPUT][i])
|
||||
output_ids[c++] = nd->port_data[SPA_DIRECTION_OUTPUT][i]->port.port->port_id;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -378,7 +378,7 @@ pw_protocol_native_connection_begin_resource(struct pw_protocol_native_connectio
|
|||
types[i] = spa_type_map_get_type(core->type.map, b);
|
||||
|
||||
client->n_types += diff;
|
||||
pw_core_resource_update_types(client->core_resource, base, diff, types);
|
||||
pw_core_resource_update_types(client->core_resource, base, types, diff);
|
||||
}
|
||||
|
||||
impl->dest_id = resource->id;
|
||||
|
|
@ -407,7 +407,7 @@ pw_protocol_native_connection_begin_proxy(struct pw_protocol_native_connection *
|
|||
types[i] = spa_type_map_get_type(core->type.map, b);
|
||||
|
||||
remote->n_types += diff;
|
||||
pw_core_proxy_update_types(remote->core_proxy, base, diff, types);
|
||||
pw_core_proxy_update_types(remote->core_proxy, base, types, diff);
|
||||
}
|
||||
|
||||
impl->dest_id = proxy->id;
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ core_marshal_create_link(void *object,
|
|||
}
|
||||
|
||||
static void
|
||||
core_marshal_update_types_client(void *object, uint32_t first_id, uint32_t n_types, const char **types)
|
||||
core_marshal_update_types_client(void *object, uint32_t first_id, const char **types, uint32_t n_types)
|
||||
{
|
||||
struct pw_proxy *proxy = object;
|
||||
struct spa_pod_builder *b;
|
||||
|
|
@ -272,7 +272,7 @@ static bool core_demarshal_update_types_client(void *object, void *data, size_t
|
|||
if (spa_pod_parser_get(&prs, "s", &types[i], NULL) < 0)
|
||||
return false;
|
||||
}
|
||||
pw_proxy_notify(proxy, struct pw_core_proxy_events, update_types, first_id, n_types, types);
|
||||
pw_proxy_notify(proxy, struct pw_core_proxy_events, update_types, first_id, types, n_types);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -353,7 +353,7 @@ static void core_marshal_remove_id(void *object, uint32_t id)
|
|||
}
|
||||
|
||||
static void
|
||||
core_marshal_update_types_server(void *object, uint32_t first_id, uint32_t n_types, const char **types)
|
||||
core_marshal_update_types_server(void *object, uint32_t first_id, const char **types, uint32_t n_types)
|
||||
{
|
||||
struct pw_resource *resource = object;
|
||||
struct spa_pod_builder *b;
|
||||
|
|
@ -516,7 +516,7 @@ static bool core_demarshal_update_types_server(void *object, void *data, size_t
|
|||
if (spa_pod_parser_get(&prs, "s", &types[i], NULL) < 0)
|
||||
return false;
|
||||
}
|
||||
pw_resource_do(resource, struct pw_core_proxy_methods, update_types, first_id, n_types, types);
|
||||
pw_resource_do(resource, struct pw_core_proxy_methods, update_types, first_id, types, n_types);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -993,12 +993,12 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_core_event_d
|
|||
static const struct pw_protocol_marshal pw_protocol_native_core_marshal = {
|
||||
PW_TYPE_INTERFACE__Core,
|
||||
PW_VERSION_CORE,
|
||||
PW_CORE_PROXY_METHOD_NUM,
|
||||
&pw_protocol_native_core_method_marshal,
|
||||
pw_protocol_native_core_method_demarshal,
|
||||
PW_CORE_PROXY_EVENT_NUM,
|
||||
PW_CORE_PROXY_METHOD_NUM,
|
||||
&pw_protocol_native_core_event_marshal,
|
||||
pw_protocol_native_core_event_demarshal
|
||||
pw_protocol_native_core_event_demarshal,
|
||||
PW_CORE_PROXY_EVENT_NUM
|
||||
};
|
||||
|
||||
static const struct pw_registry_proxy_methods pw_protocol_native_registry_method_marshal = {
|
||||
|
|
@ -1024,12 +1024,12 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_registry_eve
|
|||
const struct pw_protocol_marshal pw_protocol_native_registry_marshal = {
|
||||
PW_TYPE_INTERFACE__Registry,
|
||||
PW_VERSION_REGISTRY,
|
||||
PW_REGISTRY_PROXY_METHOD_NUM,
|
||||
&pw_protocol_native_registry_method_marshal,
|
||||
pw_protocol_native_registry_method_demarshal,
|
||||
PW_REGISTRY_PROXY_EVENT_NUM,
|
||||
PW_REGISTRY_PROXY_METHOD_NUM,
|
||||
&pw_protocol_native_registry_event_marshal,
|
||||
pw_protocol_native_registry_event_demarshal,
|
||||
PW_REGISTRY_PROXY_EVENT_NUM,
|
||||
};
|
||||
|
||||
static const struct pw_module_proxy_events pw_protocol_native_module_event_marshal = {
|
||||
|
|
@ -1044,10 +1044,10 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_module_event
|
|||
const struct pw_protocol_marshal pw_protocol_native_module_marshal = {
|
||||
PW_TYPE_INTERFACE__Module,
|
||||
PW_VERSION_MODULE,
|
||||
0, NULL, NULL,
|
||||
PW_MODULE_PROXY_EVENT_NUM,
|
||||
NULL, NULL, 0,
|
||||
&pw_protocol_native_module_event_marshal,
|
||||
pw_protocol_native_module_event_demarshal,
|
||||
PW_MODULE_PROXY_EVENT_NUM,
|
||||
};
|
||||
|
||||
static const struct pw_factory_proxy_events pw_protocol_native_factory_event_marshal = {
|
||||
|
|
@ -1062,10 +1062,10 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_factory_even
|
|||
const struct pw_protocol_marshal pw_protocol_native_factory_marshal = {
|
||||
PW_TYPE_INTERFACE__Factory,
|
||||
PW_VERSION_FACTORY,
|
||||
0, NULL, NULL,
|
||||
PW_FACTORY_PROXY_EVENT_NUM,
|
||||
NULL, NULL, 0,
|
||||
&pw_protocol_native_factory_event_marshal,
|
||||
pw_protocol_native_factory_event_demarshal,
|
||||
PW_FACTORY_PROXY_EVENT_NUM,
|
||||
};
|
||||
|
||||
static const struct pw_node_proxy_events pw_protocol_native_node_event_marshal = {
|
||||
|
|
@ -1080,10 +1080,10 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_node_event_d
|
|||
static const struct pw_protocol_marshal pw_protocol_native_node_marshal = {
|
||||
PW_TYPE_INTERFACE__Node,
|
||||
PW_VERSION_NODE,
|
||||
0, NULL, NULL,
|
||||
PW_NODE_PROXY_EVENT_NUM,
|
||||
NULL, NULL, 0,
|
||||
&pw_protocol_native_node_event_marshal,
|
||||
pw_protocol_native_node_event_demarshal,
|
||||
PW_NODE_PROXY_EVENT_NUM,
|
||||
};
|
||||
|
||||
static const struct pw_client_proxy_events pw_protocol_native_client_event_marshal = {
|
||||
|
|
@ -1098,10 +1098,10 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_client_event
|
|||
static const struct pw_protocol_marshal pw_protocol_native_client_marshal = {
|
||||
PW_TYPE_INTERFACE__Client,
|
||||
PW_VERSION_CLIENT,
|
||||
0, NULL, NULL,
|
||||
PW_CLIENT_PROXY_EVENT_NUM,
|
||||
NULL, NULL, 0,
|
||||
&pw_protocol_native_client_event_marshal,
|
||||
pw_protocol_native_client_event_demarshal,
|
||||
PW_CLIENT_PROXY_EVENT_NUM,
|
||||
};
|
||||
|
||||
static const struct pw_link_proxy_events pw_protocol_native_link_event_marshal = {
|
||||
|
|
@ -1116,10 +1116,10 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_link_event_d
|
|||
static const struct pw_protocol_marshal pw_protocol_native_link_marshal = {
|
||||
PW_TYPE_INTERFACE__Link,
|
||||
PW_VERSION_LINK,
|
||||
0, NULL, NULL,
|
||||
PW_LINK_PROXY_EVENT_NUM,
|
||||
NULL, NULL, 0,
|
||||
&pw_protocol_native_link_event_marshal,
|
||||
pw_protocol_native_link_event_demarshal,
|
||||
PW_LINK_PROXY_EVENT_NUM,
|
||||
};
|
||||
|
||||
void pw_protocol_native_init(struct pw_protocol *protocol)
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ static void update_monitor(struct pw_core *core, const char *name)
|
|||
const char *monitors;
|
||||
struct spa_dict_item item;
|
||||
const struct pw_properties *props;
|
||||
struct spa_dict dict = SPA_DICT_INIT(1, &item);
|
||||
struct spa_dict dict = SPA_DICT_INIT(&item, 1);
|
||||
|
||||
props = pw_core_get_properties(core);
|
||||
|
||||
|
|
|
|||
|
|
@ -310,7 +310,7 @@ core_create_link(void *object,
|
|||
|
||||
}
|
||||
|
||||
static void core_update_types(void *object, uint32_t first_id, uint32_t n_types, const char **types)
|
||||
static void core_update_types(void *object, uint32_t first_id, const char **types, uint32_t n_types)
|
||||
{
|
||||
struct pw_resource *resource = object;
|
||||
struct pw_core *this = resource->core;
|
||||
|
|
|
|||
|
|
@ -91,13 +91,13 @@ struct pw_core_proxy_methods {
|
|||
* Send a type map update to the PipeWire server. The server uses this
|
||||
* information to keep a mapping between client types and the server types.
|
||||
* \param first_id the id of the first type
|
||||
* \param n_types the number of types
|
||||
* \param types the types as a string
|
||||
* \param n_types the number of types
|
||||
*/
|
||||
void (*update_types) (void *object,
|
||||
uint32_t first_id,
|
||||
uint32_t n_types,
|
||||
const char **types);
|
||||
const char **types,
|
||||
uint32_t n_types);
|
||||
/**
|
||||
* Do server roundtrip
|
||||
*
|
||||
|
|
@ -161,9 +161,9 @@ struct pw_core_proxy_methods {
|
|||
};
|
||||
|
||||
static inline void
|
||||
pw_core_proxy_update_types(struct pw_core_proxy *core, uint32_t first_id, uint32_t n_types, const char **types)
|
||||
pw_core_proxy_update_types(struct pw_core_proxy *core, uint32_t first_id, const char **types, uint32_t n_types)
|
||||
{
|
||||
pw_proxy_do((struct pw_proxy*)core, struct pw_core_proxy_methods, update_types, first_id, n_types, types);
|
||||
pw_proxy_do((struct pw_proxy*)core, struct pw_core_proxy_methods, update_types, first_id, types, n_types);
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
|
@ -238,13 +238,13 @@ struct pw_core_proxy_events {
|
|||
* Send a type map update to the client. The client uses this
|
||||
* information to keep a mapping between server types and the client types.
|
||||
* \param first_id the id of the first type
|
||||
* \param n_types the number of types
|
||||
* \param types the types as a string
|
||||
* \param n_types the number of \a types
|
||||
*/
|
||||
void (*update_types) (void *object,
|
||||
uint32_t first_id,
|
||||
uint32_t n_types,
|
||||
const char **types);
|
||||
const char **types,
|
||||
uint32_t n_types);
|
||||
/**
|
||||
* Emit a done event
|
||||
*
|
||||
|
|
|
|||
|
|
@ -152,12 +152,12 @@ struct pw_node_info {
|
|||
const char *name; /**< name the node, suitable for display */
|
||||
uint32_t max_input_ports; /**< maximum number of inputs */
|
||||
uint32_t n_input_ports; /**< number of inputs */
|
||||
uint32_t n_input_params; /**< number of input params */
|
||||
struct spa_pod **input_params; /**< array of input params */
|
||||
uint32_t n_input_params; /**< number of input params */
|
||||
uint32_t max_output_ports; /**< maximum number of outputs */
|
||||
uint32_t n_output_ports; /**< number of outputs */
|
||||
uint32_t n_output_params; /**< number of output params */
|
||||
struct spa_pod **output_params; /**< array of output params */
|
||||
uint32_t n_output_params; /**< number of output params */
|
||||
enum pw_node_state state; /**< the current state of the node */
|
||||
const char *error; /**< an error reason if \a state is error */
|
||||
struct spa_dict *props; /**< the properties of the node */
|
||||
|
|
|
|||
|
|
@ -724,7 +724,7 @@ static int do_allocation(struct pw_link *this, uint32_t in_state, uint32_t out_s
|
|||
|
||||
static int
|
||||
do_activate_link(struct spa_loop *loop,
|
||||
bool async, uint32_t seq, size_t size, const void *data, void *user_data)
|
||||
bool async, uint32_t seq, const void *data, size_t size, void *user_data)
|
||||
{
|
||||
struct pw_link *this = user_data;
|
||||
spa_graph_port_link(&this->rt.out_port, &this->rt.in_port);
|
||||
|
|
@ -747,7 +747,7 @@ static int do_start(struct pw_link *this, uint32_t in_state, uint32_t out_state)
|
|||
output = this->output;
|
||||
|
||||
pw_loop_invoke(output->node->data_loop,
|
||||
do_activate_link, SPA_ID_INVALID, 0, NULL, false, this);
|
||||
do_activate_link, SPA_ID_INVALID, NULL, 0, false, this);
|
||||
|
||||
if (in_state == PW_PORT_STATE_PAUSED) {
|
||||
if ((res = pw_node_set_state(input->node, PW_NODE_STATE_RUNNING)) < 0) {
|
||||
|
|
@ -860,7 +860,7 @@ static void clear_port_buffers(struct pw_link *link, struct pw_port *port)
|
|||
|
||||
static int
|
||||
do_remove_input(struct spa_loop *loop,
|
||||
bool async, uint32_t seq, size_t size, const void *data, void *user_data)
|
||||
bool async, uint32_t seq, const void *data, size_t size, void *user_data)
|
||||
{
|
||||
struct pw_link *this = user_data;
|
||||
spa_graph_port_remove(&this->rt.in_port);
|
||||
|
|
@ -876,14 +876,14 @@ static void input_remove(struct pw_link *this, struct pw_port *port)
|
|||
spa_hook_remove(&impl->input_node_listener);
|
||||
|
||||
pw_loop_invoke(port->node->data_loop,
|
||||
do_remove_input, 1, 0, NULL, true, this);
|
||||
do_remove_input, 1, NULL, 0, true, this);
|
||||
|
||||
clear_port_buffers(this, this->input);
|
||||
}
|
||||
|
||||
static int
|
||||
do_remove_output(struct spa_loop *loop,
|
||||
bool async, uint32_t seq, size_t size, const void *data, void *user_data)
|
||||
bool async, uint32_t seq, const void *data, size_t size, void *user_data)
|
||||
{
|
||||
struct pw_link *this = user_data;
|
||||
spa_graph_port_remove(&this->rt.out_port);
|
||||
|
|
@ -899,7 +899,7 @@ static void output_remove(struct pw_link *this, struct pw_port *port)
|
|||
spa_hook_remove(&impl->output_node_listener);
|
||||
|
||||
pw_loop_invoke(port->node->data_loop,
|
||||
do_remove_output, 1, 0, NULL, true, this);
|
||||
do_remove_output, 1, NULL, 0, true, this);
|
||||
|
||||
clear_port_buffers(this, this->output);
|
||||
}
|
||||
|
|
@ -965,7 +965,7 @@ bool pw_link_activate(struct pw_link *this)
|
|||
|
||||
static int
|
||||
do_deactivate_link(struct spa_loop *loop,
|
||||
bool async, uint32_t seq, size_t size, const void *data, void *user_data)
|
||||
bool async, uint32_t seq, const void *data, size_t size, void *user_data)
|
||||
{
|
||||
struct pw_link *this = user_data;
|
||||
spa_graph_port_unlink(&this->rt.out_port);
|
||||
|
|
@ -983,7 +983,7 @@ bool pw_link_deactivate(struct pw_link *this)
|
|||
impl->active = false;
|
||||
pw_log_debug("link %p: deactivate", this);
|
||||
pw_loop_invoke(this->output->node->data_loop,
|
||||
do_deactivate_link, SPA_ID_INVALID, 0, NULL, true, this);
|
||||
do_deactivate_link, SPA_ID_INVALID, NULL, 0, true, this);
|
||||
|
||||
input_node = this->input->node;
|
||||
output_node = this->output->node;
|
||||
|
|
@ -1064,7 +1064,7 @@ link_bind_func(struct pw_global *global,
|
|||
|
||||
static int
|
||||
do_add_link(struct spa_loop *loop,
|
||||
bool async, uint32_t seq, size_t size, const void *data, void *user_data)
|
||||
bool async, uint32_t seq, const void *data, size_t size, void *user_data)
|
||||
{
|
||||
struct pw_link *this = user_data;
|
||||
struct pw_port *port = ((struct pw_port **) data)[0];
|
||||
|
|
@ -1193,9 +1193,9 @@ struct pw_link *pw_link_new(struct pw_core *core,
|
|||
|
||||
/* nodes can be in different data loops so we do this twice */
|
||||
pw_loop_invoke(output_node->data_loop, do_add_link,
|
||||
SPA_ID_INVALID, sizeof(struct pw_port *), &output, false, this);
|
||||
SPA_ID_INVALID, &output, sizeof(struct pw_port *), false, this);
|
||||
pw_loop_invoke(input_node->data_loop, do_add_link,
|
||||
SPA_ID_INVALID, sizeof(struct pw_port *), &input, false, this);
|
||||
SPA_ID_INVALID, &input, sizeof(struct pw_port *), false, this);
|
||||
|
||||
spa_hook_list_call(&output->listener_list, struct pw_port_events, link_added, this);
|
||||
spa_hook_list_call(&input->listener_list, struct pw_port_events, link_added, this);
|
||||
|
|
|
|||
|
|
@ -203,10 +203,10 @@ static int update_port_ids(struct pw_node *node)
|
|||
output_port_ids = alloca(sizeof(uint32_t) * n_output_ports);
|
||||
|
||||
res = spa_node_get_port_ids(node->node,
|
||||
max_input_ports,
|
||||
input_port_ids,
|
||||
max_output_ports,
|
||||
output_port_ids);
|
||||
max_input_ports,
|
||||
output_port_ids,
|
||||
max_output_ports);
|
||||
if (res < 0)
|
||||
return res;
|
||||
|
||||
|
|
@ -331,7 +331,7 @@ node_bind_func(struct pw_global *global,
|
|||
|
||||
static int
|
||||
do_node_add(struct spa_loop *loop,
|
||||
bool async, uint32_t seq, size_t size, const void *data, void *user_data)
|
||||
bool async, uint32_t seq, const void *data, size_t size, void *user_data)
|
||||
{
|
||||
struct pw_node *this = user_data;
|
||||
|
||||
|
|
@ -352,7 +352,7 @@ void pw_node_register(struct pw_node *this,
|
|||
update_port_ids(this);
|
||||
update_info(this);
|
||||
|
||||
pw_loop_invoke(this->data_loop, do_node_add, 1, 0, NULL, false, this);
|
||||
pw_loop_invoke(this->data_loop, do_node_add, 1, NULL, 0, false, this);
|
||||
|
||||
spa_list_append(&core->node_list, &this->link);
|
||||
this->global = pw_core_add_global(core, owner, parent,
|
||||
|
|
@ -552,7 +552,7 @@ void pw_node_add_listener(struct pw_node *node,
|
|||
|
||||
static int
|
||||
do_node_remove(struct spa_loop *loop,
|
||||
bool async, uint32_t seq, size_t size, const void *data, void *user_data)
|
||||
bool async, uint32_t seq, const void *data, size_t size, void *user_data)
|
||||
{
|
||||
struct pw_node *this = user_data;
|
||||
|
||||
|
|
@ -580,7 +580,7 @@ void pw_node_destroy(struct pw_node *node)
|
|||
pw_log_debug("node %p: destroy", impl);
|
||||
spa_hook_list_call(&node->listener_list, struct pw_node_events, destroy);
|
||||
|
||||
pw_loop_invoke(node->data_loop, do_node_remove, 1, 0, NULL, true, node);
|
||||
pw_loop_invoke(node->data_loop, do_node_remove, 1, NULL, 0, true, node);
|
||||
|
||||
if (node->global) {
|
||||
spa_list_remove(&node->link);
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@ void * pw_port_get_user_data(struct pw_port *port)
|
|||
}
|
||||
|
||||
static int do_add_port(struct spa_loop *loop,
|
||||
bool async, uint32_t seq, size_t size, const void *data, void *user_data)
|
||||
bool async, uint32_t seq, const void *data, size_t size, void *user_data)
|
||||
{
|
||||
struct pw_port *this = user_data;
|
||||
|
||||
|
|
@ -290,7 +290,7 @@ bool pw_port_add(struct pw_port *port, struct pw_node *node)
|
|||
spa_node_port_set_io(node->node, port->direction, port_id, port->rt.port.io);
|
||||
|
||||
port->rt.graph = node->rt.graph;
|
||||
pw_loop_invoke(node->data_loop, do_add_port, SPA_ID_INVALID, 0, NULL, false, port);
|
||||
pw_loop_invoke(node->data_loop, do_add_port, SPA_ID_INVALID, NULL, 0, false, port);
|
||||
|
||||
if (port->state <= PW_PORT_STATE_INIT)
|
||||
port_update_state(port, PW_PORT_STATE_CONFIGURE);
|
||||
|
|
@ -300,7 +300,7 @@ bool pw_port_add(struct pw_port *port, struct pw_node *node)
|
|||
}
|
||||
|
||||
static int do_remove_port(struct spa_loop *loop,
|
||||
bool async, uint32_t seq, size_t size, const void *data, void *user_data)
|
||||
bool async, uint32_t seq, const void *data, size_t size, void *user_data)
|
||||
{
|
||||
struct pw_port *this = user_data;
|
||||
struct spa_graph_port *p;
|
||||
|
|
@ -326,7 +326,7 @@ void pw_port_destroy(struct pw_port *port)
|
|||
spa_hook_list_call(&port->listener_list, struct pw_port_events, destroy);
|
||||
|
||||
if (node) {
|
||||
pw_loop_invoke(port->node->data_loop, do_remove_port, SPA_ID_INVALID, 0, NULL, true, port);
|
||||
pw_loop_invoke(port->node->data_loop, do_remove_port, SPA_ID_INVALID, NULL, 0, true, port);
|
||||
|
||||
if (port->direction == PW_DIRECTION_INPUT) {
|
||||
pw_map_remove(&node->input_port_map, port->port_id);
|
||||
|
|
@ -356,7 +356,7 @@ void pw_port_destroy(struct pw_port *port)
|
|||
|
||||
static int
|
||||
do_port_command(struct spa_loop *loop,
|
||||
bool async, uint32_t seq, size_t size, const void *data, void *user_data)
|
||||
bool async, uint32_t seq, const void *data, size_t size, void *user_data)
|
||||
{
|
||||
struct pw_port *port = user_data;
|
||||
struct pw_node *node = port->node;
|
||||
|
|
@ -366,7 +366,7 @@ do_port_command(struct spa_loop *loop,
|
|||
int pw_port_send_command(struct pw_port *port, bool block, const struct spa_command *command)
|
||||
{
|
||||
return pw_loop_invoke(port->node->data_loop, do_port_command, 0,
|
||||
SPA_POD_SIZE(command), command, block, port);
|
||||
command, SPA_POD_SIZE(command), block, port);
|
||||
}
|
||||
|
||||
int pw_port_pause(struct pw_port *port)
|
||||
|
|
|
|||
|
|
@ -66,12 +66,12 @@ struct pw_protocol_server {
|
|||
struct pw_protocol_marshal {
|
||||
const char *type; /**< interface type */
|
||||
uint32_t version; /**< version */
|
||||
uint32_t n_methods; /**< number of methods in the interface */
|
||||
const void *method_marshal;
|
||||
const void *method_demarshal;
|
||||
uint32_t n_events; /**< number of events in the interface */
|
||||
uint32_t n_methods; /**< number of methods in the interface */
|
||||
const void *event_marshal;
|
||||
const void *event_demarshal;
|
||||
uint32_t n_events; /**< number of events in the interface */
|
||||
};
|
||||
|
||||
struct pw_protocol_implementaton {
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ static void core_event_remove_id(void *data, uint32_t id)
|
|||
}
|
||||
|
||||
static void
|
||||
core_event_update_types(void *data, uint32_t first_id, uint32_t n_types, const char **types)
|
||||
core_event_update_types(void *data, uint32_t first_id, const char **types, uint32_t n_types)
|
||||
{
|
||||
struct pw_remote *this = data;
|
||||
int i;
|
||||
|
|
@ -428,7 +428,7 @@ void pw_remote_disconnect(struct pw_remote *remote)
|
|||
|
||||
static int
|
||||
do_remove_source(struct spa_loop *loop,
|
||||
bool async, uint32_t seq, size_t size, const void *data, void *user_data)
|
||||
bool async, uint32_t seq, const void *data, size_t size, void *user_data)
|
||||
{
|
||||
struct node_data *d = user_data;
|
||||
|
||||
|
|
@ -445,7 +445,7 @@ static void unhandle_socket(struct pw_proxy *proxy)
|
|||
struct node_data *data = proxy->user_data;
|
||||
|
||||
pw_loop_invoke(data->core->data_loop,
|
||||
do_remove_source, 1, 0, NULL, true, data);
|
||||
do_remove_source, 1, NULL, 0, true, data);
|
||||
}
|
||||
|
||||
static void handle_rtnode_message(struct pw_proxy *proxy, struct pw_client_node_message *message)
|
||||
|
|
|
|||
|
|
@ -278,7 +278,7 @@ void pw_stream_add_listener(struct pw_stream *stream,
|
|||
|
||||
static int
|
||||
do_remove_sources(struct spa_loop *loop,
|
||||
bool async, uint32_t seq, size_t size, const void *data, void *user_data)
|
||||
bool async, uint32_t seq, const void *data, size_t size, void *user_data)
|
||||
{
|
||||
struct stream *impl = user_data;
|
||||
struct pw_stream *stream = &impl->this;
|
||||
|
|
@ -303,7 +303,7 @@ static void unhandle_socket(struct pw_stream *stream)
|
|||
struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this);
|
||||
|
||||
pw_loop_invoke(stream->remote->core->data_loop,
|
||||
do_remove_sources, 1, 0, NULL, true, impl);
|
||||
do_remove_sources, 1, NULL, 0, true, impl);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -999,8 +999,8 @@ pw_stream_connect(struct pw_stream *stream,
|
|||
enum pw_direction direction,
|
||||
const char *port_path,
|
||||
enum pw_stream_flags flags,
|
||||
uint32_t n_params,
|
||||
const struct spa_pod **params)
|
||||
const struct spa_pod **params,
|
||||
uint32_t n_params)
|
||||
{
|
||||
struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this);
|
||||
|
||||
|
|
@ -1045,8 +1045,8 @@ pw_stream_get_node_id(struct pw_stream *stream)
|
|||
void
|
||||
pw_stream_finish_format(struct pw_stream *stream,
|
||||
int res,
|
||||
uint32_t n_params,
|
||||
struct spa_pod **params)
|
||||
struct spa_pod **params,
|
||||
uint32_t n_params)
|
||||
{
|
||||
struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this);
|
||||
|
||||
|
|
|
|||
|
|
@ -264,10 +264,10 @@ pw_stream_connect(struct pw_stream *stream, /**< a \ref pw_stream */
|
|||
const char *port_path, /**< the port path to connect to or NULL
|
||||
* to let the server choose a port */
|
||||
enum pw_stream_flags flags, /**< stream flags */
|
||||
uint32_t n_params, /**< number of items in \a params */
|
||||
const struct spa_pod **params /**< an array with params. The params
|
||||
const struct spa_pod **params, /**< an array with params. The params
|
||||
* should ideally contain supported
|
||||
* formats. */);
|
||||
* formats. */
|
||||
uint32_t n_params /**< number of items in \a params */);
|
||||
|
||||
/** Get the node ID of the stream. \memberof pw_stream
|
||||
* \return node ID. */
|
||||
|
|
@ -286,10 +286,10 @@ void pw_stream_disconnect(struct pw_stream *stream);
|
|||
void
|
||||
pw_stream_finish_format(struct pw_stream *stream, /**< a \ref pw_stream */
|
||||
int res, /**< a result code */
|
||||
uint32_t n_params, /**< number of elements in \a params */
|
||||
struct spa_pod **params /**< an array of params. The params should
|
||||
struct spa_pod **params, /**< an array of params. The params should
|
||||
* ideally contain parameters for doing
|
||||
* buffer allocation. */);
|
||||
* buffer allocation. */
|
||||
uint32_t n_params /**< number of elements in \a params */);
|
||||
|
||||
/** Activate or deactivate the stream \memberof pw_stream */
|
||||
void pw_stream_set_active(struct pw_stream *stream, bool active);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue