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:323
#define PW_VERSION_IMPL_DEVICE_EVENTS
Definition: impl-device.h:54
static uint32_t id
Definition: core.h:322
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:810
struct pw_resource * resource
Definition: impl-device.c:52
#define PW_KEY_DEVICE_API
API this device is accessed with.
Definition: keys.h:174
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:367
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:804
#define OBJECT_DEVICE
Definition: impl-device.c:71
Definition: impl-core.c:37
int seq
Definition: impl-device.c:61
#define PW_KEY_OBJECT_ID
a global object id
Definition: keys.h:70
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:234
uint32_t type
Definition: impl-device.c:72
struct spa_hook resource_listener
Definition: impl-core.c:38
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:810
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:1530
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:761
void * pw_impl_device_get_user_data(struct pw_impl_device *device)
Definition: impl-device.c:798
#define PW_KEY_FACTORY_ID
Factory properties.
Definition: keys.h:215
#define PW_KEY_MODULE_ID
module properties
Definition: keys.h:205
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:252
static uint32_t int int const char int r
Definition: core.h:335
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:761
SPA_EXPORT struct spa_device * pw_impl_device_get_implementation(struct pw_impl_device *device)
Get the device implementation.
Definition: impl-device.c:778
int pw_impl_node_set_active(struct pw_impl_node *node, bool active)
Set a node active.
Definition: impl-node.c:1867
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:1471
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:969
struct spa_dict dict
dictionary of key/values
Definition: properties.h:46
#define PW_KEY_CLIENT_ID
Client properties.
Definition: keys.h:118
void pw_impl_device_destroy(struct pw_impl_device *device)
Definition: impl-device.c:179
uint32_t id
Definition: impl-device.c:69
struct spa_device * pw_impl_device_get_implementation(struct pw_impl_device *device)
Get the device implementation.
Definition: impl-device.c:778
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:1513
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:428
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:548
SPA_EXPORT int pw_impl_device_register(struct pw_impl_device *device, struct pw_properties *properties)
Definition: impl-device.c:449
const struct pw_properties * pw_impl_device_get_properties(struct pw_impl_device *device)
Definition: impl-device.c:784
#define PW_KEY_OBJECT_PATH
unique path to construct the object
Definition: keys.h:69
#define PW_DEVICE_CHANGE_MASK_PROPS
Definition: device.h:45
#define PW_KEY_MEDIA_CLASS
class Ex: "Video/Source"
Definition: keys.h:242
#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:39
SPA_EXPORT void * pw_impl_device_get_user_data(struct pw_impl_device *device)
Definition: impl-device.c:798
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
#define pw_log_debug(...)
#define PW_VERSION_RESOURCE_EVENTS
Definition: resource.h:65
Definition: impl-device.c:67
struct spa_hook listener
Definition: impl-device.c:75
#define PW_KEY_DEVICE_DESCRIPTION
localized human readable device one-line description.
Definition: keys.h:176
int pw_impl_device_register(struct pw_impl_device *device, struct pw_properties *properties)
Definition: impl-device.c:449
SPA_EXPORT int pw_properties_update(struct pw_properties *props, const struct spa_dict *dict)
Update properties.
Definition: properties.c:258
#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:160
#define PW_VERSION_DEVICE
Definition: device.h:39
void * object
Definition: impl-device.c:74
SPA_EXPORT int pw_impl_device_update_properties(struct pw_impl_device *device, const struct spa_dict *dict)
Definition: impl-device.c:790
int pw_global_add_resource(struct pw_global *global, struct pw_resource *resource)
Add a resource to a global.
Definition: global.c:227
SPA_EXPORT const struct pw_properties * pw_impl_device_get_properties(struct pw_impl_device *device)
Definition: impl-device.c:784
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:128
The device information.
Definition: device.h:43
struct spa_handle * handle
Definition: impl-device.c:73
int end
Definition: impl-device.c:62
SPA_EXPORT struct pw_properties * pw_properties_copy(const struct pw_properties *properties)
Copy a properties object.
Definition: properties.c:200
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:234
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:175
#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:63
#define PW_KEY_DEVICE_NICK
a short device nickname
Definition: keys.h:171
SPA_EXPORT const char * pw_properties_get(const struct pw_properties *properties, const char *key)
Get a property.
Definition: properties.c:451
int pw_impl_node_update_properties(struct pw_impl_node *node, const struct spa_dict *dict)
Update the node properties.
Definition: impl-node.c:1131
SPA_EXPORT void pw_impl_device_destroy(struct pw_impl_device *device)
Definition: impl-device.c:179
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:128
SPA_EXPORT struct pw_properties * pw_properties_new(const char *key,...)
Make a new properties object.
Definition: properties.c:95
#define PW_TYPE_INTERFACE_Device
Definition: device.h:37
static uint32_t int seq
Definition: core.h:322
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:70
struct spa_hook listener
Definition: impl-device.c:64
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:804
int pw_impl_device_update_properties(struct pw_impl_device *device, const struct spa_dict *dict)
Definition: impl-device.c:790
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:166
void pw_impl_client_set_busy(struct pw_impl_client *client, bool busy)
Mark the client busy.
Definition: impl-client.c:636
int pw_unload_spa_handle(struct spa_handle *handle)
Definition: pipewire.c:308
#define PW_KEY_DEVICE_NAME
device name
Definition: keys.h:168
struct spa_list link
Definition: impl-device.c:68
SPA_EXPORT int pw_properties_update_keys(struct pw_properties *props, const struct spa_dict *dict, const char *keys[])
Copy multiple keys from one property to another.
Definition: properties.c:215
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:1091
SPA_EXPORT void pw_properties_free(struct pw_properties *properties)
Free a properties object.
Definition: properties.c:330
PipeWire device interface.