20 #ifndef __PIPEWIRE_PROTOCOL_H__ 21 #define __PIPEWIRE_PROTOCOL_H__ 27 #include <spa/utils/list.h> 35 #define PW_TYPE__Protocol "PipeWire:Protocol" 36 #define PW_TYPE_PROTOCOL_BASE PW_TYPE__Protocol ":" 51 #define pw_protocol_client_connect(c) ((c)->connect(c)) 52 #define pw_protocol_client_steal_fd(c) ((c)->steal_fd(c)) 53 #define pw_protocol_client_connect_fd(c,fd) ((c)->connect_fd(c,fd)) 54 #define pw_protocol_client_disconnect(c) ((c)->disconnect(c)) 55 #define pw_protocol_client_destroy(c) ((c)->destroy(c)) 66 #define pw_protocol_server_destroy(l) ((l)->destroy(l)) 80 #define PW_VERSION_PROTOCOL_IMPLEMENTATION 0 92 #define PW_VERSION_PROTOCOL_EVENTS 0 98 #define pw_protocol_new_client(p,...) (pw_protocol_get_implementation(p)->new_client(p,__VA_ARGS__)) 99 #define pw_protocol_add_server(p,...) (pw_protocol_get_implementation(p)->add_server(p,__VA_ARGS__)) 100 #define pw_protocol_ext(p,type,method,...) (((type*)pw_protocol_get_extension(p))->method( __VA_ARGS__)) 116 struct spa_hook *listener,
uint32_t version
version
Definition: protocol.h:70
Manages protocols and their implementation.
void(* disconnect)(struct pw_protocol_client *client)
Definition: protocol.h:47
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:37
Definition: protocol.h:79
Definition: protocol.h:68
uint32_t version
Definition: protocol.h:93
int(* steal_fd)(struct pw_protocol_client *client)
Definition: protocol.h:45
int pw_protocol_add_marshal(struct pw_protocol *protocol, const struct pw_protocol_marshal *marshal)
Definition: protocol.c:117
const char * type
interface type
Definition: protocol.h:69
uint32_t n_events
number of events in the interface
Definition: protocol.h:76
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:46
const void * pw_protocol_get_extension(struct pw_protocol *protocol)
Definition: protocol.c:77
void(* destroy)(struct pw_protocol_server *listen)
Definition: protocol.h:63
const struct pw_protocol_implementaton * pw_protocol_get_implementation(struct pw_protocol *protocol)
Definition: protocol.c:71
Represents a connection with a remote PipeWire instance.
struct spa_list link
link in protocol server_list
Definition: protocol.h:58
void(* destroy)(void *data)
Definition: protocol.h:95
Definition: protocol.h:57
const void * event_demarshal
Definition: protocol.h:75
uint32_t version
Definition: protocol.h:81
Definition: protocol.h:91
struct pw_remote * remote
the associated remote
Definition: protocol.h:42
void(* destroy)(struct pw_protocol_client *client)
Definition: protocol.h:48
struct spa_list link
link in protocol client_list
Definition: protocol.h:39
struct spa_list client_list
list of clients of this protocol
Definition: protocol.h:61
void * pw_protocol_get_user_data(struct pw_protocol *protocol)
Definition: protocol.c:65
const struct pw_protocol_marshal * pw_protocol_get_marshal(struct pw_protocol *protocol, uint32_t type)
Definition: protocol.c:138
struct pw_protocol * pw_core_find_protocol(struct pw_core *core, const char *name)
Definition: protocol.c:152
struct pw_protocol * protocol
the owner protocol
Definition: protocol.h:59
void pw_protocol_destroy(struct pw_protocol *protocol)
Definition: protocol.c:82
const void * event_marshal
Definition: protocol.h:74
uint32_t n_methods
number of methods in the interface
Definition: protocol.h:73
void pw_protocol_add_listener(struct pw_protocol *protocol, struct spa_hook *listener, const struct pw_protocol_events *events, void *data)
Definition: protocol.c:108
const void * method_demarshal
Definition: protocol.h:72
const void * method_marshal
Definition: protocol.h:71