hooks: use hook to implement the callbacks

This way we get the version check implemented and save some
code.
This commit is contained in:
Wim Taymans 2019-05-15 11:19:23 +02:00
parent a78617c6a8
commit 6ee192dff5
26 changed files with 121 additions and 111 deletions

View file

@ -86,6 +86,17 @@ struct spa_monitor_callbacks {
int (*event) (void *data, struct spa_event *event);
};
#define spa_monitor_call(hook,method,version,...) \
({ \
int __res = 0; \
spa_hook_call_res(hook, struct spa_monitor_callbacks, __res, \
method, version, ##__VA_ARGS__); \
__res; \
})
#define spa_monitor_call_info(hook,i) spa_monitor_call(hook, info, 0, i)
#define spa_monitor_call_event(hook,e) spa_monitor_call(hook, event, 0, e)
/**
* spa_monitor:
*