Go to the documentation of this file.
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,
const void * pw_protocol_get_extension(struct pw_protocol *protocol)
Definition: protocol.c:81
uint32_t n_events
number of events in the interface
Definition: protocol.h:78
SPA_EXPORT void * pw_protocol_get_user_data(struct pw_protocol *protocol)
Definition: protocol.c:67
uint32_t version
Definition: protocol.h:95
Represents a connection with a remote PipeWire instance.
Definition: protocol.h:38
Manages protocols and their implementation.
const void * method_marshal
Definition: protocol.h:73
SPA_EXPORT const struct pw_protocol_implementaton * pw_protocol_get_implementation(struct pw_protocol *protocol)
Definition: protocol.c:74
SPA_EXPORT struct pw_protocol * pw_protocol_new(struct pw_core *core, const char *name, size_t user_data_size)
Definition: protocol.c:38
SPA_EXPORT const struct pw_protocol_marshal * pw_protocol_get_marshal(struct pw_protocol *protocol, uint32_t type)
Definition: protocol.c:146
struct pw_protocol * pw_protocol_new(struct pw_core *core, const char *name, size_t user_data_size)
Definition: protocol.c:38
int(* connect_fd)(struct pw_protocol_client *client, int fd, bool close)
Definition: protocol.h:47
void(* disconnect)(struct pw_protocol_client *client)
Definition: protocol.h:49
struct spa_list client_list
list of clients of this protocol
Definition: protocol.h:63
uint32_t version
Definition: protocol.h:83
struct pw_protocol * protocol
the owner protocol
Definition: protocol.h:40
SPA_EXPORT 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
void(* destroy)(struct pw_protocol_client *client)
Definition: protocol.h:50
const struct pw_protocol_implementaton * pw_protocol_get_implementation(struct pw_protocol *protocol)
Definition: protocol.c:74
#define pw_protocol_server_destroy(l)
Definition: protocol.h:68
void * pw_protocol_get_user_data(struct pw_protocol *protocol)
Definition: protocol.c:67
SPA_EXPORT int pw_protocol_add_marshal(struct pw_protocol *protocol, const struct pw_protocol_marshal *marshal)
Definition: protocol.c:124
Definition: protocol.h:59
const void * event_demarshal
Definition: protocol.h:77
void pw_protocol_destroy(struct pw_protocol *protocol)
Definition: protocol.c:87
struct pw_protocol * protocol
the owner protocol
Definition: protocol.h:61
uint32_t n_methods
number of methods in the interface
Definition: protocol.h:75
const SPA_EXPORT void * pw_protocol_get_extension(struct pw_protocol *protocol)
Definition: protocol.c:81
struct pw_protocol * pw_core_find_protocol(struct pw_core *core, const char *name)
Definition: protocol.c:161
void(* destroy)(struct pw_protocol_server *listen)
Definition: protocol.h:65
struct spa_list link
link in protocol client_list
Definition: protocol.h:39
SPA_EXPORT struct pw_protocol * pw_core_find_protocol(struct pw_core *core, const char *name)
Definition: protocol.c:161
struct spa_list link
link in protocol server_list
Definition: protocol.h:60
void(* destroy)(void *data)
Definition: protocol.h:97
const void * event_marshal
Definition: protocol.h:76
int pw_protocol_add_marshal(struct pw_protocol *protocol, const struct pw_protocol_marshal *marshal)
Definition: protocol.c:124
SPA_EXPORT void pw_protocol_destroy(struct pw_protocol *protocol)
Definition: protocol.c:87
Definition: protocol.h:93
struct pw_remote * remote
the associated remote
Definition: protocol.h:42
struct pw_control this
Definition: control.c:26
Definition: protocol.h:70
Definition: protocol.h:81
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
int(* connect)(struct pw_protocol_client *client, void(*done_callback)(void *data, int result), void *data)
Definition: protocol.h:44
const struct pw_protocol_marshal * pw_protocol_get_marshal(struct pw_protocol *protocol, uint32_t type)
Definition: protocol.c:146
#define pw_protocol_client_destroy(c)
Definition: protocol.h:57
const char * type
interface type
Definition: protocol.h:71
uint32_t version
version
Definition: protocol.h:72
int(* steal_fd)(struct pw_protocol_client *client)
Definition: protocol.h:48
const void * method_demarshal
Definition: protocol.h:74
void pw_log_debug(const char *format,...)
A collection of key/value pairs.
Definition: properties.h:38