20 #ifndef __PIPEWIRE_PROTOCOL_H__ 21 #define __PIPEWIRE_PROTOCOL_H__ 35 #define PW_TYPE__Protocol "PipeWire:Protocol" 36 #define PW_TYPE_PROTOCOL_BASE PW_TYPE__Protocol ":" 50 #define pw_protocol_client_connect(c) ((c)->connect(c)) 51 #define pw_protocol_client_connect_fd(c,fd) ((c)->connect_fd(c,fd)) 52 #define pw_protocol_client_disconnect(c) ((c)->disconnect(c)) 53 #define pw_protocol_client_destroy(c) ((c)->destroy(c)) 59 struct spa_list client_list;
64 #define pw_protocol_server_destroy(l) ((l)->destroy(l)) 78 #define PW_VERSION_PROTOCOL_IMPLEMENTATION 0 90 #define PW_VERSION_PROTOCOL_EVENTS 0 96 #define pw_protocol_new_client(p,...) (pw_protocol_get_implementation(p)->new_client(p,__VA_ARGS__)) 97 #define pw_protocol_add_server(p,...) (pw_protocol_get_implementation(p)->add_server(p,__VA_ARGS__)) 98 #define pw_protocol_ext(p,type,method,...) (((type*)pw_protocol_get_extension(p))->method( __VA_ARGS__)) 114 struct spa_hook *listener,
uint32_t version
version
Definition: protocol.h:68
Manages protocols and their implementation.
void(* disconnect)(struct pw_protocol_client *client)
Definition: protocol.h:46
A collection of key/value pairs.
Definition: properties.h:38
struct pw_protocol * pw_protocol_new(struct pw_core *core, const char *name, size_t user_data_size)
Definition: protocol.c:35
Definition: protocol.h:77
Definition: protocol.h:66
uint32_t version
Definition: protocol.h:91
const char * type
interface type
Definition: protocol.h:67
uint32_t n_events
number of events in the interface
Definition: protocol.h:72
Definition: protocol.h:38
int(* connect)(struct pw_protocol_client *client)
Definition: protocol.h:44
struct pw_protocol * protocol
the owner protocol
Definition: protocol.h:40
int(* connect_fd)(struct pw_protocol_client *client, int fd)
Definition: protocol.h:45
const void * pw_protocol_get_extension(struct pw_protocol *protocol)
Definition: protocol.c:72
const struct pw_protocol_implementaton * pw_protocol_get_implementation(struct pw_protocol *protocol)
Definition: protocol.c:66
Represents a connection with a remote PipeWire instance.
Definition: protocol.h:55
const void * event_demarshal
Definition: protocol.h:74
uint32_t version
Definition: protocol.h:79
Definition: protocol.h:89
struct pw_remote * remote
the associated remote
Definition: protocol.h:42
void(* destroy)(struct pw_protocol_client *client)
Definition: protocol.h:47
struct spa_list link
link in protocol client_list
Definition: protocol.h:39
void * pw_protocol_get_user_data(struct pw_protocol *protocol)
Definition: protocol.c:60
const struct pw_protocol_marshal * pw_protocol_get_marshal(struct pw_protocol *protocol, uint32_t type)
Definition: protocol.c:128
struct pw_protocol * pw_core_find_protocol(struct pw_core *core, const char *name)
Definition: protocol.c:142
struct pw_protocol * protocol
the owner protocol
Definition: protocol.h:57
void pw_protocol_destroy(struct pw_protocol *protocol)
Definition: protocol.c:77
const void * event_marshal
Definition: protocol.h:73
uint32_t n_methods
number of methods in the interface
Definition: protocol.h:69
void pw_protocol_add_marshal(struct pw_protocol *protocol, const struct pw_protocol_marshal *marshal)
Definition: protocol.c:112
void pw_protocol_add_listener(struct pw_protocol *protocol, struct spa_hook *listener, const struct pw_protocol_events *events, void *data)
Definition: protocol.c:103
const void * method_demarshal
Definition: protocol.h:71
const void * method_marshal
Definition: protocol.h:70