Go to the documentation of this file.
25 #ifndef PIPEWIRE_PROTOCOL_H
26 #define PIPEWIRE_PROTOCOL_H
32 #include <spa/utils/list.h>
40 #define PW_TYPE_INFO_Protocol "PipeWire:Protocol"
41 #define PW_TYPE_INFO_PROTOCOL_BASE PW_TYPE_INFO_Protocol ":"
50 const struct spa_dict *props,
51 void (*done_callback) (
void *
data,
int result),
60 #define pw_protocol_client_connect(c,p,cb,d) ((c)->connect(c,p,cb,d))
61 #define pw_protocol_client_connect_fd(c,fd,cl) ((c)->connect_fd(c,fd,cl))
62 #define pw_protocol_client_steal_fd(c) ((c)->steal_fd(c))
63 #define pw_protocol_client_disconnect(c) ((c)->disconnect(c))
64 #define pw_protocol_client_destroy(c) ((c)->destroy(c))
65 #define pw_protocol_client_set_paused(c,p) ((c)->set_paused(c,p))
78 #define pw_protocol_server_destroy(l) ((l)->destroy(l))
83 #define PW_PROTOCOL_MARSHAL_FLAG_IMPL (1 << 0)
85 uint32_t n_client_methods;
86 uint32_t n_server_methods;
87 const void *client_marshal;
94 #define PW_VERSION_PROTOCOL_IMPLEMENTATION 0
99 const struct spa_dict *props);
102 const struct spa_dict *props);
106 #define PW_VERSION_PROTOCOL_EVENTS 0
112 #define pw_protocol_new_client(p,...) (pw_protocol_get_implementation(p)->new_client(p,__VA_ARGS__))
113 #define pw_protocol_add_server(p,...) (pw_protocol_get_implementation(p)->add_server(p,__VA_ARGS__))
114 #define pw_protocol_ext(p,type,method,...) (((type*)pw_protocol_get_extension(p))->method( __VA_ARGS__))
132 struct spa_hook *listener,
const void * pw_protocol_get_extension(struct pw_protocol *protocol)
Definition: protocol.c:96
struct pw_core * core
Definition: protocol.h:47
SPA_EXPORT void * pw_protocol_get_user_data(struct pw_protocol *protocol)
Definition: protocol.c:82
struct pw_context * pw_protocol_get_context(struct pw_protocol *protocol)
Definition: protocol.c:76
uint32_t version
Definition: protocol.h:107
struct pw_protocol * pw_context_find_protocol(struct pw_context *context, const char *name)
Definition: protocol.c:178
Definition: protocol.h:43
Manages protocols and their implementation.
uint32_t flags
version
Definition: protocol.h:84
SPA_EXPORT const struct pw_protocol_implementaton * pw_protocol_get_implementation(struct pw_protocol *protocol)
Definition: protocol.c:89
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:162
#define NAME
Definition: protocol.c:33
int(* connect_fd)(struct pw_protocol_client *client, int fd, bool close)
Definition: protocol.h:53
struct pw_impl_core * core
Definition: protocol.h:71
void(* disconnect)(struct pw_protocol_client *client)
Definition: protocol.h:55
struct spa_list client_list
list of clients of this protocol
Definition: protocol.h:73
uint32_t version
Definition: protocol.h:95
struct pw_protocol * protocol
the owner protocol
Definition: protocol.h:45
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:131
void(* destroy)(struct pw_protocol_client *client)
Definition: protocol.h:56
#define pw_log_debug(...)
const struct pw_protocol_implementaton * pw_protocol_get_implementation(struct pw_protocol *protocol)
Definition: protocol.c:89
#define pw_protocol_server_destroy(l)
Definition: protocol.h:78
struct pw_protocol * pw_protocol_new(struct pw_context *context, const char *name, size_t user_data_size)
Definition: protocol.c:47
void * pw_protocol_get_user_data(struct pw_protocol *protocol)
Definition: protocol.c:82
SPA_EXPORT int pw_protocol_add_marshal(struct pw_protocol *protocol, const struct pw_protocol_marshal *marshal)
Definition: protocol.c:141
Definition: protocol.h:67
void pw_protocol_destroy(struct pw_protocol *protocol)
Definition: protocol.c:102
struct pw_protocol * protocol
the owner protocol
Definition: protocol.h:69
const SPA_EXPORT void * pw_protocol_get_extension(struct pw_protocol *protocol)
Definition: protocol.c:96
void(* destroy)(struct pw_protocol_server *listen)
Definition: protocol.h:75
const void * client_demarshal
Definition: protocol.h:90
struct spa_list link
link in protocol client_list
Definition: protocol.h:44
int(* set_paused)(struct pw_protocol_client *client, bool paused)
Definition: protocol.h:57
const void * server_demarshal
Definition: protocol.h:88
SPA_EXPORT struct pw_context * pw_protocol_get_context(struct pw_protocol *protocol)
Definition: protocol.c:76
struct spa_list link
link in protocol server_list
Definition: protocol.h:68
void(* destroy)(void *data)
Definition: protocol.h:109
int pw_protocol_add_marshal(struct pw_protocol *protocol, const struct pw_protocol_marshal *marshal)
Definition: protocol.c:141
SPA_EXPORT void pw_protocol_destroy(struct pw_protocol *protocol)
Definition: protocol.c:102
Definition: protocol.h:105
struct pw_control this
Definition: control.c:34
Definition: protocol.h:80
const void * server_marshal
Definition: protocol.h:89
SPA_EXPORT struct pw_protocol * pw_protocol_new(struct pw_context *context, const char *name, size_t user_data_size)
Definition: protocol.c:47
Definition: protocol.h:93
SPA_EXPORT 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:162
void pw_protocol_add_listener(struct pw_protocol *protocol, struct spa_hook *listener, const struct pw_protocol_events *events, void *data)
Definition: protocol.c:131
#define pw_protocol_client_destroy(c)
Definition: protocol.h:64
const char * type
interface type
Definition: protocol.h:81
uint32_t version
version
Definition: protocol.h:82
int(* steal_fd)(struct pw_protocol_client *client)
Definition: protocol.h:54
int(* connect)(struct pw_protocol_client *client, const struct spa_dict *props, void(*done_callback)(void *data, int result), void *data)
Definition: protocol.h:49
SPA_EXPORT struct pw_protocol * pw_context_find_protocol(struct pw_context *context, const char *name)
Definition: protocol.c:178