PipeWire  0.3.5
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 
37 #define PW_TYPE_INTERFACE_Core PW_TYPE_INFO_INTERFACE_BASE "Core"
38 #define PW_TYPE_INTERFACE_Registry PW_TYPE_INFO_INTERFACE_BASE "Registry"
39 
40 #define PW_VERSION_CORE 3
41 struct pw_core;
42 #define PW_VERSION_REGISTRY 3
43 struct pw_registry;
44 
45 /* default ID for the core object after connect */
46 #define PW_ID_CORE 0
47 
48 /* invalid ID that matches any object when used for permissions */
49 #define PW_ID_ANY (uint32_t)(0xffffffff)
50 
52 struct pw_core_info {
53  uint32_t id;
54  uint32_t cookie;
55  const char *user_name;
56  const char *host_name;
57  const char *version;
58  const char *name;
59 #define PW_CORE_CHANGE_MASK_PROPS (1 << 0)
60 #define PW_CORE_CHANGE_MASK_ALL ((1 << 1)-1)
61  uint64_t change_mask;
62  struct spa_dict *props;
63 };
64 
65 #include <pipewire/context.h>
66 #include <pipewire/properties.h>
67 #include <pipewire/proxy.h>
68 
70 struct pw_core_info *
72  const struct pw_core_info *update);
73 
75 void pw_core_info_free(struct pw_core_info *info);
76 
88 #define PW_CORE_EVENT_INFO 0
89 #define PW_CORE_EVENT_DONE 1
90 #define PW_CORE_EVENT_PING 2
91 #define PW_CORE_EVENT_ERROR 3
92 #define PW_CORE_EVENT_REMOVE_ID 4
93 #define PW_CORE_EVENT_BOUND_ID 5
94 #define PW_CORE_EVENT_ADD_MEM 6
95 #define PW_CORE_EVENT_REMOVE_MEM 7
96 #define PW_CORE_EVENT_NUM 8
97 
103 #define PW_VERSION_CORE_EVENTS 0
104  uint32_t version;
105 
114  void (*info) (void *object, const struct pw_core_info *info);
123  void (*done) (void *object, uint32_t id, int seq);
124 
130  void (*ping) (void *object, uint32_t id, int seq);
131 
149  void (*error) (void *object, uint32_t id, int seq, int res, const char *message);
161  void (*remove_id) (void *object, uint32_t id);
162 
173  void (*bound_id) (void *object, uint32_t id, uint32_t global_id);
174 
189  void (*add_mem) (void *object, uint32_t id, uint32_t type, int fd, uint32_t flags);
190 
196  void (*remove_mem) (void *object, uint32_t id);
197 };
198 
199 #define PW_CORE_METHOD_ADD_LISTENER 0
200 #define PW_CORE_METHOD_HELLO 1
201 #define PW_CORE_METHOD_SYNC 2
202 #define PW_CORE_METHOD_PONG 3
203 #define PW_CORE_METHOD_ERROR 4
204 #define PW_CORE_METHOD_GET_REGISTRY 5
205 #define PW_CORE_METHOD_CREATE_OBJECT 6
206 #define PW_CORE_METHOD_DESTROY 7
207 #define PW_CORE_METHOD_NUM 8
208 
218 #define PW_VERSION_CORE_METHODS 0
219  uint32_t version;
220 
221  int (*add_listener) (void *object,
222  struct spa_hook *listener,
223  const struct pw_core_events *events,
224  void *data);
230  int (*hello) (void *object, uint32_t version);
242  int (*sync) (void *object, uint32_t id, int seq);
250  int (*pong) (void *object, uint32_t id, int seq);
267  int (*error) (void *object, uint32_t id, int seq, int res, const char *message);
276  struct pw_registry * (*get_registry) (void *object, uint32_t version,
277  size_t user_data_size);
278 
288  void * (*create_object) (void *object,
289  const char *factory_name,
290  const char *type,
291  uint32_t version,
292  const struct spa_dict *props,
293  size_t user_data_size);
301  int (*destroy) (void *object, void *proxy);
302 };
303 
304 #define pw_core_method(o,method,version,...) \
305 ({ \
306  int _res = -ENOTSUP; \
307  spa_interface_call_res((struct spa_interface*)o, \
308  struct pw_core_methods, _res, \
309  method, version, ##__VA_ARGS__); \
310  _res; \
311 })
312 
313 #define pw_core_add_listener(c,...) pw_core_method(c,add_listener,0,__VA_ARGS__)
314 #define pw_core_hello(c,...) pw_core_method(c,hello,0,__VA_ARGS__)
315 #define pw_core_sync(c,...) pw_core_method(c,sync,0,__VA_ARGS__)
316 #define pw_core_pong(c,...) pw_core_method(c,pong,0,__VA_ARGS__)
317 #define pw_core_error(c,...) pw_core_method(c,error,0,__VA_ARGS__)
318 
319 
320 static inline
321 SPA_PRINTF_FUNC(5, 0) int
322 pw_core_errorv(struct pw_core *core, uint32_t id, int seq,
323  int res, const char *message, va_list args)
324 {
325  char buffer[1024];
327  buffer[1023] = '\0';
328  return pw_core_error(core, id, seq, res, buffer);
329 }
330 
331 static inline
332 SPA_PRINTF_FUNC(5, 6) int
333 pw_core_errorf(struct pw_core *core, uint32_t id, int seq,
334  int res, const char *message, ...)
335 {
336  va_list args;
337  int r;
339  r = pw_core_errorv(core, id, seq, res, message, args);
341  return r;
342 }
343 
344 static inline struct pw_registry *
345 pw_core_get_registry(struct pw_core *core, uint32_t version, size_t user_data_size)
346 {
347  struct pw_registry *res = NULL;
348  spa_interface_call_res((struct spa_interface*)core,
349  struct pw_core_methods, res,
350  get_registry, 0, version, user_data_size);
351  return res;
352 }
353 
354 static inline void *
355 pw_core_create_object(struct pw_core *core,
356  const char *factory_name,
357  const char *type,
358  uint32_t version,
359  const struct spa_dict *props,
360  size_t user_data_size)
361 {
362  void *res = NULL;
363  spa_interface_call_res((struct spa_interface*)core,
364  struct pw_core_methods, res,
365  create_object, 0, factory_name,
366  type, version, props, user_data_size);
367  return res;
368 }
369 
370 #define pw_core_destroy(c,...) pw_core_method(c,destroy,0,__VA_ARGS__)
371 
404 #define PW_REGISTRY_EVENT_GLOBAL 0
405 #define PW_REGISTRY_EVENT_GLOBAL_REMOVE 1
406 #define PW_REGISTRY_EVENT_NUM 2
407 
410 #define PW_VERSION_REGISTRY_EVENTS 0
411  uint32_t version;
424  void (*global) (void *object, uint32_t id,
425  uint32_t permissions, const char *type, uint32_t version,
426  const struct spa_dict *props);
436  void (*global_remove) (void *object, uint32_t id);
437 };
438 
439 #define PW_REGISTRY_METHOD_ADD_LISTENER 0
440 #define PW_REGISTRY_METHOD_BIND 1
441 #define PW_REGISTRY_METHOD_DESTROY 2
442 #define PW_REGISTRY_METHOD_NUM 3
443 
446 #define PW_VERSION_REGISTRY_METHODS 0
447  uint32_t version;
448 
449  int (*add_listener) (void *object,
450  struct spa_hook *listener,
451  const struct pw_registry_events *events,
452  void *data);
465  void * (*bind) (void *object, uint32_t id, const char *type, uint32_t version,
466  size_t use_data_size);
467 
475  int (*destroy) (void *object, uint32_t id);
476 };
477 
478 #define pw_registry_method(o,method,version,...) \
479 ({ \
480  int _res = -ENOTSUP; \
481  spa_interface_call_res((struct spa_interface*)o, \
482  struct pw_registry_methods, _res, \
483  method, version, ##__VA_ARGS__); \
484  _res; \
485 })
486 
488 #define pw_registry_add_listener(p,...) pw_registry_method(p,add_listener,0,__VA_ARGS__)
489 
490 static inline void *
491 pw_registry_bind(struct pw_registry *registry,
492  uint32_t id, const char *type, uint32_t version,
493  size_t user_data_size)
494 {
495  void *res = NULL;
496  spa_interface_call_res((struct spa_interface*)registry,
497  struct pw_registry_methods, res,
498  bind, 0, id, type, version, user_data_size);
499  return res;
500 }
501 
502 #define pw_registry_destroy(p,...) pw_registry_method(p,destroy,0,__VA_ARGS__)
503 
504 
508 struct pw_core *
509 pw_context_connect(struct pw_context *context,
510  struct pw_properties *properties,
512  size_t user_data_size );
513 
518 struct pw_core *
519 pw_context_connect_fd(struct pw_context *context,
520  int fd,
521  struct pw_properties *properties,
523  size_t user_data_size );
524 
527 struct pw_core *
528 pw_context_connect_self(struct pw_context *context,
529  struct pw_properties *properties,
531  size_t user_data_size );
532 
535 int pw_core_steal_fd(struct pw_core *core);
536 
539 int pw_core_set_paused(struct pw_core *core, bool paused);
540 
542 int pw_core_disconnect(struct pw_core *core);
543 
546 void *pw_core_get_user_data(struct pw_core *core);
547 
550 struct pw_client * pw_core_get_client(struct pw_core *core);
551 
553 struct pw_context * pw_core_get_context(struct pw_core *core);
554 
556 const struct pw_properties *pw_core_get_properties(struct pw_core *core);
557 
561 int pw_core_update_properties(struct pw_core *core, const struct spa_dict *dict);
562 
564 struct pw_mempool * pw_core_get_mempool(struct pw_core *core);
565 
567 struct pw_proxy *pw_core_find_proxy(struct pw_core *core, uint32_t id);
568 
570 struct pw_proxy *pw_core_export(struct pw_core *core,
571  const char *type,
572  const struct spa_dict *props,
573  void *object,
574  size_t user_data_size );
575 
576 
577 #ifdef __cplusplus
578 }
579 #endif
580 
581 #endif /* PIPEWIRE_CORE_H */
res
static uint32_t int int res
Definition: core.h:323
PW_VERSION_CLIENT
#define PW_VERSION_CLIENT
Definition: client.h:40
pw_memblock::pool
struct pw_mempool * pool
owner pool
Definition: mem.h:65
pw_mempool
Definition: mem.h:58
pw_core_events::remove_mem
void(* remove_mem)(void *object, uint32_t id)
Remove memory for a client.
Definition: core.h:196
pw_core_get_client
SPA_EXPORT struct pw_client * pw_core_get_client(struct pw_core *core)
Get the client proxy of the connected core.
Definition: core.c:230
id
static uint32_t id
Definition: core.h:322
PW_KEY_REMOTE_NAME
#define PW_KEY_REMOTE_NAME
The name of the remote to connect to, default env(PIPEWIRE_REMOTE) or pipewire-0.
Definition: keys.h:89
pw_context_connect_fd
SPA_EXPORT struct pw_core * pw_context_connect_fd(struct pw_context *context, int fd, struct pw_properties *properties, size_t user_data_size)
Definition: core.c:394
pw_export_type
data for registering export functions
Definition: context.h:165
pw_map::pw_map_lookup
static void * pw_map_lookup(struct pw_map *map, uint32_t id)
Find an item in the map.
Definition: map.h:169
pw_export_type::type
const char * type
Definition: context.h:167
pw_registry_events::version
uint32_t version
Definition: core.h:411
pw_memblock::id
uint32_t id
unique id
Definition: mem.h:66
pw_filter
PipeWire filter object class.
pw_log::pw_log_error
#define pw_log_error(...)
pw_context_find_protocol
struct pw_protocol * pw_context_find_protocol(struct pw_context *context, const char *name)
Definition: protocol.c:176
pw_core_info
The core information.
Definition: core.h:52
pw_protocol_new_client
#define pw_protocol_new_client(p,...)
Definition: protocol.h:112
pw_mempool_destroy
void pw_mempool_destroy(struct pw_mempool *pool)
Clear and destroy a pool.
Definition: mem.c:167
pw_registry_methods::destroy
int(* destroy)(void *object, uint32_t id)
Attempt to destroy a global object.
Definition: core.h:475
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:189
pw_client_update_properties
#define pw_client_update_properties(c,...)
Definition: client.h:163
pw_map::pw_map_init
static void pw_map_init(struct pw_map *map, size_t size, size_t extend)
Initialize a map.
Definition: map.h:76
pw_core_methods::hello
int(* hello)(void *object, uint32_t version)
Start a conversation with the server.
Definition: core.h:230
pw_core_events::error
void(* error)(void *object, uint32_t id, int seq, int res, const char *message)
Fatal error event.
Definition: core.h:149
pw_protocol
Manages protocols and their implementation.
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:133
data
Definition: filter.c:70
pw_core_events::version
uint32_t version
Definition: core.h:104
pw_core_disconnect
int pw_core_disconnect(struct pw_core *core)
disconnect and destroy a core
Definition: core.c:449
pw_memblock::flags
uint32_t flags
flags for the memory block on of enum pw_memblock_flags
Definition: mem.h:68
PW_VERSION_CORE
#define PW_VERSION_CORE
Definition: core.h:40
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_proxy::pw_proxy_destroy
SPA_EXPORT void pw_proxy_destroy(struct pw_proxy *proxy)
Destroy a proxy object.
Definition: proxy.c:231
pw_core_get_mempool
struct pw_mempool * pw_core_get_mempool(struct pw_core *core)
Get the core mempool object.
Definition: core.c:443
pw_core_pong
#define pw_core_pong(c,...)
Definition: core.h:316
pw_introspect::pw_core_info_update
struct pw_core_info * pw_core_info_update(struct pw_core_info *info, const struct pw_core_info *update)
Update and existing pw_core_info with update.
Definition: introspect.c:127
pw_core_info::user_name
const char * user_name
name of the user that started the core
Definition: core.h:55
pw_proxy_events
Proxy events, use pw_proxy_add_listener.
Definition: proxy.h:106
pw_protocol_client_connect
#define pw_protocol_client_connect(c, p, cb, d)
Definition: protocol.h:60
pw_proxy::pw_proxy_new
SPA_EXPORT 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_core_info::version
const char * version
version of the core
Definition: core.h:57
r
static uint32_t int int const char int r
Definition: core.h:335
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
pw_core_events::bound_id
void(* bound_id)(void *object, uint32_t id, uint32_t global_id)
Notify an object binding.
Definition: core.h:173
pw_core_update_properties
SPA_EXPORT int pw_core_update_properties(struct pw_core *core, const struct spa_dict *dict)
Update the core properties.
Definition: core.c:145
pw_properties::dict
struct spa_dict dict
dictionary of key/values
Definition: properties.h:46
pw_core_set_paused
SPA_EXPORT int pw_core_set_paused(struct pw_core *core, bool paused)
Pause or resume the core.
Definition: core.c:437
stream
Definition: stream.c:90
pw_core_info::host_name
const char * host_name
name of the machine the core is running on
Definition: core.h:56
pw_core_set_paused
int pw_core_set_paused(struct pw_core *core, bool paused)
Pause or resume the core.
Definition: core.c:437
pw_core_find_proxy
SPA_EXPORT struct pw_proxy * pw_core_find_proxy(struct pw_core *core, uint32_t id)
Get the proxy with the given id.
Definition: core.c:236
pw_map::pw_map_for_each
static int pw_map_for_each(struct pw_map *map, int(*func)(void *item_data, void *data), void *data)
Iterate all map items.
Definition: map.h:188
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:263
pw_registry_events
Registry events.
Definition: core.h:409
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:221
PW_VERSION_PROXY_EVENTS
#define PW_VERSION_PROXY_EVENTS
Definition: proxy.h:107
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:145
pw_core_methods::error
int(* error)(void *object, uint32_t id, int seq, int res, const char *message)
Fatal error event.
Definition: core.h:267
pw_core_methods::pong
int(* pong)(void *object, uint32_t id, int seq)
Reply to a server ping event.
Definition: core.h:250
pw_core_methods::sync
int(* sync)(void *object, uint32_t id, int seq)
Do server roundtrip.
Definition: core.h:242
pw_core_get_user_data
void * pw_core_get_user_data(struct pw_core *core)
Get the user_data.
Definition: core.c:163
pw_core_error
#define pw_core_error(c,...)
Definition: core.h:317
pw_memblock::fd
int fd
fd
Definition: mem.h:70
pw_core_info::change_mask
uint64_t change_mask
bitfield of changed fields since last call
Definition: core.h:61
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:449
pw_protocol_client_disconnect
#define pw_protocol_client_disconnect(c)
Definition: protocol.h:63
pw_core_events::info
void(* info)(void *object, const struct pw_core_info *info)
Notify new core info.
Definition: core.h:114
filter
Definition: filter.c:112
message
static uint32_t int int const char * message
Definition: core.h:323
va_start
va_start(args, message)
pw_log::pw_log_debug
#define pw_log_debug(...)
pw_core_info::props
struct spa_dict * props
extra properties
Definition: core.h:62
pw_context_connect_self
SPA_EXPORT struct pw_core * pw_context_connect_self(struct pw_context *context, struct pw_properties *properties, size_t user_data_size)
Definition: core.c:417
pw_proxy
Represents an object on the client side.
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:533
pw_core_steal_fd
SPA_EXPORT int pw_core_steal_fd(struct pw_core *core)
Steal the fd of the core connection or < 0 on error.
Definition: core.c:431
PW_TYPE_INTERFACE_Core
#define PW_TYPE_INTERFACE_Core
Definition: core.h:37
pw_core_methods::destroy
int(* destroy)(void *object, void *proxy)
Destroy an resource.
Definition: core.h:301
pw_properties::pw_properties_update
SPA_EXPORT int pw_properties_update(struct pw_properties *props, const struct spa_dict *dict)
Update properties.
Definition: properties.c:258
pw_core_add_listener
#define pw_core_add_listener(c,...)
Definition: core.h:313
pw_protocol_client_set_paused
#define pw_protocol_client_set_paused(c, p)
Definition: protocol.h:65
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:242
pw_core_methods
Core methods.
Definition: core.h:217
buffer
Definition: filter.c:55
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:236
pw_map::pw_map_clear
static void pw_map_clear(struct pw_map *map)
Clear a map.
Definition: map.h:87
pw_introspect::pw_core_info_free
void pw_core_info_free(struct pw_core_info *info)
Free a pw_core_info.
Definition: introspect.c:156
pw_registry_events::global_remove
void(* global_remove)(void *object, uint32_t id)
Notify of a global object removal.
Definition: core.h:436
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:431
pw_proxy_errorf
int pw_proxy_errorf(struct pw_proxy *proxy, int res, const char *error,...) SPA_PRINTF_FUNC(3
proxy.h
pw_context
the PipeWire context
NAME
#define NAME
Definition: core.c:40
pw_core_get_context
SPA_EXPORT struct pw_context * pw_core_get_context(struct pw_core *core)
Get the context object used to created this core.
Definition: core.c:133
args
static uint32_t int int const char va_list args
Definition: core.h:324
PW_VERSION_CORE_EVENTS
#define PW_VERSION_CORE_EVENTS
Definition: core.h:103
pw_core_methods::version
uint32_t version
Definition: core.h:219
pw_memblock
Definition: mem.h:64
pw_properties::pw_properties_set
SPA_EXPORT int pw_properties_set(struct pw_properties *properties, const char *key, const char *value)
Set a property value.
Definition: properties.c:395
vsnprintf
vsnprintf(buffer, sizeof(buffer), message, args)
pw_core_hello
#define pw_core_hello(c,...)
Definition: core.h:314
pw_log::pw_log_trace
#define pw_log_trace(...)
pw_core_get_properties
const struct pw_properties * pw_core_get_properties(struct pw_core *core)
Get properties from the core.
Definition: core.c:139
pw_protocol_client_steal_fd
#define pw_protocol_client_steal_fd(c)
Definition: protocol.h:62
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:168
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:196
pw_properties::pw_properties_get
SPA_EXPORT const char * pw_properties_get(const struct pw_properties *properties, const char *key)
Get a property.
Definition: properties.c:451
pw_stream::pw_stream_disconnect
int pw_stream_disconnect(struct pw_stream *stream)
Disconnect stream.
Definition: stream.c:1559
va_end
va_end(args)
pw_proxy_init
int pw_proxy_init(struct pw_proxy *proxy, const char *type, uint32_t version)
Definition: proxy.c:43
pw_core_info::name
const char * name
name of the core
Definition: core.h:58
pw_protocol_client_connect_fd
#define pw_protocol_client_connect_fd(c, fd, cl)
Definition: protocol.h:61
pw_core_info::cookie
uint32_t cookie
a random cookie for identifying this instance of PipeWire
Definition: core.h:54
registry
Definition: pipewire.c:66
PW_TYPE_INTERFACE_Client
#define PW_TYPE_INTERFACE_Client
Definition: client.h:38
pw_mempool_new
struct pw_mempool * pw_mempool_new(struct pw_properties *props)
Create a new memory pool.
Definition: mem.c:133
pw_properties::pw_properties_add
SPA_EXPORT int pw_properties_add(struct pw_properties *props, const struct spa_dict *dict)
Add properties.
Definition: properties.c:281
context.h
pw_core_get_mempool
SPA_EXPORT struct pw_mempool * pw_core_get_mempool(struct pw_core *core)
Get the core mempool object.
Definition: core.c:443
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:626
pw_registry_methods
Registry methods.
Definition: core.h:445
pw_core_events::done
void(* done)(void *object, uint32_t id, int seq)
Emit a done event.
Definition: core.h:123
pw_stream::pw_stream_destroy
void pw_stream_destroy(struct pw_stream *stream)
Destroy a stream.
Definition: stream.c:1225
pw_core_get_user_data
SPA_EXPORT void * pw_core_get_user_data(struct pw_core *core)
Get the user_data.
Definition: core.c:163
pw_core_events::remove_id
void(* remove_id)(void *object, uint32_t id)
Remove an object ID.
Definition: core.h:161
pw_filter::pw_filter_destroy
void pw_filter_destroy(struct pw_filter *filter)
Destroy a filter.
Definition: filter.c:1075
pw_properties::pw_properties_new
SPA_EXPORT struct pw_properties * pw_properties_new(const char *key,...)
Make a new properties object.
Definition: properties.c:95
pw_core_get_properties
SPA_EXPORT const struct pw_properties * pw_core_get_properties(struct pw_core *core)
Get properties from the core.
Definition: core.c:139
seq
static uint32_t int seq
Definition: core.h:322
pw_stream
PipeWire stream object class.
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:424
pw_core_events::ping
void(* ping)(void *object, uint32_t id, int seq)
Emit a ping event.
Definition: core.h:130
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:230
pw_filter::pw_filter_disconnect
int pw_filter_disconnect(struct pw_filter *filter)
Disconnect filter.
Definition: filter.c:1262
pw_core_info::id
uint32_t id
id of the global
Definition: core.h:53
pw_memblock::type
uint32_t type
type of the fd, one of enum spa_data_type
Definition: mem.h:69
pw_protocol_client_destroy
#define pw_protocol_client_destroy(c)
Definition: protocol.h:64
pw_context_connect
SPA_EXPORT struct pw_core * pw_context_connect(struct pw_context *context, struct pw_properties *properties, size_t user_data_size)
Definition: core.c:369
pw_core_export
SPA_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:242
pw_core_disconnect
SPA_EXPORT int pw_core_disconnect(struct pw_core *core)
disconnect and destroy a core
Definition: core.c:449
pw_properties
A collection of key/value pairs.
Definition: properties.h:45
pw_properties::pw_properties_free
SPA_EXPORT void pw_properties_free(struct pw_properties *properties)
Free a properties object.
Definition: properties.c:330
PW_KEY_PROTOCOL
#define PW_KEY_PROTOCOL
The protocol key is usually set on a pw_client and contains a string describing the protocol used by ...
Definition: keys.h:54
pw_core_events
Core events.
Definition: core.h:102
pw_registry_methods::version
uint32_t version
Definition: core.h:447