25 #ifndef PIPEWIRE_PROXY_H
26 #define PIPEWIRE_PROXY_H
112 #define PW_VERSION_PROXY_EVENTS 0
138 size_t user_data_size );
192 #define pw_proxy_notify(p,type,event,version,...) \
193 spa_hook_list_call(pw_proxy_get_object_listeners(p), \
194 type, event, version, ## __VA_ARGS__)
196 #define pw_proxy_call(p,type,method,version,...) \
197 spa_interface_call((struct spa_interface*)p, \
198 type, method, version, ##__VA_ARGS__)
200 #define pw_proxy_call_res(p,type,method,version,...) \
202 int _res = -ENOTSUP; \
203 spa_interface_call_res((struct spa_interface*)p, \
204 type, _res, method, version, ##__VA_ARGS__); \
static uint32_t int int const char * message
Definition: core.h:329
static uint32_t int int res
Definition: core.h:329
static uint32_t int seq
Definition: core.h:328
int pw_proxy_set_bound_id(struct pw_proxy *proxy, uint32_t global_id)
Set the global id this proxy is bound to.
Definition: proxy.c:158
void pw_proxy_add_listener(struct pw_proxy *proxy, struct spa_hook *listener, const struct pw_proxy_events *events, void *data)
Add an event listener to proxy.
Definition: proxy.c:195
const char * pw_proxy_get_type(struct pw_proxy *proxy, uint32_t *version)
Get the type and version of the proxy.
Definition: proxy.c:173
void pw_proxy_add_object_listener(struct pw_proxy *proxy, struct spa_hook *listener, const void *funcs, void *data)
Add a listener for the events received from the remote object.
Definition: proxy.c:204
struct pw_proxy * pw_proxy_new(struct pw_proxy *factory, const char *type, uint32_t version, size_t user_data_size)
Make a new proxy object.
Definition: proxy.c:89
const struct pw_protocol_marshal * pw_proxy_get_marshal(struct pw_proxy *proxy)
Get the marshal functions for the proxy.
Definition: proxy.c:356
int pw_proxy_error(struct pw_proxy *proxy, int res, const char *error)
Generate an error for a proxy.
Definition: proxy.c:338
uint32_t pw_proxy_get_bound_id(struct pw_proxy *proxy)
Get the global id bound to this proxy of SPA_ID_INVALID when not bound to a global.
Definition: proxy.c:167
int struct spa_hook_list * pw_proxy_get_object_listeners(struct pw_proxy *proxy)
Get the listener of proxy.
Definition: proxy.c:350
int pw_proxy_errorf(struct pw_proxy *proxy, int res, const char *error,...) SPA_PRINTF_FUNC(3
int pw_proxy_sync(struct pw_proxy *proxy, int seq)
Generate an sync method for a proxy.
Definition: proxy.c:310
struct pw_protocol * pw_proxy_get_protocol(struct pw_proxy *proxy)
Get the protocol used for the proxy.
Definition: proxy.c:187
uint32_t pw_proxy_get_id(struct pw_proxy *proxy)
Get the local id of the proxy.
Definition: proxy.c:152
void * pw_proxy_get_user_data(struct pw_proxy *proxy)
Get the user_data.
Definition: proxy.c:146
int pw_proxy_install_marshal(struct pw_proxy *proxy, bool implementor)
Install a marshal function on a proxy.
Definition: proxy.c:121
void pw_proxy_destroy(struct pw_proxy *proxy)
destroy a proxy
Definition: proxy.c:229
#define SPA_PRINTF_FUNC(fmt, arg1)
Definition: defs.h:203
Definition: protocol.h:90
Proxy events, use pw_proxy_add_listener.
Definition: proxy.h:111
void(* done)(void *data, int seq)
a reply to a sync method completed
Definition: proxy.h:126
uint32_t version
Definition: proxy.h:113
void(* removed)(void *data)
a proxy is removed from the server.
Definition: proxy.h:123
void(* bound)(void *data, uint32_t global_id)
a proxy is bound to a global id
Definition: proxy.h:119
void(* destroy)(void *data)
The proxy is destroyed.
Definition: proxy.h:116
void(* error)(void *data, int seq, int res, const char *message)
an error occurred on the proxy
Definition: proxy.h:129
A list of hooks.
Definition: hook.h:48
A hook, contains the structure with functions and the data passed to the functions.
Definition: hook.h:76