mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-12 13:30:15 -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
|
|
@ -182,6 +182,7 @@ struct spa_node_events {
|
|||
*/
|
||||
struct spa_node_callbacks {
|
||||
#define SPA_VERSION_NODE_CALLBACKS 0
|
||||
uint32_t version;
|
||||
/**
|
||||
* \param node a spa_node
|
||||
*
|
||||
|
|
@ -207,6 +208,18 @@ struct spa_node_callbacks {
|
|||
uint32_t buffer_id);
|
||||
};
|
||||
|
||||
#define spa_node_call(hook,method,version,...) \
|
||||
({ \
|
||||
int __res = 0; \
|
||||
spa_hook_call_res(hook, struct spa_node_callbacks, __res, \
|
||||
method, version, ##__VA_ARGS__); \
|
||||
__res; \
|
||||
})
|
||||
|
||||
#define spa_node_call_ready(hook,s) spa_node_call(hook, ready, 0, s)
|
||||
#define spa_node_call_reuse_buffer(hook,p,b) spa_node_call(hook, reuse_buffer, 0, p, b)
|
||||
|
||||
|
||||
/** flags that can be passed to set_param and port_set_param functions */
|
||||
#define SPA_NODE_PARAM_FLAG_TEST_ONLY (1 << 0) /* just check if the param is accepted */
|
||||
#define SPA_NODE_PARAM_FLAG_FIXATE (1 << 1) /* fixate the non-optional unset fields */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue