Go to the documentation of this file.
25 #ifndef PIPEWIRE_IMPL_DEVICE_H
26 #define PIPEWIRE_IMPL_DEVICE_H
45 #include <spa/monitor/device.h>
54 #define PW_VERSION_IMPL_DEVICE_EVENTS 0
70 size_t user_data_size);
89 struct spa_hook *listener,
98 int seq, uint32_t param_id,
99 uint32_t index, uint32_t max,
100 const struct spa_pod *
filter,
101 int (*callback) (
void *
data,
int seq,
102 uint32_t
id, uint32_t index, uint32_t next,
103 struct spa_pod *
param),
static uint32_t int int res
Definition: core.h:326
#define PW_VERSION_IMPL_DEVICE_EVENTS
Definition: impl-device.h:54
static uint32_t id
Definition: core.h:325
SPA_EXPORT 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:911
#define PW_KEY_DEVICE_API
API this device is accessed with.
Definition: keys.h:182
uint32_t subscribe_ids[MAX_PARAMS]
Definition: impl-device.c:66
#define pw_log_error(...)
Log an error message.
struct pw_impl_device * device
Definition: impl-device.c:60
int seq
Definition: impl-device.c:55
struct spa_param_info * pi
Definition: impl-device.c:73
SPA_EXPORT void pw_global_destroy(struct pw_global *global)
Destroy a global.
Definition: global.c:373
SPA_EXPORT struct pw_global * pw_impl_device_get_global(struct pw_impl_device *device)
Get the global of this device.
Definition: impl-device.c:905
#define OBJECT_DEVICE
Definition: impl-device.c:82
Definition: impl-core.c:37
int seq
Definition: impl-device.c:70
#define PW_KEY_OBJECT_ID
a global object id
Definition: keys.h:60
SPA_EXPORT 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:290
uint32_t type
Definition: impl-device.c:83
struct spa_hook resource_listener
Definition: impl-core.c:39
struct spa_list param_list
Definition: impl-device.c:39
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:911
Global events, use pw_global_add_listener.
Definition: global.h:65
PipeWire client object class.
uint32_t version
Definition: impl-device.h:55
SPA_EXPORT void pw_impl_node_destroy(struct pw_impl_node *node)
Destroy a node.
Definition: impl-node.c:1655
void pw_resource_errorf(struct pw_resource *resource, int res, const char *error,...) SPA_PRINTF_FUNC(3
#define NAME
Definition: impl-device.c:34
int pw_impl_device_set_implementation(struct pw_impl_device *device, struct spa_device *spa_device)
Set the device implementation.
Definition: impl-device.c:862
void * pw_impl_device_get_user_data(struct pw_impl_device *device)
Definition: impl-device.c:899
int orig_seq
Definition: impl-device.c:71
#define PW_KEY_FACTORY_ID
Factory properties.
Definition: keys.h:224
#define PW_KEY_MODULE_ID
module properties
Definition: keys.h:214
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:258
static uint32_t int int const char int r
Definition: core.h:338
void(* free)(void *data)
the device is freed
Definition: impl-device.h:60
struct spa_handle * pw_context_load_spa_handle(struct pw_context *context, const char *factory_name, const struct spa_dict *info)
Definition: pipewire.c:58
A global object visible to remote clients.
SPA_EXPORT int pw_impl_device_set_implementation(struct pw_impl_device *device, struct spa_device *spa_device)
Set the device implementation.
Definition: impl-device.c:862
SPA_EXPORT struct spa_device * pw_impl_device_get_implementation(struct pw_impl_device *device)
Get the device implementation.
Definition: impl-device.c:879
int pw_impl_node_set_active(struct pw_impl_node *node, bool active)
Set a node active.
Definition: impl-node.c:2060
struct impl * impl
Definition: impl-device.c:50
Device methods.
Definition: device.h:100
int pw_impl_node_set_implementation(struct pw_impl_node *node, struct spa_node *spa_node)
Set the node implementation.
Definition: impl-node.c:1609
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:1073
struct spa_dict dict
dictionary of key/values
Definition: properties.h:46
#define PW_KEY_CLIENT_ID
Client properties.
Definition: keys.h:117
void pw_impl_device_destroy(struct pw_impl_device *device)
Definition: impl-device.c:193
uint32_t id
Definition: impl-device.c:80
struct spa_device * pw_impl_device_get_implementation(struct pw_impl_device *device)
Get the device implementation.
Definition: impl-device.c:879
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:1638
void(* destroy)(void *data)
the device is destroyed
Definition: impl-device.h:58
SPA_EXPORT int pw_properties_setf(struct pw_properties *properties, const char *key, const char *format,...)
Set a property value by format.
Definition: properties.c:455
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:621
SPA_EXPORT int pw_impl_device_register(struct pw_impl_device *device, struct pw_properties *properties)
Definition: impl-device.c:548
const struct pw_properties * pw_impl_device_get_properties(struct pw_impl_device *device)
Definition: impl-device.c:885
#define PW_KEY_OBJECT_PATH
unique path to construct the object
Definition: keys.h:59
#define PW_DEVICE_CHANGE_MASK_PROPS
Definition: device.h:45
#define PW_KEY_MEDIA_CLASS
class Ex: "Video/Source"
Definition: keys.h:254
#define pw_device_resource_info(r,...)
Definition: impl-device.c:46
uint32_t version
Definition: device.h:102
struct spa_hook object_listener
Definition: impl-core.c:40
SPA_EXPORT void * pw_impl_device_get_user_data(struct pw_impl_device *device)
Definition: impl-device.c:899
void(* info_changed)(void *data, const struct pw_device_info *info)
the device info changed
Definition: impl-device.h:65
#define pw_device_resource_param(r,...)
Definition: impl-device.c:47
int(* callback)(void *data, int seq, uint32_t id, uint32_t index, uint32_t next, struct spa_pod *param)
Definition: impl-device.c:52
#define PW_VERSION_IMPL_NODE_EVENTS
Definition: impl-node.h:54
int pw_global_update_keys(struct pw_global *global, const struct spa_dict *dict, const char *keys[])
Update the global properties, must be done when unregistered.
Definition: global.c:212
#define pw_log_debug(...)
Log a debug message.
#define pw_log_warn(...)
Log a warning message.
#define PW_VERSION_RESOURCE_EVENTS
Definition: resource.h:65
Definition: impl-device.c:78
struct spa_hook listener
Definition: impl-device.c:86
#define PW_KEY_DEVICE_DESCRIPTION
localized human readable device one-line description.
Definition: keys.h:184
int pw_impl_device_register(struct pw_impl_device *device, struct pw_properties *properties)
Definition: impl-device.c:548
SPA_EXPORT int pw_properties_update(struct pw_properties *props, const struct spa_dict *dict)
Update properties.
Definition: properties.c:284
#define PW_DEVICE_CHANGE_MASK_PARAMS
Definition: device.h:46
Node events, listen to them with pw_impl_node_add_listener.
Definition: impl-node.h:53
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
#define PW_VERSION_DEVICE
Definition: device.h:39
void * object
Definition: impl-device.c:85
struct spa_list pending_list
Definition: impl-device.c:40
SPA_EXPORT int pw_impl_device_update_properties(struct pw_impl_device *device, const struct spa_dict *dict)
Definition: impl-device.c:891
int pw_global_add_resource(struct pw_global *global, struct pw_resource *resource)
Add a resource to a global.
Definition: global.c:233
SPA_EXPORT const struct pw_properties * pw_impl_device_get_properties(struct pw_impl_device *device)
Definition: impl-device.c:885
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:139
unsigned int cache
Definition: impl-device.c:56
The device information.
Definition: device.h:43
unsigned int cache_params
Definition: impl-device.c:42
struct spa_handle * handle
Definition: impl-device.c:84
int end
Definition: impl-device.c:72
SPA_EXPORT struct pw_properties * pw_properties_copy(const struct pw_properties *properties)
Copy a properties object.
Definition: properties.c:226
void * data
Definition: impl-device.c:51
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:290
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 PW_DEVICE_CHANGE_MASK_ALL
Definition: device.h:47
uint32_t n_subscribe_ids
Definition: impl-device.c:67
#define PW_VERSION_GLOBAL_EVENTS
Definition: global.h:66
struct result_device_params_data data
Definition: impl-device.c:74
#define PW_KEY_DEVICE_NICK
a short device nickname
Definition: keys.h:179
SPA_EXPORT const char * pw_properties_get(const struct pw_properties *properties, const char *key)
Get a property.
Definition: properties.c:478
uint32_t id
Definition: filter.c:60
int pw_impl_node_update_properties(struct pw_impl_node *node, const struct spa_dict *dict)
Update the node properties.
Definition: impl-node.c:1240
SPA_EXPORT void pw_impl_device_destroy(struct pw_impl_device *device)
Definition: impl-device.c:193
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
SPA_EXPORT 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.
Definition: global.c:66
struct pw_control this
Definition: control.c:34
void(* initialized)(void *data)
the device is initialized
Definition: impl-device.h:62
Definition: impl-device.c:49
SPA_EXPORT 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:139
SPA_EXPORT struct pw_properties * pw_properties_new(const char *key,...)
Make a new properties object.
Definition: properties.c:99
#define PW_TYPE_INTERFACE_Device
Definition: device.h:37
static uint32_t int seq
Definition: core.h:325
struct pw_resource * resource
Definition: impl-core.c:38
SPA_EXPORT int pw_global_register(struct pw_global *global)
register a global to the context registry
Definition: global.c:127
#define OBJECT_NODE
Definition: impl-device.c:81
struct spa_hook listener
Definition: impl-device.c:75
Device events, listen to them with pw_impl_device_add_listener.
Definition: impl-device.h:53
Resource events.
Definition: resource.h:64
#define PW_VERSION_DEVICE_METHODS
Definition: device.h:101
struct pw_global * pw_impl_device_get_global(struct pw_impl_device *device)
Get the global of this device.
Definition: impl-device.c:905
int pw_impl_device_update_properties(struct pw_impl_device *device, const struct spa_dict *dict)
Definition: impl-device.c:891
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
void pw_impl_client_set_busy(struct pw_impl_client *client, bool busy)
Mark the client busy.
Definition: impl-client.c:695
int pw_unload_spa_handle(struct spa_handle *handle)
Definition: pipewire.c:308
#define PW_KEY_DEVICE_NAME
device name
Definition: keys.h:176
struct spa_list link
Definition: impl-device.c:79
A collection of key/value pairs.
Definition: properties.h:45
void * pw_impl_node_get_user_data(struct pw_impl_node *node)
Get node user_data.
Definition: impl-node.c:1200
SPA_EXPORT void pw_properties_free(struct pw_properties *properties)
Free a properties object.
Definition: properties.c:356
PipeWire device interface.