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:
Wim Taymans 2018-08-01 21:41:25 +02:00
parent a72e3cefd7
commit a63523650d
27 changed files with 250 additions and 155 deletions

View file

@ -113,6 +113,9 @@ struct spa_loop_control_hooks {
void (*after) (void *data);
};
#define spa_loop_control_hook_before(l) spa_hook_list_call(l, struct spa_loop_control_hooks, before, 0)
#define spa_loop_control_hook_after(l) spa_hook_list_call(l, struct spa_loop_control_hooks, after, 0)
/**
* Control an event loop
*/