Go to the documentation of this file.
25 #ifndef PIPEWIRE_LINK_H
26 #define PIPEWIRE_LINK_H
52 #define PW_TYPE_INTERFACE_Link PW_TYPE_INFO_INTERFACE_BASE "Link"
54 #define PW_VERSION_LINK 3
77 #define PW_LINK_CHANGE_MASK_STATE (1 << 0)
78 #define PW_LINK_CHANGE_MASK_FORMAT (1 << 1)
79 #define PW_LINK_CHANGE_MASK_PROPS (1 << 2)
80 #define PW_LINK_CHANGE_MASK_ALL ((1 << 3)-1)
100 #define PW_LINK_EVENT_INFO 0
101 #define PW_LINK_EVENT_NUM 1
105 #define PW_VERSION_LINK_EVENTS 0
115 #define PW_LINK_METHOD_ADD_LISTENER 0
116 #define PW_LINK_METHOD_NUM 1
120 #define PW_VERSION_LINK_METHODS 0
129 #define pw_link_method(o,method,version,...) \
131 int _res = -ENOTSUP; \
132 spa_interface_call_res((struct spa_interface*)o, \
133 struct pw_link_methods, _res, \
134 method, version, ##__VA_ARGS__); \
138 #define pw_link_add_listener(c,...) pw_link_method(c,add_listener,0,__VA_ARGS__)
#define PW_KEY_DEVICE_NAME
device name
Definition: src/pipewire/keys.h:211
int int const char * pw_properties_get(const struct pw_properties *properties, const char *key)
Get a property.
Definition: properties.c:487
Definition: module-filter-chain.c:183
@ SPA_PARAM_Profile
profile configuration as SPA_TYPE_OBJECT_ParamProfile
Definition: param.h:53
void(* info)(void *object, const struct pw_link_info *info)
Notify link info.
Definition: link.h:112
struct spa_hook listener
Definition: alsa-monitor.c:172
struct pw_link_info * pw_link_info_update(struct pw_link_info *info, const struct pw_link_info *update)
Definition: introspect.c:552
struct pw_properties * props
Definition: alsa-monitor.c:141
struct spa_list device_list
Definition: alsa-monitor.c:195
#define PW_VERSION_NODE
Definition: src/pipewire/node.h:52
uint32_t input_port_id
input port id
Definition: link.h:76
PW_LOG_TOPIC_STATIC(mod_topic, "ms.mod." NAME)
uint32_t id
id of the global
Definition: link.h:72
int priority
Definition: alsa-monitor.c:160
#define SPA_POD_Int(val)
Definition: vararg.h:59
int pw_properties_update(struct pw_properties *props, const struct spa_dict *dict)
Update properties.
Definition: properties.c:298
#define SPA_TYPE_INTERFACE_Device
Definition: obj-x86_64-linux-gnu/doc/spa/monitor/device.h:50
#define SPA_KEY_DEVICE_NICK
the device short name
Definition: obj-x86_64-linux-gnu/doc/spa/monitor/device.h:264
@ PW_LINK_STATE_NEGOTIATING
the link is negotiating formats
Definition: link.h:62
Definition: obj-x86_64-linux-gnu/doc/spa/monitor/device.h:53
Link methods.
Definition: link.h:119
#define PW_LOG_TOPIC_INIT(var)
Definition: src/pipewire/log.h:136
struct spa_list link
link in impl node_list
Definition: module-filter-chain.c:163
user data to add to an object
Definition: filter.c:75
#define SPA_KEY_DEVICE_DESCRIPTION
a device description
Definition: obj-x86_64-linux-gnu/doc/spa/monitor/device.h:265
uint8_t data[MAX_BUFFER]
Definition: module-profiler.c:90
bool spa_streq(const char *s1, const char *s2)
Definition: string.h:50
Link events.
Definition: link.h:104
#define spa_list_for_each(pos, head, member)
Definition: list.h:111
@ PW_LINK_STATE_PAUSED
the link is paused
Definition: link.h:64
const struct spa_dict * props
extra object properties
Definition: obj-x86_64-linux-gnu/doc/spa/monitor/device.h:92
const struct spa_dict * props
device properties
Definition: obj-x86_64-linux-gnu/doc/spa/monitor/device.h:69
struct impl * impl
Definition: alsa-monitor.c:150
const char * error
an error reason if state is error
Definition: link.h:83
uint64_t change_mask
bitfield of changed fields since last call
Definition: link.h:81
struct spa_hook listener
Definition: access-flatpak.c:65
Definition: alsa-monitor.c:149
Definition: module-filter-chain.c:162
uint32_t version
Definition: link.h:106
#define PW_KEY_DEVICE_PRODUCT_NAME
product name if applicable
Definition: src/pipewire/keys.h:227
void pw_proxy_destroy(struct pw_proxy *proxy)
destroy a proxy
Definition: proxy.c:231
int profile
Definition: alsa-monitor.c:162
struct spa_hook session_listener
Definition: alsa-monitor.c:185
Definition: pipewire.c:71
uint32_t id
Definition: module-echo-cancel.c:143
struct pw_properties * pw_properties_new_dict(const struct spa_dict *dict)
Make a new properties object from the given dictionary.
Definition: properties.c:126
#define SPA_POD_BUILDER_INIT(buffer, size)
Definition: builder.h:71
#define SPA_VERSION_DEVICE_EVENTS
version of the structure
Definition: obj-x86_64-linux-gnu/doc/spa/monitor/device.h:119
struct spa_audio_info_raw info
Definition: module-echo-cancel.c:149
struct spa_dict dict
dictionary of key/values
Definition: properties.h:50
#define NAME
Definition: libcamera-monitor.c:50
#define spa_list_consume(pos, head, member)
Definition: list.h:96
#define SPA_TYPE_INTERFACE_Node
Definition: obj-x86_64-linux-gnu/doc/spa/node/node.h:50
struct impl * impl
Definition: alsa-monitor.c:135
struct sm_device * sdevice
Definition: alsa-monitor.c:171
@ SPA_TYPE_OBJECT_ParamProfile
Definition: obj-x86_64-linux-gnu/doc/spa/utils/type.h:94
@ PW_LINK_STATE_ERROR
the link is in error
Definition: link.h:59
void spa_list_remove(struct spa_list *elem)
Definition: list.h:69
struct spa_handle * handle
Definition: alsa-monitor.c:190
@ PW_LINK_STATE_ALLOCATING
the link is allocating buffers
Definition: link.h:63
const char * pw_link_state_as_string(enum pw_link_state state)
Convert a pw_link_state to a readable string.
Definition: introspect.c:64
#define PW_TYPE_INTERFACE_Node
Definition: src/pipewire/node.h:50
enum pw_link_state state
the current state of the link
Definition: link.h:82
#define PW_KEY_NODE_DESCRIPTION
localized human readable node one-line description.
Definition: src/pipewire/keys.h:140
const char * factory_name
a factory name that implements the object
Definition: obj-x86_64-linux-gnu/doc/spa/monitor/device.h:86
#define PW_KEY_NODE_NAME
node name
Definition: src/pipewire/keys.h:138
Definition: obj-x86_64-linux-gnu/doc/spa/node/node.h:53
uint32_t input_node_id
server side input node id
Definition: link.h:75
void pw_link_info_free(struct pw_link_info *info)
Definition: introspect.c:559
#define SPA_KEY_DEVICE_NAME
the name of the device
Definition: obj-x86_64-linux-gnu/doc/spa/monitor/device.h:262
@ PW_LINK_STATE_INIT
the link is initialized
Definition: link.h:61
#define PW_KEY_DEVICE_DESCRIPTION
localized human readable device one-line description.
Definition: src/pipewire/keys.h:219
#define SPA_KEY_DEVICE_ALIAS
alternative name of the device
Definition: obj-x86_64-linux-gnu/doc/spa/monitor/device.h:263
@ SPA_LOG_LEVEL_DEBUG
Definition: obj-x86_64-linux-gnu/doc/spa/support/log.h:62
void spa_list_init(struct spa_list *list)
Definition: list.h:44
struct spa_node * node
Definition: alsa-monitor.c:143
struct spa_handle * handle
Definition: alsa-monitor.c:167
#define pw_log_level_enabled(lev)
Check if a loglevel is enabled.
Definition: src/pipewire/log.h:140
Definition: utils/dict.h:48
#define SPA_KEY_DEVICE_BUS_ID
the device bus-id
Definition: obj-x86_64-linux-gnu/doc/spa/monitor/device.h:272
const char * type
the object type managed by this device
Definition: obj-x86_64-linux-gnu/doc/spa/monitor/device.h:85
int spa_debug_dict(int indent, const struct spa_dict *dict)
Definition: debug/dict.h:43
struct spa_handle * pw_context_load_spa_handle(struct pw_context *context, const char *factory_name, const struct spa_dict *info)
Definition: context.c:1401
#define spa_strerror(err)
Definition: result.h:51
uint32_t id
Definition: alsa-monitor.c:152
struct device * device
Definition: alsa-monitor.c:137
#define spa_device_set_param(d,...)
Definition: obj-x86_64-linux-gnu/doc/spa/monitor/device.h:256
#define pw_log_debug(...)
Definition: src/pipewire/log.h:155
struct spa_hook device_listener
Definition: alsa-monitor.c:169
#define spa_handle_get_interface(h,...)
Definition: plugin.h:73
@ PW_LINK_STATE_ACTIVE
the link is active
Definition: link.h:65
struct spa_device * monitor
Definition: alsa-monitor.c:192
Information about the device and parameters it supports.
Definition: obj-x86_64-linux-gnu/doc/spa/monitor/device.h:60
int pw_unload_spa_handle(struct spa_handle *handle)
Definition: pipewire.c:333
struct pw_context * context
Definition: settings.c:43
int pw_properties_set(struct pw_properties *properties, const char *key, const char *value)
Set a property value.
Definition: properties.c:435
struct pw_link_info * pw_link_info_merge(struct pw_link_info *info, const struct pw_link_info *update, bool reset)
Definition: introspect.c:513
struct sm_media_session * session
Definition: access-flatpak.c:64
#define PW_KEY_DEVICE_ID
device properties
Definition: src/pipewire/keys.h:210
int(* add_listener)(void *object, struct spa_hook *listener, const struct pw_link_events *events, void *data)
Definition: link.h:123
#define PW_KEY_FACTORY_NAME
the name of the factory
Definition: src/pipewire/keys.h:260
uint32_t version
Definition: link.h:121
#define pw_log_warn(...)
Definition: src/pipewire/log.h:153
struct spa_device * device
Definition: alsa-monitor.c:168
struct spa_list node_list
Definition: alsa-monitor.c:180
@ SPA_PARAM_PROFILE_index
profile index (Int)
Definition: param.h:113
The link information.
Definition: link.h:71
uint32_t device_id
Definition: alsa-monitor.c:153
#define spa_pod_builder_add_object(b, type, id,...)
Definition: builder.h:650
#define SPA_KEY_DEVICE_BUS_PATH
bus path to the device in the OS' format.
Definition: obj-x86_64-linux-gnu/doc/spa/monitor/device.h:273
void spa_hook_remove(struct spa_hook *hook)
Remove a hook.
Definition: hook.h:354
uint32_t output_node_id
server side output node id
Definition: link.h:73
pw_link_state
Definition: link.h:58
uint32_t output_port_id
output port id
Definition: link.h:74
#define spa_device_add_listener(d,...)
Definition: obj-x86_64-linux-gnu/doc/spa/monitor/device.h:253
#define SPA_NAME_API_LIBCAMERA_ENUM_CLIENT
keys for libcamera factory names
Definition: names.h:129
struct pw_properties * props
Definition: alsa-monitor.c:165
struct spa_list link
Definition: alsa-monitor.c:151
struct spa_pod * format
format over link
Definition: link.h:84
unsigned int appeared
Definition: alsa-monitor.c:177
@ PW_LINK_STATE_UNLINKED
the link is unlinked
Definition: link.h:60
int pw_properties_setf(struct pw_properties *properties, const char *key, const char *format,...) 1(3
spa_device_events:
Definition: obj-x86_64-linux-gnu/doc/spa/monitor/device.h:117
struct spa_dict * props
the properties of the link
Definition: link.h:85
Information about a device object.
Definition: obj-x86_64-linux-gnu/doc/spa/monitor/device.h:81
int sm_libcamera_monitor_start(struct sm_media_session *sess)
Definition: libcamera-monitor.c:470
Definition: properties.h:49
void pw_properties_free(struct pw_properties *properties)
Free a properties object.
Definition: properties.c:364
uint32_t id
Definition: alsa-monitor.c:139
#define pw_log_error(...)
Definition: src/pipewire/log.h:152
#define spa_list_append(list, item)
Definition: list.h:81
struct pw_proxy * proxy
Definition: v4l2-monitor.c:65