mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-16 08:56:45 -05:00
Add versions to structures
Use versions instead of size Remove user_data from callbacks, we can simply pass the callback struct.
This commit is contained in:
parent
4a219e81dd
commit
c3b73ba47d
45 changed files with 344 additions and 303 deletions
|
|
@ -94,7 +94,7 @@ static int do_send_done(struct spa_loop *loop, bool async, uint32_t seq, size_t
|
|||
{
|
||||
struct state *this = user_data;
|
||||
|
||||
this->callbacks.done(&this->node, seq, *(int*)data, this->user_data);
|
||||
this->callbacks->done(this->callbacks, &this->node, seq, *(int*)data);
|
||||
|
||||
return SPA_RESULT_OK;
|
||||
}
|
||||
|
|
@ -168,7 +168,7 @@ static int impl_node_send_command(struct spa_node *node, struct spa_command *com
|
|||
|
||||
static int
|
||||
impl_node_set_callbacks(struct spa_node *node,
|
||||
const struct spa_node_callbacks *callbacks, size_t callbacks_size, void *user_data)
|
||||
const struct spa_node_callbacks *callbacks)
|
||||
{
|
||||
struct state *this;
|
||||
|
||||
|
|
@ -176,8 +176,7 @@ impl_node_set_callbacks(struct spa_node *node,
|
|||
|
||||
this = SPA_CONTAINER_OF(node, struct state, node);
|
||||
|
||||
this->callbacks = *callbacks;
|
||||
this->user_data = user_data;
|
||||
this->callbacks = callbacks;
|
||||
|
||||
return SPA_RESULT_OK;
|
||||
}
|
||||
|
|
@ -578,7 +577,7 @@ static int impl_node_process_output(struct spa_node *node)
|
|||
}
|
||||
|
||||
static const struct spa_node impl_node = {
|
||||
sizeof(struct spa_node),
|
||||
SPA_VERSION_NODE,
|
||||
NULL,
|
||||
impl_node_get_props,
|
||||
impl_node_set_props,
|
||||
|
|
@ -635,7 +634,7 @@ static int impl_clock_get_time(struct spa_clock *clock,
|
|||
}
|
||||
|
||||
static const struct spa_clock impl_clock = {
|
||||
sizeof(struct spa_clock),
|
||||
SPA_VERSION_CLOCK,
|
||||
NULL,
|
||||
SPA_CLOCK_STATE_STOPPED,
|
||||
impl_clock_get_props,
|
||||
|
|
@ -746,7 +745,9 @@ impl_enum_interface_info(const struct spa_handle_factory *factory,
|
|||
return SPA_RESULT_OK;
|
||||
}
|
||||
|
||||
const struct spa_handle_factory spa_alsa_source_factory = { NAME,
|
||||
const struct spa_handle_factory spa_alsa_source_factory = {
|
||||
SPA_VERSION_HANDLE_FACTORY,
|
||||
NAME,
|
||||
NULL,
|
||||
sizeof(struct state),
|
||||
impl_init,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue