mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	hooks: use hook to implement the callbacks
This way we get the version check implemented and save some code.
This commit is contained in:
		
							parent
							
								
									a78617c6a8
								
							
						
					
					
						commit
						6ee192dff5
					
				
					 26 changed files with 121 additions and 111 deletions
				
			
		| 
						 | 
				
			
			@ -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:
 | 
			
		||||
 *
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue