PipeWire  0.3.38
core.h
Go to the documentation of this file.
1 /* PipeWire
2  *
3  * Copyright © 2018 Wim Taymans
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice (including the next
13  * paragraph) shall be included in all copies or substantial portions of the
14  * Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  * DEALINGS IN THE SOFTWARE.
23  */
24 
25 #ifndef PIPEWIRE_CORE_H
26 #define PIPEWIRE_CORE_H
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 #include <stdarg.h>
33 #include <errno.h>
34 
35 #include <spa/utils/hook.h>
36 
54 #define PW_TYPE_INTERFACE_Core PW_TYPE_INFO_INTERFACE_BASE "Core"
55 #define PW_TYPE_INTERFACE_Registry PW_TYPE_INFO_INTERFACE_BASE "Registry"
56 
57 #define PW_VERSION_CORE 3
58 struct pw_core;
59 #define PW_VERSION_REGISTRY 3
60 struct pw_registry;
61 
63 #define PW_DEFAULT_REMOTE "pipewire-0"
64 
66 #define PW_ID_CORE 0
67 
68 /* invalid ID that matches any object when used for permissions */
69 #define PW_ID_ANY (uint32_t)(0xffffffff)
70 
73 struct pw_core_info {
74  uint32_t id;
75  uint32_t cookie;
76  const char *user_name;
77  const char *host_name;
78  const char *version;
79  const char *name;
80 #define PW_CORE_CHANGE_MASK_PROPS (1 << 0)
81 #define PW_CORE_CHANGE_MASK_ALL ((1 << 1)-1)
82  uint64_t change_mask;
83  struct spa_dict *props;
84 };
85 
86 #include <pipewire/context.h>
87 #include <pipewire/properties.h>
88 #include <pipewire/proxy.h>
89 
91 struct pw_core_info *
93  const struct pw_core_info *update);
95 struct pw_core_info *
96 pw_core_info_merge(struct pw_core_info *info,
97  const struct pw_core_info *update, bool reset);
99 void pw_core_info_free(struct pw_core_info *info);
100 
103 #define PW_CORE_EVENT_INFO 0
104 #define PW_CORE_EVENT_DONE 1
105 #define PW_CORE_EVENT_PING 2
106 #define PW_CORE_EVENT_ERROR 3
107 #define PW_CORE_EVENT_REMOVE_ID 4
108 #define PW_CORE_EVENT_BOUND_ID 5
109 #define PW_CORE_EVENT_ADD_MEM 6
110 #define PW_CORE_EVENT_REMOVE_MEM 7
111 #define PW_CORE_EVENT_NUM 8
112 
118 #define PW_VERSION_CORE_EVENTS 0
119  uint32_t version;
120 
129  void (*info) (void *object, const struct pw_core_info *info);
138  void (*done) (void *object, uint32_t id, int seq);
139 
145  void (*ping) (void *object, uint32_t id, int seq);
146 
164  void (*error) (void *object, uint32_t id, int seq, int res, const char *message);
176  void (*remove_id) (void *object, uint32_t id);
177 
188  void (*bound_id) (void *object, uint32_t id, uint32_t global_id);
189 
204  void (*add_mem) (void *object, uint32_t id, uint32_t type, int fd, uint32_t flags);
205 
211  void (*remove_mem) (void *object, uint32_t id);
212 };
213 
214 #define PW_CORE_METHOD_ADD_LISTENER 0
215 #define PW_CORE_METHOD_HELLO 1
216 #define PW_CORE_METHOD_SYNC 2
217 #define PW_CORE_METHOD_PONG 3
218 #define PW_CORE_METHOD_ERROR 4
219 #define PW_CORE_METHOD_GET_REGISTRY 5
220 #define PW_CORE_METHOD_CREATE_OBJECT 6
221 #define PW_CORE_METHOD_DESTROY 7
222 #define PW_CORE_METHOD_NUM 8
223 
233 #define PW_VERSION_CORE_METHODS 0
234  uint32_t version;
235 
236  int (*add_listener) (void *object,
237  struct spa_hook *listener,
238  const struct pw_core_events *events,
239  void *data);
245  int (*hello) (void *object, uint32_t version);
257  int (*sync) (void *object, uint32_t id, int seq);
265  int (*pong) (void *object, uint32_t id, int seq);
282  int (*error) (void *object, uint32_t id, int seq, int res, const char *message);
291  struct pw_registry * (*get_registry) (void *object, uint32_t version,
292  size_t user_data_size);
293 
303  void * (*create_object) (void *object,
304  const char *factory_name,
305  const char *type,
306  uint32_t version,
307  const struct spa_dict *props,
308  size_t user_data_size);
316  int (*destroy) (void *object, void *proxy);
317 };
318 
319 #define pw_core_method(o,method,version,...) \
320 ({ \
321  int _res = -ENOTSUP; \
322  spa_interface_call_res((struct spa_interface*)o, \
323  struct pw_core_methods, _res, \
324  method, version, ##__VA_ARGS__); \
325  _res; \
326 })
327 
328 #define pw_core_add_listener(c,...) pw_core_method(c,add_listener,0,__VA_ARGS__)
329 #define pw_core_hello(c,...) pw_core_method(c,hello,0,__VA_ARGS__)
330 #define pw_core_sync(c,...) pw_core_method(c,sync,0,__VA_ARGS__)
331 #define pw_core_pong(c,...) pw_core_method(c,pong,0,__VA_ARGS__)
332 #define pw_core_error(c,...) pw_core_method(c,error,0,__VA_ARGS__)
333 
334 
335 static inline
336 SPA_PRINTF_FUNC(5, 0) int
337 pw_core_errorv(struct pw_core *core, uint32_t id, int seq,
338  int res, const char *message, va_list args)
339 {
340  char buffer[1024];
341  vsnprintf(buffer, sizeof(buffer), message, args);
342  buffer[1023] = '\0';
343  return pw_core_error(core, id, seq, res, buffer);
344 }
345 
346 static inline
347 SPA_PRINTF_FUNC(5, 6) int
348 pw_core_errorf(struct pw_core *core, uint32_t id, int seq,
349  int res, const char *message, ...)
350 {
351  va_list args;
352  int r;
353  va_start(args, message);
354  r = pw_core_errorv(core, id, seq, res, message, args);
355  va_end(args);
356  return r;
357 }
358 
359 static inline struct pw_registry *
360 pw_core_get_registry(struct pw_core *core, uint32_t version, size_t user_data_size)
361 {
362  struct pw_registry *res = NULL;
364  struct pw_core_methods, res,
365  get_registry, 0, version, user_data_size);
366  return res;
367 }
368 
369 static inline void *
370 pw_core_create_object(struct pw_core *core,
371  const char *factory_name,
372  const char *type,
373  uint32_t version,
374  const struct spa_dict *props,
375  size_t user_data_size)
376 {
377  void *res = NULL;
379  struct pw_core_methods, res,
380  create_object, 0, factory_name,
381  type, version, props, user_data_size);
382  return res;
383 }
384 
385 #define pw_core_destroy(c,...) pw_core_method(c,destroy,0,__VA_ARGS__)
386 
426 #define PW_REGISTRY_EVENT_GLOBAL 0
427 #define PW_REGISTRY_EVENT_GLOBAL_REMOVE 1
428 #define PW_REGISTRY_EVENT_NUM 2
429 
432 #define PW_VERSION_REGISTRY_EVENTS 0
433  uint32_t version;
446  void (*global) (void *object, uint32_t id,
447  uint32_t permissions, const char *type, uint32_t version,
448  const struct spa_dict *props);
458  void (*global_remove) (void *object, uint32_t id);
459 };
460 
461 #define PW_REGISTRY_METHOD_ADD_LISTENER 0
462 #define PW_REGISTRY_METHOD_BIND 1
463 #define PW_REGISTRY_METHOD_DESTROY 2
464 #define PW_REGISTRY_METHOD_NUM 3
465 
468 #define PW_VERSION_REGISTRY_METHODS 0
469  uint32_t version;
470 
471  int (*add_listener) (void *object,
472  struct spa_hook *listener,
473  const struct pw_registry_events *events,
474  void *data);
487  void * (*bind) (void *object, uint32_t id, const char *type, uint32_t version,
488  size_t use_data_size);
489 
497  int (*destroy) (void *object, uint32_t id);
498 };
499 
500 #define pw_registry_method(o,method,version,...) \
501 ({ \
502  int _res = -ENOTSUP; \
503  spa_interface_call_res((struct spa_interface*)o, \
504  struct pw_registry_methods, _res, \
505  method, version, ##__VA_ARGS__); \
506  _res; \
507 })
508 
510 #define pw_registry_add_listener(p,...) pw_registry_method(p,add_listener,0,__VA_ARGS__)
511 
512 static inline void *
513 pw_registry_bind(struct pw_registry *registry,
514  uint32_t id, const char *type, uint32_t version,
515  size_t user_data_size)
516 {
517  void *res = NULL;
519  struct pw_registry_methods, res,
520  bind, 0, id, type, version, user_data_size);
521  return res;
522 }
523 
524 #define pw_registry_destroy(p,...) pw_registry_method(p,destroy,0,__VA_ARGS__)
525 
545 struct pw_core *
546 pw_context_connect(struct pw_context *context,
547  struct pw_properties *properties,
548  size_t user_data_size);
549 
560 struct pw_core *
561 pw_context_connect_fd(struct pw_context *context,
562  int fd,
563  struct pw_properties *properties,
564  size_t user_data_size);
565 
574 struct pw_core *
575 pw_context_connect_self(struct pw_context *context,
576  struct pw_properties *properties,
577  size_t user_data_size);
578 
581 int pw_core_steal_fd(struct pw_core *core);
582 
585 int pw_core_set_paused(struct pw_core *core, bool paused);
586 
588 int pw_core_disconnect(struct pw_core *core);
589 
592 void *pw_core_get_user_data(struct pw_core *core);
593 
596 struct pw_client * pw_core_get_client(struct pw_core *core);
597 
599 struct pw_context * pw_core_get_context(struct pw_core *core);
600 
602 const struct pw_properties *pw_core_get_properties(struct pw_core *core);
603 
607 int pw_core_update_properties(struct pw_core *core, const struct spa_dict *dict);
608 
610 struct pw_mempool * pw_core_get_mempool(struct pw_core *core);
611 
613 struct pw_proxy *pw_core_find_proxy(struct pw_core *core, uint32_t id);
614 
616 struct pw_proxy *pw_core_export(struct pw_core *core,
617  const char *type,
618  const struct spa_dict *props,
619  void *object,
620  size_t user_data_size );
621 
626 #ifdef __cplusplus
627 }
628 #endif
629 
630 #endif /* PIPEWIRE_CORE_H */
spa_interface_call_res
#define spa_interface_call_res(iface, method_type, res, method, vers,...)
Invoke method named method in the callbacks on the given interface object.
Definition: hook.h:226
pw_memblock::pool
struct pw_mempool * pool
owner pool
Definition: src/pipewire/mem.h:79
pw_mempool
A memory pool is a collection of pw_memblocks.
Definition: src/pipewire/mem.h:72
pw_filter_disconnect
int pw_filter_disconnect(struct pw_filter *filter)
Disconnect filter
Definition: filter.c:1542
pw_core_info_merge
struct pw_core_info * pw_core_info_merge(struct pw_core_info *info, const struct pw_core_info *update, bool reset)
Update an existing pw_core_info with update.
Definition: introspect.c:127
pw_context_connect_fd
struct pw_core * pw_context_connect_fd(struct pw_context *context, int fd, struct pw_properties *properties, size_t user_data_size)
Connect to a PipeWire instance on the given socket.
Definition: core.c:429
pw_core_events::remove_mem
void(* remove_mem)(void *object, uint32_t id)
Remove memory for a client.
Definition: core.h:211
pw_properties_get
int int const char * pw_properties_get(const struct pw_properties *properties, const char *key)
Get a property.
Definition: properties.c:487
spa_interface
Definition: hook.h:149
PW_KEY_REMOTE_NAME
#define PW_KEY_REMOTE_NAME
The name of the remote to connect to, default pipewire-0, overwritten by env(PIPEWIRE_REMOTE)
Definition: src/pipewire/keys.h:101
pw_export_type
data for registering export functions
Definition: context.h:147
pw_proxy_new
struct pw_proxy * pw_proxy_new(struct pw_proxy *factory, const char *type, uint32_t version, size_t user_data_size)
Create a proxy object with a given id and type.
Definition: proxy.c:91
pw_export_type::type
const char * type
Definition: context.h:149
pw_registry_events::version
uint32_t version
Definition: core.h:433
pw_mempool_new
struct pw_mempool * pw_mempool_new(struct pw_properties *props)
Create a new memory pool.
Definition: mem.c:134
pw_memblock::id
uint32_t id
unique id
Definition: src/pipewire/mem.h:80
pw_core_update_properties
int pw_core_update_properties(struct pw_core *core, const struct spa_dict *dict)
Update the core properties.
Definition: core.c:144
pw_properties_update
int pw_properties_update(struct pw_properties *props, const struct spa_dict *dict)
Update properties.
Definition: properties.c:298
pw_core_info
The core information.
Definition: core.h:73
pw_proxy_errorf
int pw_proxy_errorf(struct pw_proxy *proxy, int res, const char *error,...) 1(3
types.h
pw_registry_methods::destroy
int(* destroy)(void *object, uint32_t id)
Attempt to destroy a global object.
Definition: core.h:497
pw_core_events::add_mem
void(* add_mem)(void *object, uint32_t id, uint32_t type, int fd, uint32_t flags)
Add memory for a client.
Definition: core.h:204
pw_mempool_destroy
void pw_mempool_destroy(struct pw_mempool *pool)
Clear and destroy a pool.
Definition: mem.c:171
pw_core_methods::hello
int(* hello)(void *object, uint32_t version)
Start a conversation with the server.
Definition: core.h:245
pw_core_events::error
void(* error)(void *object, uint32_t id, int seq, int res, const char *message)
Fatal error event.
Definition: core.h:164
data
user data to add to an object
Definition: filter.c:75
pw_core_events::version
uint32_t version
Definition: core.h:119
pw_core_get_client
struct pw_client * pw_core_get_client(struct pw_core *core)
Get the client proxy of the connected core.
Definition: core.c:263
pw_memblock::flags
uint32_t flags
flags for the memory block on of enum pw_memblock_flags
Definition: src/pipewire/mem.h:82
PW_VERSION_CORE
#define PW_VERSION_CORE
Definition: core.h:57
SPA_EXPORT
#define SPA_EXPORT
Definition: defs.h:215
pw_log_trace
#define pw_log_trace(...)
Definition: src/pipewire/log.h:156
pw_protocol_client_destroy
#define pw_protocol_client_destroy(c)
Definition: protocol.h:74
pw_proxy_destroy
void pw_proxy_destroy(struct pw_proxy *proxy)
destroy a proxy
Definition: proxy.c:231
pw_core_info::user_name
const char * user_name
name of the user that started the core
Definition: core.h:76
pw_proxy_events
Proxy events, use pw_proxy_add_listener.
Definition: proxy.h:111
pw_core_info::version
const char * version
version of the core
Definition: core.h:78
SPA_PTROFF
#define SPA_PTROFF(ptr_, offset_, type_)
Return the address (buffer + offset) as pointer of type.
Definition: defs.h:164
pw_core_error
#define pw_core_error(c,...)
Definition: core.h:332
pw_protocol_new_client
#define pw_protocol_new_client(p,...)
Definition: protocol.h:122
pw_core_events::bound_id
void(* bound_id)(void *object, uint32_t id, uint32_t global_id)
Notify an object binding.
Definition: core.h:188
SPA_PRINTF_FUNC
#define SPA_PRINTF_FUNC(fmt, arg1)
Definition: defs.h:211
PW_TYPE_INTERFACE_Core
#define PW_TYPE_INTERFACE_Core
Definition: core.h:54
PW_KEY_PROTOCOL
#define PW_KEY_PROTOCOL
protocol used for connection
Definition: src/pipewire/keys.h:47
props
const char * props
Definition: media-session.c:2397
pw_core_get_mempool
struct pw_mempool * pw_core_get_mempool(struct pw_core *core)
Get the core mempool object.
Definition: core.c:483
pw_properties::dict
struct spa_dict dict
dictionary of key/values
Definition: properties.h:50
stream
Definition: stream.c:97
pw_core_info::host_name
const char * host_name
name of the machine the core is running on
Definition: core.h:77
pw_context_connect
struct pw_core * pw_context_connect(struct pw_context *context, struct pw_properties *properties, size_t user_data_size)
Connect to a PipeWire instance.
Definition: core.c:402
spa_list_consume
#define spa_list_consume(pos, head, member)
Definition: list.h:96
pw_protocol_client_connect
#define pw_protocol_client_connect(c, p, cb, d)
Definition: protocol.h:70
pw_proxy_remove
void pw_proxy_remove(struct pw_proxy *proxy)
called when cleaning up or when the server removed the resource.
Definition: proxy.c:267
pw_core_steal_fd
int pw_core_steal_fd(struct pw_core *core)
Steal the fd of the core connection or < 0 on error.
Definition: core.c:468
pw_registry_events
Registry events.
Definition: core.h:431
pw_core_methods::add_listener
int(* add_listener)(void *object, struct spa_hook *listener, const struct pw_core_events *events, void *data)
Definition: core.h:236
PW_VERSION_PROXY_EVENTS
#define PW_VERSION_PROXY_EVENTS
Definition: proxy.h:112
pw_context_connect_self
struct pw_core * pw_context_connect_self(struct pw_context *context, struct pw_properties *properties, size_t user_data_size)
Connect to a given PipeWire instance.
Definition: core.c:454
sync
Definition: media-session.c:123
spa_list_remove
void spa_list_remove(struct spa_list *elem)
Definition: list.h:69
pw_core_methods::error
int(* error)(void *object, uint32_t id, int seq, int res, const char *message)
Fatal error event.
Definition: core.h:282
pw_core_methods::pong
int(* pong)(void *object, uint32_t id, int seq)
Reply to a server ping event.
Definition: core.h:265
pw_memblock::fd
int fd
fd
Definition: src/pipewire/mem.h:84
pw_core_info::change_mask
uint64_t change_mask
bitfield of changed fields since last call
Definition: core.h:82
pw_registry_methods::add_listener
int(* add_listener)(void *object, struct spa_hook *listener, const struct pw_registry_events *events, void *data)
Definition: core.h:471
pw_context_find_export_type
const struct pw_export_type * pw_context_find_export_type(struct pw_context *context, const char *type)
find information about registered export type
Definition: context.c:1443
pw_core_events::info
void(* info)(void *object, const struct pw_core_info *info)
Notify new core info.
Definition: core.h:129
pw_core_export
struct pw_proxy * pw_core_export(struct pw_core *core, const char *type, const struct spa_dict *props, void *object, size_t user_data_size)
Export an object into the PipeWire instance associated with core.
Definition: core.c:275
filter
Definition: filter.c:126
spa_hook
Definition: hook.h:313
pw_protocol_client_steal_fd
#define pw_protocol_client_steal_fd(c)
Definition: protocol.h:72
pw_core_get_context
struct pw_context * pw_core_get_context(struct pw_core *core)
Get the context object used to created this core.
Definition: core.c:132
pw_stream_destroy
void pw_stream_destroy(struct pw_stream *stream)
Destroy a stream.
Definition: stream.c:1419
pw_core_info::props
struct spa_dict * props
extra properties
Definition: core.h:83
pw_core_hello
#define pw_core_hello(c,...)
Definition: core.h:329
pw_core_find_proxy
struct pw_proxy * pw_core_find_proxy(struct pw_core *core, uint32_t id)
Get the proxy with the given id.
Definition: core.c:269
pw_core_methods::destroy
int(* destroy)(void *object, void *proxy)
Destroy an resource.
Definition: core.h:316
pw_core_disconnect
int pw_core_disconnect(struct pw_core *core)
disconnect and destroy a core
Definition: core.c:489
pw_core_methods
Core methods.
Definition: core.h:232
buffer
Definition: filter.c:59
pw_core_set_paused
int pw_core_set_paused(struct pw_core *core, bool paused)
Pause or resume the core.
Definition: core.c:476
pw_stream_disconnect
int pw_stream_disconnect(struct pw_stream *stream)
Disconnect stream
Definition: stream.c:1825
spa_list_init
void spa_list_init(struct spa_list *list)
Definition: list.h:44
spa_list_for_each_safe
#define spa_list_for_each_safe(pos, tmp, head, member)
Definition: list.h:129
spa_dict
Definition: utils/dict.h:48
pw_context_find_protocol
struct pw_protocol * pw_context_find_protocol(struct pw_context *context, const char *name)
Definition: protocol.c:180
pw_registry_events::global_remove
void(* global_remove)(void *object, uint32_t id)
Notify of a global object removal.
Definition: core.h:458
pw_mempool_remove_id
int pw_mempool_remove_id(struct pw_mempool *pool, uint32_t id)
Remove a memblock for given id.
Definition: mem.c:669
pw_core_pong
#define pw_core_pong(c,...)
Definition: core.h:331
pw_core_get_properties
const struct pw_properties * pw_core_get_properties(struct pw_core *core)
Get properties from the core.
Definition: core.c:138
proxy.h
PW_VERSION_CORE_EVENTS
#define PW_VERSION_CORE_EVENTS
Definition: core.h:118
spa_strerror
#define spa_strerror(err)
Definition: result.h:51
pw_core_info_free
void pw_core_info_free(struct pw_core_info *info)
Free a pw_core_info
Definition: introspect.c:165
pw_core_methods::version
uint32_t version
Definition: core.h:234
PW_LOG_TOPIC_EXTERN
PW_LOG_TOPIC_EXTERN(log_core)
pw_mempool_import
struct pw_memblock * pw_mempool_import(struct pw_mempool *pool, enum pw_memblock_flags flags, uint32_t type, int fd)
Import an fd into the pool.
Definition: mem.c:568
pw_memblock
Memory block structure.
Definition: src/pipewire/mem.h:78
pw_log_debug
#define pw_log_debug(...)
Definition: src/pipewire/log.h:155
pw_protocol_client_set_paused
#define pw_protocol_client_set_paused(c, p)
Definition: protocol.h:75
pw_properties_add
int pw_properties_add(struct pw_properties *oldprops, const struct spa_dict *dict)
Add properties.
Definition: properties.c:319
SPA_ID_INVALID
#define SPA_ID_INVALID
Definition: defs.h:187
pw_properties_set
int pw_properties_set(struct pw_properties *properties, const char *key, const char *value)
Set a property value.
Definition: properties.c:435
pw_export_type::func
struct pw_proxy *(* func)(struct pw_core *core, const char *type, const struct spa_dict *props, void *object, size_t user_data_size)
Definition: context.h:150
parser.h
pw_core_info_update
struct pw_core_info * pw_core_info_update(struct pw_core_info *info, const struct pw_core_info *update)
Update an existing pw_core_info with update with reset.
Definition: introspect.c:158
pw_filter_destroy
void pw_filter_destroy(struct pw_filter *filter)
Destroy a filter
Definition: filter.c:1330
PW_TYPE_INTERFACE_Client
#define PW_TYPE_INTERFACE_Client
Definition: client.h:46
pw_proxy_init
int pw_proxy_init(struct pw_proxy *proxy, const char *type, uint32_t version)
Definition: proxy.c:44
pw_core_info::name
const char * name
name of the core
Definition: core.h:79
pw_core_info::cookie
uint32_t cookie
a random cookie for identifying this instance of PipeWire
Definition: core.h:75
pw_log_warn
#define pw_log_warn(...)
Definition: src/pipewire/log.h:153
registry
Definition: pipewire.c:79
context.h
pw_proxy_add_listener
void pw_proxy_add_listener(struct pw_proxy *proxy, struct spa_hook *listener, const struct pw_proxy_events *events, void *data)
Add an event listener to proxy.
Definition: proxy.c:197
pw_registry_methods
Registry methods.
Definition: core.h:467
pw_core_events::done
void(* done)(void *object, uint32_t id, int seq)
Emit a done event.
Definition: core.h:138
spa_hook_remove
void spa_hook_remove(struct spa_hook *hook)
Remove a hook.
Definition: hook.h:354
pw_protocol_client_disconnect
#define pw_protocol_client_disconnect(c)
Definition: protocol.h:73
pw_core_events::remove_id
void(* remove_id)(void *object, uint32_t id)
Remove an object ID.
Definition: core.h:176
pw_client_update_properties
#define pw_client_update_properties(c,...)
Definition: client.h:174
pipewire.h
properties.h
pw_registry_events::global
void(* global)(void *object, uint32_t id, uint32_t permissions, const char *type, uint32_t version, const struct spa_dict *props)
Notify of a new global object.
Definition: core.h:446
pw_core_events::ping
void(* ping)(void *object, uint32_t id, int seq)
Emit a ping event.
Definition: core.h:145
pw_protocol_client_connect_fd
#define pw_protocol_client_connect_fd(c, fd, cl)
Definition: protocol.h:71
PW_VERSION_CLIENT
#define PW_VERSION_CLIENT
Definition: client.h:48
pw_core_get_user_data
void * pw_core_get_user_data(struct pw_core *core)
Get the user_data.
Definition: core.c:162
pw_core_info::id
uint32_t id
id of the global
Definition: core.h:74
pw_properties_new
struct pw_properties * pw_properties_new(const char *key,...) 1
Make a new properties object.
Definition: properties.c:98
pw_memblock::type
uint32_t type
type of the fd, one of enum spa_data_type
Definition: src/pipewire/mem.h:83
pw_core_add_listener
#define pw_core_add_listener(c,...)
Definition: core.h:328
hook.h
pw_proxy_set_bound_id
int pw_proxy_set_bound_id(struct pw_proxy *proxy, uint32_t global_id)
Set the global id this proxy is bound to.
Definition: proxy.c:160
pw_properties
Definition: properties.h:49
pw_properties_free
void pw_properties_free(struct pw_properties *properties)
Free a properties object.
Definition: properties.c:364
pw_core_events
Core events.
Definition: core.h:117
pw_log_error
#define pw_log_error(...)
Definition: src/pipewire/log.h:152
spa_list_append
#define spa_list_append(list, item)
Definition: list.h:81
pw_registry_methods::version
uint32_t version
Definition: core.h:469