mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
hooks: enforce version on hook emission
Pass the minimum required version to the hook emission and only call events when the handler is recent enough. Add some macros to make event emission easier to read.
This commit is contained in:
parent
a72e3cefd7
commit
a63523650d
27 changed files with 250 additions and 155 deletions
|
|
@ -118,7 +118,7 @@ static void *connection_ensure_size(struct pw_protocol_native_connection *conn,
|
|||
buf->buffer_data = realloc(buf->buffer_data, buf->buffer_maxsize);
|
||||
if (buf->buffer_data == NULL) {
|
||||
buf->buffer_maxsize = 0;
|
||||
spa_hook_list_call(&conn->listener_list, struct pw_protocol_native_connection_events, error, -ENOMEM);
|
||||
spa_hook_list_call(&conn->listener_list, struct pw_protocol_native_connection_events, error, 0, -ENOMEM);
|
||||
return NULL;
|
||||
}
|
||||
pw_log_warn("connection %p: resize buffer to %zd %zd %zd",
|
||||
|
|
@ -241,7 +241,7 @@ void pw_protocol_native_connection_destroy(struct pw_protocol_native_connection
|
|||
|
||||
pw_log_debug("connection %p: destroy", conn);
|
||||
|
||||
spa_hook_list_call(&conn->listener_list, struct pw_protocol_native_connection_events, destroy);
|
||||
spa_hook_list_call(&conn->listener_list, struct pw_protocol_native_connection_events, destroy, 0);
|
||||
|
||||
free(impl->out.buffer_data);
|
||||
free(impl->in.buffer_data);
|
||||
|
|
@ -435,7 +435,7 @@ pw_protocol_native_connection_end(struct pw_protocol_native_connection *conn,
|
|||
spa_debug_pod((struct spa_pod *)p, 0);
|
||||
}
|
||||
spa_hook_list_call(&conn->listener_list,
|
||||
struct pw_protocol_native_connection_events, need_flush);
|
||||
struct pw_protocol_native_connection_events, need_flush, 0);
|
||||
}
|
||||
|
||||
/** Flush the connection object
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue