Go to the documentation of this file.
   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 
  147         void (*
sync) (
void *object, uint32_t seq);
 
  187                                const char *factory_name,
 
  190                                const struct spa_dict *props,
 
  202 pw_core_proxy_hello(
struct pw_core_proxy *core)
 
  208 pw_core_proxy_update_types(
struct pw_core_proxy *core, uint32_t first_id, 
const char **types, uint32_t n_types)
 
  214 pw_core_proxy_sync(
struct pw_core_proxy *core, uint32_t seq)
 
  219 static inline struct pw_registry_proxy *
 
  220 pw_core_proxy_get_registry(
struct pw_core_proxy *core, uint32_t type, uint32_t version, 
size_t user_data_size)
 
  224         return (
struct pw_registry_proxy *) p;
 
  228 pw_core_proxy_client_update(
struct pw_core_proxy *core, 
const struct spa_dict *props)
 
  234 pw_core_proxy_permissions(
struct pw_core_proxy *core, 
const struct spa_dict *props)
 
  240 pw_core_proxy_create_object(
struct pw_core_proxy *core,
 
  241                             const char *factory_name,
 
  244                             const struct spa_dict *props,
 
  245                             size_t user_data_size)
 
  254 pw_core_proxy_destroy(
struct pw_core_proxy *core, uint32_t 
id)
 
  259 #define PW_CORE_PROXY_EVENT_UPDATE_TYPES 0 
  260 #define PW_CORE_PROXY_EVENT_DONE         1 
  261 #define PW_CORE_PROXY_EVENT_ERROR        2 
  262 #define PW_CORE_PROXY_EVENT_REMOVE_ID    3 
  263 #define PW_CORE_PROXY_EVENT_INFO         4 
  264 #define PW_CORE_PROXY_EVENT_NUM          5 
  271 #define PW_VERSION_CORE_PROXY_EVENTS    0 
  293         void (*
done) (
void *object, uint32_t seq);
 
  306         void (*
error) (
void *object, uint32_t id, 
int res, 
const char *
error, ...);
 
  327 pw_core_proxy_add_listener(
struct pw_core_proxy *core,
 
  328                            struct spa_hook *listener,
 
  336 #define pw_core_resource_update_types(r,...) pw_resource_notify(r,struct pw_core_proxy_events,update_types,__VA_ARGS__) 
  337 #define pw_core_resource_done(r,...)         pw_resource_notify(r,struct pw_core_proxy_events,done,__VA_ARGS__) 
  338 #define pw_core_resource_error(r,...)        pw_resource_notify(r,struct pw_core_proxy_events,error,__VA_ARGS__) 
  339 #define pw_core_resource_remove_id(r,...)    pw_resource_notify(r,struct pw_core_proxy_events,remove_id,__VA_ARGS__) 
  340 #define pw_core_resource_info(r,...)         pw_resource_notify(r,struct pw_core_proxy_events,info,__VA_ARGS__) 
  343 #define PW_VERSION_REGISTRY                     0 
  376 #define PW_REGISTRY_PROXY_METHOD_BIND           0 
  377 #define PW_REGISTRY_PROXY_METHOD_NUM            1 
  381 #define PW_VERSION_REGISTRY_PROXY_METHODS       0 
  395         void (*
bind) (
void *object, uint32_t id, uint32_t type, uint32_t 
version, uint32_t new_id);
 
  400 pw_registry_proxy_bind(
struct pw_registry_proxy *
registry,
 
  401                        uint32_t 
id, uint32_t type, uint32_t version,
 
  402                        size_t user_data_size)
 
  410 #define PW_REGISTRY_PROXY_EVENT_GLOBAL             0 
  411 #define PW_REGISTRY_PROXY_EVENT_GLOBAL_REMOVE      1 
  412 #define PW_REGISTRY_PROXY_EVENT_NUM                2 
  416 #define PW_VERSION_REGISTRY_PROXY_EVENTS        0 
  431         void (*
global) (
void *object, uint32_t id, uint32_t parent_id,
 
  432                         uint32_t permissions, uint32_t type, uint32_t 
version,
 
  433                         const struct spa_dict *props);
 
  447 pw_registry_proxy_add_listener(
struct pw_registry_proxy *
registry,
 
  448                                struct spa_hook *listener,
 
  455 #define pw_registry_resource_global(r,...)        pw_resource_notify(r,struct pw_registry_proxy_events,global,__VA_ARGS__) 
  456 #define pw_registry_resource_global_remove(r,...) pw_resource_notify(r,struct pw_registry_proxy_events,global_remove,__VA_ARGS__) 
  459 #define PW_VERSION_MODULE                       0 
  461 #define PW_MODULE_PROXY_EVENT_INFO              0 
  462 #define PW_MODULE_PROXY_EVENT_NUM               1 
  466 #define PW_VERSION_MODULE_PROXY_EVENTS  0 
  477 pw_module_proxy_add_listener(
struct pw_module_proxy *module,
 
  478                              struct spa_hook *listener,
 
  485 #define pw_module_resource_info(r,...)  pw_resource_notify(r,struct pw_module_proxy_events,info,__VA_ARGS__) 
  487 #define PW_VERSION_NODE                 0 
  489 #define PW_NODE_PROXY_EVENT_INFO        0 
  490 #define PW_NODE_PROXY_EVENT_PARAM       1 
  491 #define PW_NODE_PROXY_EVENT_NUM         2 
  495 #define PW_VERSION_NODE_PROXY_EVENTS    0 
  514                        uint32_t 
id, uint32_t index, uint32_t next,
 
  515                        const struct spa_pod *
param);
 
  519 pw_node_proxy_add_listener(
struct pw_node_proxy *node,
 
  520                            struct spa_hook *listener,
 
  527 #define pw_node_resource_info(r,...) pw_resource_notify(r,struct pw_node_proxy_events,info,__VA_ARGS__) 
  528 #define pw_node_resource_param(r,...) pw_resource_notify(r,struct pw_node_proxy_events,param,__VA_ARGS__) 
  530 #define PW_NODE_PROXY_METHOD_ENUM_PARAMS        0 
  531 #define PW_NODE_PROXY_METHOD_NUM                1 
  535 #define PW_VERSION_NODE_PROXY_METHODS   0 
  548         void (*
enum_params) (
void *object, uint32_t id, uint32_t start, uint32_t num,
 
  549                         const struct spa_pod *filter);
 
  554 pw_node_proxy_enum_params(
struct pw_node_proxy *node, uint32_t 
id, uint32_t index,
 
  555                 uint32_t num, 
const struct spa_pod *filter)
 
  558                         id, index, num, filter);
 
  561 #define PW_VERSION_PORT                 0 
  563 #define PW_PORT_PROXY_EVENT_INFO        0 
  564 #define PW_PORT_PROXY_EVENT_PARAM       1 
  565 #define PW_PORT_PROXY_EVENT_NUM         2 
  569 #define PW_VERSION_PORT_PROXY_EVENTS    0 
  588                        uint32_t 
id, uint32_t index, uint32_t next,
 
  589                        const struct spa_pod *
param);
 
  593 pw_port_proxy_add_listener(
struct pw_port_proxy *port,
 
  594                            struct spa_hook *listener,
 
  601 #define pw_port_resource_info(r,...) pw_resource_notify(r,struct pw_port_proxy_events,info,__VA_ARGS__) 
  602 #define pw_port_resource_param(r,...) pw_resource_notify(r,struct pw_port_proxy_events,param,__VA_ARGS__) 
  604 #define PW_PORT_PROXY_METHOD_ENUM_PARAMS        0 
  605 #define PW_PORT_PROXY_METHOD_NUM                1 
  609 #define PW_VERSION_PORT_PROXY_METHODS   0 
  622         void (*
enum_params) (
void *object, uint32_t id, uint32_t start, uint32_t num,
 
  623                         const struct spa_pod *filter);
 
  628 pw_port_proxy_enum_params(
struct pw_port_proxy *port, uint32_t 
id, uint32_t index,
 
  629                 uint32_t num, 
const struct spa_pod *filter)
 
  632                         id, index, num, filter);
 
  635 #define PW_VERSION_FACTORY                      0 
  637 #define PW_FACTORY_PROXY_EVENT_INFO             0 
  638 #define PW_FACTORY_PROXY_EVENT_NUM              1 
  642 #define PW_VERSION_FACTORY_PROXY_EVENTS 0 
  654 pw_factory_proxy_add_listener(
struct pw_factory_proxy *factory,
 
  655                               struct spa_hook *listener,
 
  662 #define pw_factory_resource_info(r,...) pw_resource_notify(r,struct pw_factory_proxy_events,info,__VA_ARGS__) 
  664 #define PW_VERSION_CLIENT                       0 
  666 #define PW_CLIENT_PROXY_EVENT_INFO              0 
  667 #define PW_CLIENT_PROXY_EVENT_NUM               1 
  671 #define PW_VERSION_CLIENT_PROXY_EVENTS  0 
  683 pw_client_proxy_add_listener(
struct pw_client_proxy *client,
 
  684                              struct spa_hook *listener,
 
  691 #define pw_client_resource_info(r,...) pw_resource_notify(r,struct pw_client_proxy_events,info,__VA_ARGS__) 
  694 #define PW_VERSION_LINK                 0 
  696 #define PW_LINK_PROXY_EVENT_INFO        0 
  697 #define PW_LINK_PROXY_EVENT_NUM 1 
  701 #define PW_VERSION_LINK_PROXY_EVENTS    0 
  713 pw_link_proxy_add_listener(
struct pw_link_proxy *link,
 
  714                            struct spa_hook *listener,
 
  721 #define pw_link_resource_info(r,...)      pw_resource_notify(r,struct pw_link_proxy_events,info,__VA_ARGS__) 
  
 
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:395
void(* remove_id)(void *object, uint32_t id)
Remove an object ID.
Definition: interfaces.h:317
Registry methods.
Definition: interfaces.h:380
void(* info)(void *object, struct pw_port_info *info)
Notify port info.
Definition: interfaces.h:576
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:622
void(* sync)(void *object, uint32_t seq)
Do server roundtrip.
Definition: interfaces.h:147
Node events.
Definition: interfaces.h:494
void(* info)(void *object, struct pw_module_info *info)
Notify module info.
Definition: interfaces.h:473
void(* done)(void *object, uint32_t seq)
Emit a done event.
Definition: interfaces.h:293
The core information.
Definition: introspect.h:76
void(* client_update)(void *object, const struct spa_dict *props)
Update the client properties.
Definition: interfaces.h:161
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:513
Link events.
Definition: interfaces.h:700
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:587
void(* update_types)(void *object, uint32_t first_id, const char **types, uint32_t n_types)
Update the type map.
Definition: interfaces.h:134
Port events.
Definition: interfaces.h:568
void(* info)(void *object, struct pw_client_info *info)
Notify client info.
Definition: interfaces.h:678
Module events.
Definition: interfaces.h:465
Factory events.
Definition: interfaces.h:641
uint32_t version
Definition: interfaces.h:702
uint32_t version
Definition: interfaces.h:272
void(* hello)(void *object)
Start a conversation with the server.
Definition: interfaces.h:124
uint32_t version
Definition: interfaces.h:382
void(* global_remove)(void *object, uint32_t id)
Notify of a global object removal.
Definition: interfaces.h:443
Definition: introspect.h:168
Core events.
Definition: interfaces.h:270
Client events.
Definition: interfaces.h:670
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:186
void(* error)(void *object, uint32_t id, int res, const char *error,...)
Fatal error event.
Definition: interfaces.h:306
uint32_t id
id of the global
Definition: introspect.h:143
void(* update_types)(void *object, uint32_t first_id, const char **types, uint32_t n_types)
Update the type map.
Definition: interfaces.h:282
Represents an object on the client side.
void(* info)(void *object, struct pw_link_info *info)
Notify link info.
Definition: interfaces.h:708
uint32_t version
Definition: interfaces.h:672
The client information.
Definition: introspect.h:125
void(* info)(void *object, struct pw_core_info *info)
Notify new core info.
Definition: interfaces.h:323
#define pw_proxy_do(p, type, method,...)
Definition: proxy.h:149
void(* info)(void *object, struct pw_factory_info *info)
Notify factory info.
Definition: interfaces.h:649
void(* permissions)(void *object, const struct spa_dict *props)
Manage the permissions of the global objects.
Definition: interfaces.h:174
uint32_t version
Definition: interfaces.h:116
The module information.
Definition: introspect.h:103
SPA_EXPORT 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:47
Port methods.
Definition: interfaces.h:608
uint32_t pw_proxy_get_id(struct pw_proxy *proxy)
Get the local id of the proxy.
Definition: proxy.c:86
uint32_t version
Definition: interfaces.h:570
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:431
Core methods.
Definition: interfaces.h:114
uint32_t version
Definition: interfaces.h:536
The factory information.
Definition: introspect.h:186
Registry events.
Definition: interfaces.h:415
uint32_t version
Definition: interfaces.h:467
uint32_t id
id of the global
Definition: introspect.h:169
void(* info)(void *object, struct pw_node_info *info)
Notify node info.
Definition: interfaces.h:502
void(* get_registry)(void *object, uint32_t version, uint32_t new_id)
Get the registry object.
Definition: interfaces.h:156
Definition: pipewire.c:54
The link information.
Definition: introspect.h:204
uint32_t version
Definition: interfaces.h:643
uint32_t version
Definition: interfaces.h:610
uint32_t version
Definition: interfaces.h:496
void(* destroy)(void *object, uint32_t id)
Destroy an object id.
Definition: interfaces.h:198
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:548
The node information.
Definition: introspect.h:142
Node methods.
Definition: interfaces.h:534
uint32_t version
Definition: interfaces.h:417
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:107