Go to the documentation of this file.
25 #ifndef PIPEWIRE_IMPL_DEVICE_H
26 #define PIPEWIRE_IMPL_DEVICE_H
46 struct pw_impl_device;
57 #define PW_VERSION_IMPL_DEVICE_EVENTS 0
73 size_t user_data_size);
101 int seq, uint32_t param_id,
102 uint32_t index, uint32_t max,
104 int (*callback) (
void *
data,
int seq,
105 uint32_t
id, uint32_t index, uint32_t next,
#define PW_VERSION_IMPL_DEVICE_EVENTS
Definition: impl-device.h:57
int pw_impl_device_update_properties(struct pw_impl_device *device, const struct spa_dict *dict)
Definition: impl-device.c:903
#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:176
#define spa_device_sync(d,...)
Definition: build-12775836/doc/spa/monitor/device.h:254
uint64_t change_mask
Definition: build-12775836/doc/spa/monitor/device.h:67
struct spa_hook listener
Definition: alsa-monitor.c:105
uint32_t subscribe_ids[MAX_PARAMS]
Definition: impl-device.c:68
#define PW_TYPE_INTERFACE_Device
Definition: src/pipewire/device.h:37
int pw_properties_update(struct pw_properties *props, const struct spa_dict *dict)
Update properties.
Definition: properties.c:298
#define spa_zero(x)
Definition: defs.h:303
int pw_impl_device_register(struct pw_impl_device *device, struct pw_properties *properties)
Definition: impl-device.c:554
#define SPA_TYPE_INTERFACE_Device
Definition: build-12775836/doc/spa/monitor/device.h:50
struct pw_impl_device * device
Definition: impl-device.c:62
#define PW_KEY_OBJECT_ID
a global object id
Definition: src/pipewire/keys.h:66
const struct pw_properties * pw_impl_device_get_properties(struct pw_impl_device *device)
Definition: impl-device.c:897
int pw_global_register(struct pw_global *global)
Register a global object to the context registry.
Definition: global.c:125
int seq
Definition: impl-device.c:56
struct spa_param_info * pi
Definition: impl-device.c:75
#define OBJECT_DEVICE
Definition: impl-device.c:84
Definition: build-12775836/doc/spa/monitor/device.h:53
#define PW_KEY_MODULE_ID
module properties
Definition: src/pipewire/keys.h:249
int pw_impl_device_set_implementation(struct pw_impl_device *device, struct spa_device *spa_device)
Set the device implementation.
Definition: impl-device.c:874
Definition: impl-core.c:74
int seq
Definition: impl-device.c:72
user data to add to an object
Definition: filter.c:75
struct pw_global * pw_global_new(struct pw_context *context, const char *type, uint32_t version, struct pw_properties *properties, pw_global_bind_func_t func, void *object)
Create a new global object.
Definition: global.c:66
uint32_t type
Definition: impl-device.c:85
int pw_global_add_resource(struct pw_global *global, struct pw_resource *resource)
Add a resource to a global.
Definition: global.c:230
bool spa_streq(const char *s1, const char *s2)
Definition: string.h:50
#define PW_KEY_OBJECT_PATH
object properties
Definition: src/pipewire/keys.h:65
struct spa_hook resource_listener
Definition: impl-core.c:76
#define spa_list_for_each(pos, head, member)
Definition: list.h:111
const struct spa_dict * props
extra object properties
Definition: build-12775836/doc/spa/monitor/device.h:92
#define SPA_DEVICE_OBJECT_CHANGE_MASK_PROPS
Definition: build-12775836/doc/spa/monitor/device.h:89
struct spa_list param_list
Definition: impl-device.c:40
const struct spa_dict * props
device properties
Definition: build-12775836/doc/spa/monitor/device.h:69
int pw_impl_node_update_properties(struct pw_impl_node *node, const struct spa_dict *dict)
Update the node properties.
Definition: impl-node.c:1286
#define SPA_EXPORT
Definition: defs.h:208
int pw_impl_device_for_each_param(struct pw_impl_device *device, int seq, uint32_t param_id, uint32_t index, uint32_t max, const struct spa_pod *filter, int(*callback)(void *data, int seq, uint32_t id, uint32_t index, uint32_t next, struct spa_pod *param), void *data)
Definition: impl-device.c:293
Global events, use pw_global_add_listener.
Definition: global.h:68
uint32_t version
Definition: impl-device.h:58
#define PW_VERSION_DEVICE
Definition: src/pipewire/device.h:39
struct spa_pod * param
Definition: build-12775836/doc/spa/monitor/device.h:103
Definition: alsa-monitor.c:82
Definition: module-filter-chain.c:155
#define NAME
Definition: impl-device.c:35
int orig_seq
Definition: impl-device.c:73
#define SPA_PARAM_INFO_READ
Definition: param.h:68
int pw_impl_node_set_implementation(struct pw_impl_node *node, struct spa_node *spa_node)
Set the node implementation.
Definition: impl-node.c:1663
void spa_hook_list_append(struct spa_hook_list *list, struct spa_hook *hook, const void *funcs, void *data)
Append a hook.
Definition: hook.h:316
struct pw_global * pw_impl_device_get_global(struct pw_impl_device *device)
Get the global of this device.
Definition: impl-device.c:917
Definition: build-12775836/doc/spa/monitor/device.h:99
#define SPA_PTROFF(ptr_, offset_, type_)
Return the address (buffer + offset) as pointer of type.
Definition: defs.h:159
void(* free)(void *data)
the device is freed
Definition: impl-device.h:63
#define SPA_DEVICE_CHANGE_MASK_PROPS
Definition: build-12775836/doc/spa/monitor/device.h:65
Definition: pipewire.c:68
uint32_t id
Definition: module-echo-cancel.c:139
struct impl * impl
Definition: impl-device.c:51
Device methods.
Definition: src/pipewire/device.h:100
struct spa_dict dict
dictionary of key/values
Definition: properties.h:50
int spa_pod_filter(struct spa_pod_builder *b, struct spa_pod **result, const struct spa_pod *pod, const struct spa_pod *filter)
Definition: build-12775836/doc/spa/pod/filter.h:387
#define SPA_CONTAINER_OF(p, t, m)
Definition: defs.h:170
uint32_t flags
Definition: param.h:71
#define spa_list_consume(pos, head, member)
Definition: list.h:96
#define SPA_TYPE_INTERFACE_Node
Definition: build-12775836/doc/spa/node/node.h:50
uint32_t id
Definition: impl-device.c:82
#define spa_device_enum_params(d,...)
Definition: build-12775836/doc/spa/monitor/device.h:255
void(* destroy)(void *data)
the device is destroyed
Definition: impl-device.h:61
#define SPA_DEVICE_CHANGE_MASK_PARAMS
Definition: build-12775836/doc/spa/monitor/device.h:66
void pw_global_add_listener(struct pw_global *global, struct spa_hook *listener, const struct pw_global_events *events, void *data)
Add an event listener on the global.
Definition: global.c:255
#define PW_DEVICE_CHANGE_MASK_ALL
Definition: src/pipewire/device.h:47
void spa_list_remove(struct spa_list *elem)
Definition: list.h:69
void pw_resource_add_object_listener(struct pw_resource *resource, struct spa_hook *listener, const void *funcs, void *data)
Set the resource implementation.
Definition: resource.c:174
#define SPA_N_ELEMENTS(arr)
Definition: defs.h:109
#define pw_device_resource_info(r,...)
Definition: impl-device.c:47
uint32_t version
Definition: src/pipewire/device.h:102
struct spa_hook object_listener
Definition: impl-core.c:77
void(* info_changed)(void *data, const struct pw_device_info *info)
the device info changed
Definition: impl-device.h:68
#define PW_KEY_FACTORY_ID
Factory properties.
Definition: src/pipewire/keys.h:259
#define pw_device_resource_param(r,...)
Definition: impl-device.c:48
int(* callback)(void *data, int seq, uint32_t id, uint32_t index, uint32_t next, struct spa_pod *param)
Definition: impl-device.c:53
const char * factory_name
a factory name that implements the object
Definition: build-12775836/doc/spa/monitor/device.h:86
#define PW_KEY_DEVICE_API
API this device is accessed with.
Definition: src/pipewire/keys.h:217
A hook, contains the structure with functions and the data passed to the functions.
Definition: hook.h:295
#define PW_VERSION_IMPL_NODE_EVENTS
Definition: impl-node.h:52
void pw_resource_errorf(struct pw_resource *resource, int res, const char *error,...) 1(3
#define PW_VERSION_RESOURCE_EVENTS
Definition: resource.h:61
Definition: impl-device.c:80
struct spa_hook listener
Definition: impl-device.c:88
uint64_t flags
Definition: build-12775836/doc/spa/monitor/device.h:68
struct spa_device * pw_impl_device_get_implementation(struct pw_impl_device *device)
Get the device implementation.
Definition: impl-device.c:891
int pw_impl_node_register(struct pw_impl_node *node, struct pw_properties *properties)
Complete initialization of the node and register.
Definition: impl-node.c:650
void pw_resource_add_listener(struct pw_resource *resource, struct spa_hook *listener, const struct pw_resource_events *events, void *data)
Add an event listener.
Definition: resource.c:165
Node events, listen to them with pw_impl_node_add_listener.
Definition: impl-node.h:51
#define PW_KEY_DEVICE_DESCRIPTION
localized human readable device one-line description.
Definition: src/pipewire/keys.h:219
int pw_properties_update_ignore(struct pw_properties *props, const struct spa_dict *dict, const char *const ignore[])
Definition: properties.c:259
information about a parameter
Definition: param.h:64
void * object
Definition: impl-device.c:87
void spa_list_init(struct spa_list *list)
Definition: list.h:44
struct spa_list pending_list
Definition: impl-device.c:41
void spa_pod_builder_init(struct spa_pod_builder *builder, void *data, uint32_t size)
Definition: builder.h:96
#define PW_KEY_DEVICE_NICK
a short device nickname
Definition: src/pipewire/keys.h:214
#define SPA_VERSION_DEVICE_EVENTS
version of the structure
Definition: build-12775836/doc/spa/monitor/device.h:119
Definition: utils/dict.h:48
#define PW_VERSION_DEVICE_METHODS
Definition: src/pipewire/device.h:101
#define SPA_RESULT_IS_ASYNC(res)
Definition: result.h:46
const char * type
the object type managed by this device
Definition: build-12775836/doc/spa/monitor/device.h:85
int pw_impl_node_set_active(struct pw_impl_node *node, bool active)
Set a node active.
Definition: impl-node.c:2115
int pw_global_update_keys(struct pw_global *global, const struct spa_dict *dict, const char *const keys[])
Update the global properties, must be done when unregistered.
Definition: global.c:209
void pw_impl_client_set_busy(struct pw_impl_client *client, bool busy)
Mark the client busy.
Definition: impl-client.c:716
void pw_impl_device_add_listener(struct pw_impl_device *device, struct spa_hook *listener, const struct pw_impl_device_events *events, void *data)
Add an event listener.
Definition: impl-device.c:923
unsigned int cache
Definition: impl-device.c:58
The device information.
Definition: src/pipewire/device.h:43
unsigned int cache_params
Definition: impl-device.c: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:1340
struct spa_handle * handle
Definition: impl-device.c:86
#define spa_strerror(err)
Definition: result.h:51
uint32_t id
Definition: alsa-monitor.c:85
int end
Definition: impl-device.c:74
struct pw_resource * pw_resource_new(struct pw_impl_client *client, uint32_t id, uint32_t permissions, const char *type, uint32_t version, size_t user_data_size)
Make a new resource for client.
Definition: resource.c:43
#define spa_device_set_param(d,...)
Definition: build-12775836/doc/spa/monitor/device.h:256
struct pw_impl_device * pw_context_create_device(struct pw_context *context, struct pw_properties *properties, size_t user_data_size)
Definition: impl-device.c:141
uint32_t n_params
number of elements in params
Definition: build-12775836/doc/spa/monitor/device.h:71
char * name
Definition: default-profile.c:105
#define pw_log_debug(...)
Definition: src/pipewire/log.h:89
void * data
Definition: impl-device.c:52
Definition: module-protocol-native.c:103
#define spa_handle_get_interface(h,...)
Definition: plugin.h:73
void pw_impl_device_destroy(struct pw_impl_device *device)
Definition: impl-device.c:194
void pw_global_destroy(struct pw_global *global)
Destroy a global.
Definition: global.c:369
void * pw_impl_node_get_user_data(struct pw_impl_node *node)
Get node user_data.
Definition: impl-node.c:1237
uint32_t n_subscribe_ids
Definition: impl-device.c:69
#define SPA_MIN(a, b)
Definition: defs.h:123
Information about the device and parameters it supports.
Definition: build-12775836/doc/spa/monitor/device.h:60
#define PW_VERSION_GLOBAL_EVENTS
Definition: global.h:69
#define SPA_ID_INVALID
Definition: defs.h:182
int pw_unload_spa_handle(struct spa_handle *handle)
Definition: pipewire.c:321
uint32_t user
private user field.
Definition: param.h:72
#define PW_KEY_MEDIA_CLASS
class Ex: "Video/Source"
Definition: src/pipewire/keys.h:285
#define PW_KEY_CLIENT_ID
Client properties.
Definition: src/pipewire/keys.h:131
struct result_device_params_data data
Definition: impl-device.c:76
struct pw_impl_node * pw_context_create_node(struct pw_context *context, struct pw_properties *properties, size_t user_data_size)
Create a new node.
Definition: impl-node.c:1112
uint32_t id
enum spa_param_type
Definition: param.h:65
void * pw_impl_device_get_user_data(struct pw_impl_device *device)
Definition: impl-device.c:911
uint32_t count
Definition: impl-device.c:57
#define pw_log_warn(...)
Definition: src/pipewire/log.h:87
struct spa_device * device
Definition: alsa-monitor.c:101
struct pw_control this
Definition: control.c:34
struct pw_properties * pw_properties_copy(const struct pw_properties *properties)
Copy a properties object.
Definition: properties.c:222
#define SPA_RESULT_TYPE_DEVICE_PARAMS
the result of spa_device_enum_params()
Definition: build-12775836/doc/spa/monitor/device.h:98
uint32_t next
Definition: build-12775836/doc/spa/monitor/device.h:102
const struct spa_type_info spa_type_param[]
Definition: param/type-info.h:46
void(* initialized)(void *data)
the device is initialized
Definition: impl-device.h:65
void spa_hook_remove(struct spa_hook *hook)
Remove a hook.
Definition: hook.h:336
void * pw_resource_get_user_data(struct pw_resource *resource)
Get the user data for the resource, the size was given in pw_resource_new.
Definition: resource.c:159
Definition: impl-device.c:50
void pw_impl_node_destroy(struct pw_impl_node *node)
Destroy a node.
Definition: impl-node.c:1707
struct pw_resource * resource
Definition: impl-core.c:75
void spa_hook_list_init(struct spa_hook_list *list)
Initialize a hook list to the empty list.
Definition: hook.h:305
void pw_impl_node_add_listener(struct pw_impl_node *node, struct spa_hook *listener, const struct pw_impl_node_events *events, void *data)
Add an event listener.
Definition: impl-node.c:1692
#define OBJECT_NODE
Definition: impl-device.c:83
uint32_t id
Definition: build-12775836/doc/spa/monitor/device.h:100
#define spa_device_add_listener(d,...)
Definition: build-12775836/doc/spa/monitor/device.h:253
struct spa_hook listener
Definition: impl-device.c:77
struct pw_properties * props
Definition: alsa-monitor.c:98
struct spa_list link
Definition: alsa-monitor.c:84
struct pw_properties * pw_properties_new(const char *key,...) 1
Make a new properties object.
Definition: properties.c:98
Device events, listen to them with pw_impl_device_add_listener.
Definition: impl-device.h:56
Resource events.
Definition: resource.h:60
int pw_properties_setf(struct pw_properties *properties, const char *key, const char *format,...) 1(3
spa_device_events:
Definition: build-12775836/doc/spa/monitor/device.h:117
#define PW_DEVICE_CHANGE_MASK_PROPS
Definition: src/pipewire/device.h:45
uint32_t index
Definition: build-12775836/doc/spa/monitor/device.h:101
uint64_t change_mask
Definition: build-12775836/doc/spa/monitor/device.h:90
Information about a device object.
Definition: build-12775836/doc/spa/monitor/device.h:81
struct spa_list link
Definition: impl-device.c:81
#define PW_DEVICE_CHANGE_MASK_PARAMS
Definition: src/pipewire/device.h:46
Definition: properties.h:49
void spa_hook_list_clean(struct spa_hook_list *list)
Remove all hooks from the list.
Definition: hook.h:344
void pw_properties_free(struct pw_properties *properties)
Free a properties object.
Definition: properties.c:364
struct spa_param_info * params
supported parameters
Definition: build-12775836/doc/spa/monitor/device.h:70
#define pw_log_error(...)
Definition: src/pipewire/log.h:86
const char * spa_debug_type_find_name(const struct spa_type_info *info, uint32_t type)
Definition: types.h:68
#define spa_list_append(list, item)
Definition: list.h:81