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:820
#define PW_KEY_DEVICE_API
API this device is accessed with.
Definition: keys.h:176
uint32_t subscribe_ids[MAX_PARAMS]
Definition: impl-device.c:57
#define pw_log_error(...)
struct pw_impl_device * device
Definition: impl-device.c:51
SPA_EXPORT void pw_global_destroy(struct pw_global *global)
Destroy a global.
Definition: global.c:377
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:814
#define OBJECT_DEVICE
Definition: impl-device.c:72
Definition: impl-core.c:37
int seq
Definition: impl-device.c:61
#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:258
uint32_t type
Definition: impl-device.c:73
struct spa_hook resource_listener
Definition: impl-core.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:820
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:1627
void pw_resource_errorf(struct pw_resource *resource, int res, const char *error,...) SPA_PRINTF_FUNC(3
#define NAME
Definition: impl-device.c:33
int pw_impl_device_set_implementation(struct pw_impl_device *device, struct spa_device *spa_device)
Set the device implementation.
Definition: impl-device.c:771
void * pw_impl_device_get_user_data(struct pw_impl_device *device)
Definition: impl-device.c:808
int orig_seq
Definition: impl-device.c:62
#define PW_KEY_FACTORY_ID
Factory properties.
Definition: keys.h:217
#define PW_KEY_MODULE_ID
module properties
Definition: keys.h:207
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:262
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:771
SPA_EXPORT struct spa_device * pw_impl_device_get_implementation(struct pw_impl_device *device)
Get the device implementation.
Definition: impl-device.c:788
int pw_impl_node_set_active(struct pw_impl_node *node, bool active)
Set a node active.
Definition: impl-node.c:1980
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:1581
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:1058
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:180
uint32_t id
Definition: impl-device.c:70
struct spa_device * pw_impl_device_get_implementation(struct pw_impl_device *device)
Get the device implementation.
Definition: impl-device.c:788
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:1610
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:433
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:616
SPA_EXPORT int pw_impl_device_register(struct pw_impl_device *device, struct pw_properties *properties)
Definition: impl-device.c:468
const struct pw_properties * pw_impl_device_get_properties(struct pw_impl_device *device)
Definition: impl-device.c:794
#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:247
#define pw_device_resource_info(r,...)
Definition: impl-device.c:40
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:808
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:41
int(* callback)(void *data, int seq, uint32_t id, uint32_t index, uint32_t next, struct spa_pod *param)
Definition: impl-device.c:45
#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:215
#define pw_log_debug(...)
#define PW_VERSION_RESOURCE_EVENTS
Definition: resource.h:65
Definition: impl-device.c:68
struct spa_hook listener
Definition: impl-device.c:76
#define PW_KEY_DEVICE_DESCRIPTION
localized human readable device one-line description.
Definition: keys.h:178
int pw_impl_device_register(struct pw_impl_device *device, struct pw_properties *properties)
Definition: impl-device.c:468
SPA_EXPORT int pw_properties_update(struct pw_properties *props, const struct spa_dict *dict)
Update properties.
Definition: properties.c:263
#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:75
SPA_EXPORT int pw_impl_device_update_properties(struct pw_impl_device *device, const struct spa_dict *dict)
Definition: impl-device.c:800
int pw_global_add_resource(struct pw_global *global, struct pw_resource *resource)
Add a resource to a global.
Definition: global.c:237
SPA_EXPORT const struct pw_properties * pw_impl_device_get_properties(struct pw_impl_device *device)
Definition: impl-device.c:794
const SPA_EXPORT char * pw_properties_get(const struct pw_properties *properties, const char *key)
Get a property.
Definition: properties.c:456
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:129
The device information.
Definition: device.h:43
struct spa_handle * handle
Definition: impl-device.c:74
int end
Definition: impl-device.c:63
SPA_EXPORT struct pw_properties * pw_properties_copy(const struct pw_properties *properties)
Copy a properties object.
Definition: properties.c:205
void * data
Definition: impl-device.c:44
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:258
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:58
#define PW_VERSION_GLOBAL_EVENTS
Definition: global.h:66
struct result_device_params_data data
Definition: impl-device.c:64
#define PW_KEY_DEVICE_NICK
a short device nickname
Definition: keys.h:173
int pw_impl_node_update_properties(struct pw_impl_node *node, const struct spa_dict *dict)
Update the node properties.
Definition: impl-node.c:1222
SPA_EXPORT void pw_impl_device_destroy(struct pw_impl_device *device)
Definition: impl-device.c:180
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:67
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:43
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:129
SPA_EXPORT struct pw_properties * pw_properties_new(const char *key,...)
Make a new properties object.
Definition: properties.c:98
#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:128
#define OBJECT_NODE
Definition: impl-device.c:71
struct spa_hook listener
Definition: impl-device.c:65
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:814
int pw_impl_device_update_properties(struct pw_impl_device *device, const struct spa_dict *dict)
Definition: impl-device.c:800
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:170
struct spa_list link
Definition: impl-device.c:69
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:1182
SPA_EXPORT void pw_properties_free(struct pw_properties *properties)
Free a properties object.
Definition: properties.c:335
PipeWire device interface.