Go to the documentation of this file.
25 #ifndef PIPEWIRE_PROTOCOL_H
26 #define PIPEWIRE_PROTOCOL_H
50 #define PW_TYPE_INFO_Protocol "PipeWire:Protocol"
51 #define PW_TYPE_INFO_PROTOCOL_BASE PW_TYPE_INFO_Protocol ":"
61 void (*done_callback) (
void *
data,
int result),
70 #define pw_protocol_client_connect(c,p,cb,d) ((c)->connect(c,p,cb,d))
71 #define pw_protocol_client_connect_fd(c,fd,cl) ((c)->connect_fd(c,fd,cl))
72 #define pw_protocol_client_steal_fd(c) ((c)->steal_fd(c))
73 #define pw_protocol_client_disconnect(c) ((c)->disconnect(c))
74 #define pw_protocol_client_destroy(c) ((c)->destroy(c))
75 #define pw_protocol_client_set_paused(c,p) ((c)->set_paused(c,p))
88 #define pw_protocol_server_destroy(l) ((l)->destroy(l))
93 #define PW_PROTOCOL_MARSHAL_FLAG_IMPL (1 << 0)
95 uint32_t n_client_methods;
96 uint32_t n_server_methods;
97 const void *client_marshal;
104 #define PW_VERSION_PROTOCOL_IMPLEMENTATION 0
108 struct pw_core *core,
111 struct pw_impl_core *core,
116 #define PW_VERSION_PROTOCOL_EVENTS 0
122 #define pw_protocol_new_client(p,...) (pw_protocol_get_implementation(p)->new_client(p,__VA_ARGS__))
123 #define pw_protocol_add_server(p,...) (pw_protocol_get_implementation(p)->add_server(p,__VA_ARGS__))
124 #define pw_protocol_ext(p,type,method,...) (((type*)pw_protocol_get_extension(p))->method( __VA_ARGS__))
126 struct pw_protocol *
pw_protocol_new(
struct pw_context *context,
const char *
name,
size_t user_data_size);
Definition: module-filter-chain.c:170
struct pw_core * core
Definition: protocol.h:57
uint32_t version
Definition: protocol.h:117
Definition: protocol.h:53
uint32_t flags
version
Definition: protocol.h:94
user data to add to an object
Definition: filter.c:75
bool spa_streq(const char *s1, const char *s2)
Definition: string.h:50
void pw_protocol_destroy(struct pw_protocol *protocol)
Definition: protocol.c:103
#define spa_list_for_each(pos, head, member)
Definition: list.h:111
int pw_protocol_add_marshal(struct pw_protocol *protocol, const struct pw_protocol_marshal *marshal)
Definition: protocol.c:142
#define SPA_EXPORT
Definition: defs.h:208
const struct pw_protocol_implementation * pw_protocol_get_implementation(struct pw_protocol *protocol)
Definition: protocol.c:90
#define pw_protocol_client_destroy(c)
Definition: protocol.h:74
#define NAME
Definition: protocol.c:34
void spa_hook_list_append(struct spa_hook_list *list, struct spa_hook *hook, const void *funcs, void *data)
Append a hook.
Definition: hook.h:316
#define SPA_PTROFF(ptr_, offset_, type_)
Return the address (buffer + offset) as pointer of type.
Definition: defs.h:159
struct pw_context * pw_protocol_get_context(struct pw_protocol *protocol)
Definition: protocol.c:77
#define SPA_CONTAINER_OF(p, t, m)
Definition: defs.h:170
int(* connect_fd)(struct pw_protocol_client *client, int fd, bool close)
Definition: protocol.h:63
#define spa_list_consume(pos, head, member)
Definition: list.h:96
struct pw_impl_core * core
Definition: protocol.h:81
void(* disconnect)(struct pw_protocol_client *client)
Definition: protocol.h:65
struct spa_list client_list
list of clients of this protocol
Definition: protocol.h:83
struct pw_protocol * protocol
the owner protocol
Definition: protocol.h:55
void spa_list_remove(struct spa_list *elem)
Definition: list.h:69
void pw_protocol_add_listener(struct pw_protocol *protocol, struct spa_hook *listener, const struct pw_protocol_events *events, void *data)
Definition: protocol.c:132
void(* destroy)(struct pw_protocol_client *client)
Definition: protocol.h:66
A hook, contains the structure with functions and the data passed to the functions.
Definition: hook.h:295
Definition: protocol.h:103
Definition: protocol.h:77
void spa_list_init(struct spa_list *list)
Definition: list.h:44
#define spa_list_for_each_safe(pos, tmp, head, member)
Definition: list.h:129
const struct pw_protocol_marshal * pw_protocol_get_marshal(struct pw_protocol *protocol, const char *type, uint32_t version, uint32_t flags)
Definition: protocol.c:163
Definition: utils/dict.h:48
struct pw_protocol * pw_context_find_protocol(struct pw_context *context, const char *name)
Definition: protocol.c:179
struct pw_protocol * protocol
the owner protocol
Definition: protocol.h:79
void * pw_protocol_get_user_data(struct pw_protocol *protocol)
Definition: protocol.c:83
void(* destroy)(struct pw_protocol_server *listen)
Definition: protocol.h:85
const void * client_demarshal
Definition: protocol.h:100
#define pw_log_debug(...)
Definition: src/pipewire/log.h:89
Definition: module-protocol-native.c:103
int(* set_paused)(struct pw_protocol_client *client, bool paused)
Definition: protocol.h:67
uint32_t version
Definition: protocol.h:105
const void * server_demarshal
Definition: protocol.h:98
void(* destroy)(void *data)
Definition: protocol.h:119
Definition: protocol.h:115
Definition: module-protocol-native.c:126
struct pw_control this
Definition: control.c:34
Definition: protocol.h:90
const void * server_marshal
Definition: protocol.h:99
const void * pw_protocol_get_extension(struct pw_protocol *protocol)
Definition: protocol.c:97
void spa_hook_list_init(struct spa_hook_list *list)
Initialize a hook list to the empty list.
Definition: hook.h:305
struct pw_protocol * pw_protocol_new(struct pw_context *context, const char *name, size_t user_data_size)
Definition: protocol.c:48
#define pw_protocol_server_destroy(l)
Definition: protocol.h:88
const char * type
interface type
Definition: protocol.h:91
uint32_t version
version
Definition: protocol.h:92
int(* steal_fd)(struct pw_protocol_client *client)
Definition: protocol.h:64
int(* connect)(struct pw_protocol_client *client, const struct spa_dict *props, void(*done_callback)(void *data, int result), void *data)
Definition: protocol.h:59
void spa_hook_list_clean(struct spa_hook_list *list)
Remove all hooks from the list.
Definition: hook.h:344
#define spa_list_append(list, item)
Definition: list.h:81