mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
Add user_data to callbacks
Add user data to callbacks, it's more flexible and natural
This commit is contained in:
parent
59ec32c039
commit
763bd1100e
27 changed files with 156 additions and 165 deletions
|
|
@ -88,6 +88,7 @@ struct impl {
|
|||
struct spa_log *log;
|
||||
|
||||
const struct spa_node_callbacks *callbacks;
|
||||
void *user_data;
|
||||
|
||||
int port_count;
|
||||
int port_queued;
|
||||
|
|
@ -152,7 +153,8 @@ 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)
|
||||
const struct spa_node_callbacks *callbacks,
|
||||
void *user_data)
|
||||
{
|
||||
struct impl *this;
|
||||
|
||||
|
|
@ -161,6 +163,7 @@ impl_node_set_callbacks(struct spa_node *node,
|
|||
this = SPA_CONTAINER_OF(node, struct impl, node);
|
||||
|
||||
this->callbacks = callbacks;
|
||||
this->user_data = user_data;
|
||||
|
||||
return SPA_RESULT_OK;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue