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 ":"
45 void (*done_callback) (
void *data,
int result),
53 #define pw_protocol_client_connect(c,cb,d) ((c)->connect(c,cb,d))
54 #define pw_protocol_client_connect_fd(c,fd,cl) ((c)->connect_fd(c,fd,cl))
55 #define pw_protocol_client_steal_fd(c) ((c)->steal_fd(c))
56 #define pw_protocol_client_disconnect(c) ((c)->disconnect(c))
57 #define pw_protocol_client_destroy(c) ((c)->destroy(c))
68 #define pw_protocol_server_destroy(l) ((l)->destroy(l))
82 #define PW_VERSION_PROTOCOL_IMPLEMENTATION 0
94 #define PW_VERSION_PROTOCOL_EVENTS 0
100 #define pw_protocol_new_client(p,...) (pw_protocol_get_implementation(p)->new_client(p,__VA_ARGS__))
101 #define pw_protocol_add_server(p,...) (pw_protocol_get_implementation(p)->add_server(p,__VA_ARGS__))
102 #define pw_protocol_ext(p,type,method,...) (((type*)pw_protocol_get_extension(p))->method( __VA_ARGS__))
118 struct spa_hook *listener,
uint32_t version
version
Definition: protocol.h:72
Manages protocols and their implementation.
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:38
Definition: protocol.h:81
Definition: protocol.h:70
int(* connect)(struct pw_protocol_client *client, void(*done_callback)(void *data, int result), void *data)
Definition: protocol.h:44
uint32_t version
Definition: protocol.h:95
void(* destroy)(struct pw_protocol_server *listen)
Definition: protocol.h:65
int pw_protocol_add_marshal(struct pw_protocol *protocol, const struct pw_protocol_marshal *marshal)
Definition: protocol.c:124
const char * type
interface type
Definition: protocol.h:71
uint32_t n_events
number of events in the interface
Definition: protocol.h:78
Definition: protocol.h:38
struct pw_protocol * protocol
the owner protocol
Definition: protocol.h:40
const void * pw_protocol_get_extension(struct pw_protocol *protocol)
Definition: protocol.c:81
const struct pw_protocol_implementaton * pw_protocol_get_implementation(struct pw_protocol *protocol)
Definition: protocol.c:74
int(* connect_fd)(struct pw_protocol_client *client, int fd, bool close)
Definition: protocol.h:47
Represents a connection with a remote PipeWire instance.
struct spa_list link
link in protocol server_list
Definition: protocol.h:60
Definition: protocol.h:59
const void * event_demarshal
Definition: protocol.h:77
uint32_t version
Definition: protocol.h:83
Definition: protocol.h:93
struct pw_remote * remote
the associated remote
Definition: protocol.h:42
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:63
void * pw_protocol_get_user_data(struct pw_protocol *protocol)
Definition: protocol.c:67
int(* steal_fd)(struct pw_protocol_client *client)
Definition: protocol.h:48
const struct pw_protocol_marshal * pw_protocol_get_marshal(struct pw_protocol *protocol, uint32_t type)
Definition: protocol.c:146
struct pw_protocol * pw_core_find_protocol(struct pw_core *core, const char *name)
Definition: protocol.c:161
struct pw_protocol * protocol
the owner protocol
Definition: protocol.h:61
void(* destroy)(void *data)
Definition: protocol.h:97
void pw_protocol_destroy(struct pw_protocol *protocol)
Definition: protocol.c:87
void(* destroy)(struct pw_protocol_client *client)
Definition: protocol.h:50
const void * event_marshal
Definition: protocol.h:76
void(* disconnect)(struct pw_protocol_client *client)
Definition: protocol.h:49
uint32_t n_methods
number of methods in the interface
Definition: protocol.h:75
void pw_protocol_add_listener(struct pw_protocol *protocol, struct spa_hook *listener, const struct pw_protocol_events *events, void *data)
Definition: protocol.c:114
const void * method_demarshal
Definition: protocol.h:74
const void * method_marshal
Definition: protocol.h:73