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:
Wim Taymans 2019-05-15 12:17:52 +02:00
parent 6ee192dff5
commit 448c1937ad
28 changed files with 97 additions and 84 deletions

View file

@ -103,14 +103,14 @@ struct spa_graph_node {
struct spa_graph_state *state; /**< state of the node */
struct spa_graph_link graph_link; /**< link in graph */
struct spa_graph *subgraph; /**< subgraph or NULL */
struct spa_hook callbacks;
struct spa_callbacks callbacks;
struct spa_list sched_link; /**< link for scheduler */
};
#define spa_graph_node_call(n,method,version,...) \
({ \
int __res = 0; \
spa_hook_call_res(&(n)->callbacks, \
spa_callbacks_call_res(&(n)->callbacks, \
struct spa_graph_node_callbacks, __res, \
method, version, ##__VA_ARGS__); \
__res; \
@ -250,7 +250,7 @@ spa_graph_node_set_callbacks(struct spa_graph_node *node,
const struct spa_graph_node_callbacks *callbacks,
void *data)
{
node->callbacks = SPA_HOOK_INIT(callbacks, data);
node->callbacks = SPA_CALLBACKS_INIT(callbacks, data);
}
static inline void