20 #ifndef __PIPEWIRE_INTERFACES_H__ 21 #define __PIPEWIRE_INTERFACES_H__ 27 #include <spa/utils/defs.h> 28 #include <spa/param/param.h> 29 #include <spa/node/node.h> 35 struct pw_registry_proxy;
36 struct pw_module_proxy;
39 struct pw_factory_proxy;
40 struct pw_client_proxy;
61 #define PW_TYPE_INTERFACE__Core PW_TYPE_INTERFACE_BASE "Core" 62 #define PW_TYPE_INTERFACE__Registry PW_TYPE_INTERFACE_BASE "Registry" 63 #define PW_TYPE_INTERFACE__Module PW_TYPE_INTERFACE_BASE "Module" 64 #define PW_TYPE_INTERFACE__Node PW_TYPE_INTERFACE_BASE "Node" 65 #define PW_TYPE_INTERFACE__Port PW_TYPE_INTERFACE_BASE "Port" 66 #define PW_TYPE_INTERFACE__Client PW_TYPE_INTERFACE_BASE "Client" 67 #define PW_TYPE_INTERFACE__Link PW_TYPE_INTERFACE_BASE "Link" 69 #define PW_VERSION_CORE 0 71 #define PW_CORE_PROXY_METHOD_HELLO 0 72 #define PW_CORE_PROXY_METHOD_UPDATE_TYPES 1 73 #define PW_CORE_PROXY_METHOD_SYNC 2 74 #define PW_CORE_PROXY_METHOD_GET_REGISTRY 3 75 #define PW_CORE_PROXY_METHOD_CLIENT_UPDATE 4 76 #define PW_CORE_PROXY_METHOD_PERMISSIONS 5 77 #define PW_CORE_PROXY_METHOD_CREATE_OBJECT 6 78 #define PW_CORE_PROXY_METHOD_DESTROY 7 79 #define PW_CORE_PROXY_METHOD_NUM 8 84 #define PW_CORE_PROXY_PERMISSIONS_DEFAULT "permissions.default" 91 #define PW_CORE_PROXY_PERMISSIONS_GLOBAL "permissions.global" 99 #define PW_CORE_PROXY_PERMISSIONS_EXISTING "permissions.existing" 101 #define PW_LINK_OUTPUT_NODE_ID "link.output_node.id" 102 #define PW_LINK_OUTPUT_PORT_ID "link.output_port.id" 103 #define PW_LINK_INPUT_NODE_ID "link.input_node.id" 104 #define PW_LINK_INPUT_PORT_ID "link.input_port.id" 115 #define PW_VERSION_CORE_PROXY_METHODS 0 144 void (*
sync) (
void *object, uint32_t seq);
184 const char *factory_name,
187 const struct spa_dict *props,
199 pw_core_proxy_hello(
struct pw_core_proxy *core)
205 pw_core_proxy_update_types(
struct pw_core_proxy *core, uint32_t first_id,
const char **types, uint32_t n_types)
211 pw_core_proxy_sync(
struct pw_core_proxy *core, uint32_t seq)
216 static inline struct pw_registry_proxy *
217 pw_core_proxy_get_registry(
struct pw_core_proxy *core, uint32_t type, uint32_t version,
size_t user_data_size)
221 return (
struct pw_registry_proxy *) p;
225 pw_core_proxy_client_update(
struct pw_core_proxy *core,
const struct spa_dict *props)
231 pw_core_proxy_permissions(
struct pw_core_proxy *core,
const struct spa_dict *props)
237 pw_core_proxy_create_object(
struct pw_core_proxy *core,
238 const char *factory_name,
241 const struct spa_dict *props,
242 size_t user_data_size)
251 pw_core_proxy_destroy(
struct pw_core_proxy *core, uint32_t
id)
256 #define PW_CORE_PROXY_EVENT_UPDATE_TYPES 0 257 #define PW_CORE_PROXY_EVENT_DONE 1 258 #define PW_CORE_PROXY_EVENT_ERROR 2 259 #define PW_CORE_PROXY_EVENT_REMOVE_ID 3 260 #define PW_CORE_PROXY_EVENT_INFO 4 261 #define PW_CORE_PROXY_EVENT_NUM 5 268 #define PW_VERSION_CORE_PROXY_EVENTS 0 290 void (*
done) (
void *object, uint32_t seq);
303 void (*
error) (
void *object, uint32_t id,
int res,
const char *
error, ...);
324 pw_core_proxy_add_listener(
struct pw_core_proxy *core,
325 struct spa_hook *listener,
333 #define pw_core_resource_update_types(r,...) pw_resource_notify(r,struct pw_core_proxy_events,update_types,__VA_ARGS__) 334 #define pw_core_resource_done(r,...) pw_resource_notify(r,struct pw_core_proxy_events,done,__VA_ARGS__) 335 #define pw_core_resource_error(r,...) pw_resource_notify(r,struct pw_core_proxy_events,error,__VA_ARGS__) 336 #define pw_core_resource_remove_id(r,...) pw_resource_notify(r,struct pw_core_proxy_events,remove_id,__VA_ARGS__) 337 #define pw_core_resource_info(r,...) pw_resource_notify(r,struct pw_core_proxy_events,info,__VA_ARGS__) 340 #define PW_VERSION_REGISTRY 0 373 #define PW_REGISTRY_PROXY_METHOD_BIND 0 374 #define PW_REGISTRY_PROXY_METHOD_NUM 1 378 #define PW_VERSION_REGISTRY_PROXY_METHODS 0 392 void (*
bind) (
void *object, uint32_t id, uint32_t type, uint32_t
version, uint32_t new_id);
397 pw_registry_proxy_bind(
struct pw_registry_proxy *registry,
398 uint32_t
id, uint32_t type, uint32_t version,
399 size_t user_data_size)
407 #define PW_REGISTRY_PROXY_EVENT_GLOBAL 0 408 #define PW_REGISTRY_PROXY_EVENT_GLOBAL_REMOVE 1 409 #define PW_REGISTRY_PROXY_EVENT_NUM 2 413 #define PW_VERSION_REGISTRY_PROXY_EVENTS 0 428 void (*
global) (
void *object, uint32_t id, uint32_t parent_id,
429 uint32_t permissions, uint32_t type, uint32_t
version,
430 const struct spa_dict *props);
444 pw_registry_proxy_add_listener(
struct pw_registry_proxy *registry,
445 struct spa_hook *listener,
452 #define pw_registry_resource_global(r,...) pw_resource_notify(r,struct pw_registry_proxy_events,global,__VA_ARGS__) 453 #define pw_registry_resource_global_remove(r,...) pw_resource_notify(r,struct pw_registry_proxy_events,global_remove,__VA_ARGS__) 456 #define PW_VERSION_MODULE 0 458 #define PW_MODULE_PROXY_EVENT_INFO 0 459 #define PW_MODULE_PROXY_EVENT_NUM 1 463 #define PW_VERSION_MODULE_PROXY_EVENTS 0 474 pw_module_proxy_add_listener(
struct pw_module_proxy *module,
475 struct spa_hook *listener,
482 #define pw_module_resource_info(r,...) pw_resource_notify(r,struct pw_module_proxy_events,info,__VA_ARGS__) 484 #define PW_VERSION_NODE 0 486 #define PW_NODE_PROXY_EVENT_INFO 0 487 #define PW_NODE_PROXY_EVENT_PARAM 1 488 #define PW_NODE_PROXY_EVENT_NUM 2 492 #define PW_VERSION_NODE_PROXY_EVENTS 0 511 uint32_t
id, uint32_t index, uint32_t next,
512 const struct spa_pod *
param);
516 pw_node_proxy_add_listener(
struct pw_node_proxy *node,
517 struct spa_hook *listener,
524 #define pw_node_resource_info(r,...) pw_resource_notify(r,struct pw_node_proxy_events,info,__VA_ARGS__) 525 #define pw_node_resource_param(r,...) pw_resource_notify(r,struct pw_node_proxy_events,param,__VA_ARGS__) 527 #define PW_NODE_PROXY_METHOD_ENUM_PARAMS 0 528 #define PW_NODE_PROXY_METHOD_NUM 1 532 #define PW_VERSION_NODE_PROXY_METHODS 0 545 void (*
enum_params) (
void *object, uint32_t id, uint32_t start, uint32_t num,
546 const struct spa_pod *filter);
551 pw_node_proxy_enum_params(
struct pw_node_proxy *node, uint32_t
id, uint32_t index,
552 uint32_t num,
const struct spa_pod *filter)
555 id, index, num, filter);
558 #define PW_VERSION_PORT 0 560 #define PW_PORT_PROXY_EVENT_INFO 0 561 #define PW_PORT_PROXY_EVENT_PARAM 1 562 #define PW_PORT_PROXY_EVENT_NUM 2 566 #define PW_VERSION_PORT_PROXY_EVENTS 0 585 uint32_t
id, uint32_t index, uint32_t next,
586 const struct spa_pod *
param);
590 pw_port_proxy_add_listener(
struct pw_port_proxy *port,
591 struct spa_hook *listener,
598 #define pw_port_resource_info(r,...) pw_resource_notify(r,struct pw_port_proxy_events,info,__VA_ARGS__) 599 #define pw_port_resource_param(r,...) pw_resource_notify(r,struct pw_port_proxy_events,param,__VA_ARGS__) 601 #define PW_PORT_PROXY_METHOD_ENUM_PARAMS 0 602 #define PW_PORT_PROXY_METHOD_NUM 1 606 #define PW_VERSION_PORT_PROXY_METHODS 0 619 void (*
enum_params) (
void *object, uint32_t id, uint32_t start, uint32_t num,
620 const struct spa_pod *filter);
625 pw_port_proxy_enum_params(
struct pw_port_proxy *port, uint32_t
id, uint32_t index,
626 uint32_t num,
const struct spa_pod *filter)
629 id, index, num, filter);
632 #define PW_VERSION_FACTORY 0 634 #define PW_FACTORY_PROXY_EVENT_INFO 0 635 #define PW_FACTORY_PROXY_EVENT_NUM 1 639 #define PW_VERSION_FACTORY_PROXY_EVENTS 0 651 pw_factory_proxy_add_listener(
struct pw_factory_proxy *factory,
652 struct spa_hook *listener,
659 #define pw_factory_resource_info(r,...) pw_resource_notify(r,struct pw_factory_proxy_events,info,__VA_ARGS__) 661 #define PW_VERSION_CLIENT 0 663 #define PW_CLIENT_PROXY_EVENT_INFO 0 664 #define PW_CLIENT_PROXY_EVENT_NUM 1 668 #define PW_VERSION_CLIENT_PROXY_EVENTS 0 680 pw_client_proxy_add_listener(
struct pw_client_proxy *client,
681 struct spa_hook *listener,
688 #define pw_client_resource_info(r,...) pw_resource_notify(r,struct pw_client_proxy_events,info,__VA_ARGS__) 691 #define PW_VERSION_LINK 0 693 #define PW_LINK_PROXY_EVENT_INFO 0 694 #define PW_LINK_PROXY_EVENT_NUM 1 698 #define PW_VERSION_LINK_PROXY_EVENTS 0 710 pw_link_proxy_add_listener(
struct pw_link_proxy *link,
711 struct spa_hook *listener,
718 #define pw_link_resource_info(r,...) pw_resource_notify(r,struct pw_link_proxy_events,info,__VA_ARGS__) void(* update_types)(void *object, uint32_t first_id, const char **types, uint32_t n_types)
Update the type map.
Definition: interfaces.h:279
uint32_t version
Definition: interfaces.h:464
uint32_t version
Definition: interfaces.h:669
void(* bind)(void *object, uint32_t id, uint32_t type, uint32_t version, uint32_t new_id)
Bind to a global object.
Definition: interfaces.h:392
void(* global)(void *object, uint32_t id, uint32_t parent_id, uint32_t permissions, uint32_t type, uint32_t version, const struct spa_dict *props)
Notify of a new global object.
Definition: interfaces.h:428
void(* client_update)(void *object, const struct spa_dict *props)
Update the client properties.
Definition: interfaces.h:158
Module events.
Definition: interfaces.h:462
void(* destroy)(void *object, uint32_t id)
Destroy an object id.
Definition: interfaces.h:195
void(* info)(void *object, struct pw_port_info *info)
Notify port info.
Definition: interfaces.h:573
uint32_t version
Definition: interfaces.h:533
void(* get_registry)(void *object, uint32_t version, uint32_t new_id)
Get the registry object.
Definition: interfaces.h:153
void(* info)(void *object, struct pw_module_info *info)
Notify module info.
Definition: interfaces.h:470
Definition: introspect.h:168
uint32_t version
Definition: interfaces.h:699
The core information.
Definition: introspect.h:76
void(* hello)(void *object)
Start a conversation with the server.
Definition: interfaces.h:121
void(* permissions)(void *object, const struct spa_dict *props)
Manage the permissions of the global objects.
Definition: interfaces.h:171
uint32_t version
Definition: interfaces.h:414
Factory events.
Definition: interfaces.h:638
Represents an object on the client side.
uint32_t pw_proxy_get_id(struct pw_proxy *proxy)
Get the local id of the proxy.
Definition: proxy.c:83
Node events.
Definition: interfaces.h:491
Port methods.
Definition: interfaces.h:605
#define pw_proxy_do(p, type, method,...)
Definition: proxy.h:149
void pw_proxy_add_proxy_listener(struct pw_proxy *proxy, struct spa_hook *listener, const void *events, void *data)
Add a listener for the events received from the remote resource.
Definition: proxy.c:101
void(* enum_params)(void *object, uint32_t id, uint32_t start, uint32_t num, const struct spa_pod *filter)
Enumerate port parameters.
Definition: interfaces.h:619
void(* param)(void *object, uint32_t id, uint32_t index, uint32_t next, const struct spa_pod *param)
Notify a node param.
Definition: interfaces.h:510
void(* remove_id)(void *object, uint32_t id)
Remove an object ID.
Definition: interfaces.h:314
uint32_t version
Definition: interfaces.h:379
uint32_t id
id of the global
Definition: introspect.h:169
void(* error)(void *object, uint32_t id, int res, const char *error,...)
Fatal error event.
Definition: interfaces.h:303
uint32_t version
Definition: interfaces.h:567
uint32_t id
id of the global
Definition: introspect.h:143
The client information.
Definition: introspect.h:125
Link events.
Definition: interfaces.h:697
void(* info)(void *object, struct pw_factory_info *info)
Notify factory info.
Definition: interfaces.h:646
Port events.
Definition: interfaces.h:565
void(* info)(void *object, struct pw_client_info *info)
Notify client info.
Definition: interfaces.h:675
uint32_t version
Definition: interfaces.h:493
void(* done)(void *object, uint32_t seq)
Emit a done event.
Definition: interfaces.h:290
void(* global_remove)(void *object, uint32_t id)
Notify of a global object removal.
Definition: interfaces.h:440
void(* param)(void *object, uint32_t id, uint32_t index, uint32_t next, const struct spa_pod *param)
Notify a port param.
Definition: interfaces.h:584
Core events
Definition: interfaces.h:267
uint32_t version
Definition: interfaces.h:640
The link information.
Definition: introspect.h:204
The factory information.
Definition: introspect.h:186
void(* create_object)(void *object, const char *factory_name, uint32_t type, uint32_t version, const struct spa_dict *props, uint32_t new_id)
Create a new object on the PipeWire server from a factory.
Definition: interfaces.h:183
The module information.
Definition: introspect.h:103
Client events.
Definition: interfaces.h:667
void(* enum_params)(void *object, uint32_t id, uint32_t start, uint32_t num, const struct spa_pod *filter)
Enumerate node parameters.
Definition: interfaces.h:545
uint32_t version
Definition: interfaces.h:116
struct pw_proxy * pw_proxy_new(struct pw_proxy *factory, uint32_t type, size_t user_data_size)
Create a proxy object with a given id and type.
Definition: proxy.c:46
void(* info)(void *object, struct pw_link_info *info)
Notify link info.
Definition: interfaces.h:705
uint32_t version
Definition: interfaces.h:269
Node methods.
Definition: interfaces.h:531
Registry methods.
Definition: interfaces.h:377
void(* info)(void *object, struct pw_core_info *info)
Notify new core info.
Definition: interfaces.h:320
uint32_t version
Definition: interfaces.h:607
The node information.
Definition: introspect.h:142
void(* update_types)(void *object, uint32_t first_id, const char **types, uint32_t n_types)
Update the type map.
Definition: interfaces.h:131
void(* info)(void *object, struct pw_node_info *info)
Notify node info.
Definition: interfaces.h:499
Core methods.
Definition: interfaces.h:114
Registry events.
Definition: interfaces.h:412
void(* sync)(void *object, uint32_t seq)
Do server roundtrip.
Definition: interfaces.h:144