mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-16 08:56:45 -05:00
hook: separate spa_callbacks from the hook
Make a spa_callbacks with just the functions and data and use this in the hook and objects.
This commit is contained in:
parent
6ee192dff5
commit
448c1937ad
28 changed files with 97 additions and 84 deletions
|
|
@ -217,7 +217,7 @@ struct spa_bt_transport {
|
|||
void *user_data;
|
||||
|
||||
struct spa_hook_list listener_list;
|
||||
struct spa_hook impl;
|
||||
struct spa_callbacks impl;
|
||||
};
|
||||
|
||||
#define spa_bt_transport_emit(t,m,v,...) spa_hook_list_call(&(t)->listener_list, \
|
||||
|
|
@ -228,12 +228,12 @@ struct spa_bt_transport {
|
|||
spa_hook_list_append(&(t)->listener_list, listener, events, data)
|
||||
|
||||
#define spa_bt_transport_set_implementation(t,_impl,_data) \
|
||||
(t)->impl = SPA_HOOK_INIT(_impl, _data)
|
||||
(t)->impl = SPA_CALLBACKS_INIT(_impl, _data)
|
||||
|
||||
#define spa_bt_transport_impl(t,m,v,...) \
|
||||
({ \
|
||||
int res = 0; \
|
||||
spa_hook_call_res(&(t)->impl, struct spa_bt_transport_implementation, res, m, v, ##__VA_ARGS__); \
|
||||
spa_callbacks_call_res(&(t)->impl, struct spa_bt_transport_implementation, res, m, v, ##__VA_ARGS__); \
|
||||
res; \
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue