Go to the documentation of this file.
25 #ifndef PIPEWIRE_GLOBAL_H
26 #define PIPEWIRE_GLOBAL_H
62 struct pw_impl_client *
client,
69 #define PW_VERSION_GLOBAL_EVENTS 0
78 struct pw_impl_client *
client,
79 uint32_t old_permissions,
80 uint32_t new_permissions);
121 const struct spa_dict *
dict,
const char *
const keys[]);
138 int (*callback) (
void *
data,
struct pw_resource *resource),
143 struct pw_impl_client *
client,
144 uint32_t permissions,
149 uint32_t old_permissions, uint32_t new_permissions);
int pw_global_update_permissions(struct pw_global *global, struct pw_impl_client *client, uint32_t old_permissions, uint32_t new_permissions)
Definition: global.c:314
#define PW_PERM_IS_R(p)
Definition: permission.h:56
int(* pw_global_bind_func_t)(void *object, struct pw_impl_client *client, uint32_t permissions, uint32_t version, uint32_t id)
Definition: global.h:61
Definition: module-filter-chain.c:176
struct pw_context * pw_global_get_context(struct pw_global *global)
Get the context object of this global.
Definition: global.c:179
void(* destroy)(void *data)
The global is destroyed.
Definition: global.h:73
bool pw_global_is_type(struct pw_global *global, const char *type)
Check a global type.
Definition: global.c:191
int pw_global_register(struct pw_global *global)
register a global to the context registry
Definition: global.c:125
int pw_global_for_each_resource(struct pw_global *global, int(*callback)(void *data, struct pw_resource *resource), void *data)
Iterate all resources added to the global The callback should return 0 to fetch the next item,...
Definition: global.c:241
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.
Definition: global.c:66
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
void(* free)(void *data)
The global is freed.
Definition: global.h:75
#define spa_list_for_each(pos, head, member)
Definition: list.h:111
uint32_t pw_global_get_permissions(struct pw_global *global, struct pw_impl_client *client)
Get the permissions of the global for a given client.
Definition: global.c:45
uint32_t version
Definition: global.h:70
#define SPA_EXPORT
Definition: defs.h:208
Global events, use pw_global_add_listener.
Definition: global.h:68
uint32_t id
Definition: access-flatpak.c:54
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
void pw_resource_destroy(struct pw_resource *resource)
Destroy a resource.
Definition: resource.c:264
const struct pw_properties * pw_global_get_properties(struct pw_global *global)
Get the global properties.
Definition: global.c:203
void * pw_global_get_object(struct pw_global *global)
Get the object associated with the global.
Definition: global.c:218
struct spa_dict dict
dictionary of key/values
Definition: properties.h:50
#define spa_list_consume(pos, head, member)
Definition: list.h:96
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
void spa_list_remove(struct spa_list *elem)
Definition: list.h:69
int pw_global_bind(struct pw_global *global, struct pw_impl_client *client, uint32_t permissions, uint32_t version, uint32_t id)
Bind to a global.
Definition: global.c:277
#define PW_PERM_ALL
Definition: permission.h:61
A hook, contains the structure with functions and the data passed to the functions.
Definition: hook.h:295
int pw_properties_update_keys(struct pw_properties *props, const struct spa_dict *dict, const char *const keys[])
Copy multiple keys from one property to another.
Definition: properties.c:235
void(* permissions_changed)(void *data, struct pw_impl_client *client, uint32_t old_permissions, uint32_t new_permissions)
The permissions changed for a client.
Definition: global.h:77
void spa_list_init(struct spa_list *list)
Definition: list.h:44
#define spa_list_for_each_safe(pos, tmp, head, member)
Definition: list.h:129
Definition: utils/dict.h:48
int pw_resource_set_bound_id(struct pw_resource *resource, uint32_t global_id)
Notify global id this resource is bound to.
Definition: resource.c:209
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
#define spa_strerror(err)
Definition: result.h:51
#define PW_ID_CORE
default ID for the core object after connect
Definition: core.h:66
#define pw_log_debug(...)
Definition: src/pipewire/log.h:89
Definition: module-protocol-native.c:103
void pw_global_destroy(struct pw_global *global)
Destroy a global.
Definition: global.c:369
#define SPA_ID_INVALID
Definition: defs.h:182
Definition: pipewire.c:76
const char * pw_global_get_type(struct pw_global *global)
Get the global type.
Definition: global.c:185
struct pw_control this
Definition: control.c:34
void spa_hook_list_init(struct spa_hook_list *list)
Initialize a hook list to the empty list.
Definition: hook.h:305
uint32_t pw_global_get_version(struct pw_global *global)
Get the global version.
Definition: global.c:197
uint32_t pw_global_get_id(struct pw_global *global)
Get the unique id of the global.
Definition: global.c:224
struct pw_properties * pw_properties_new(const char *key,...) 1
Make a new properties object.
Definition: properties.c:98
#define NAME
Definition: global.c:36
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
#define pw_log_error(...)
Definition: src/pipewire/log.h:86
#define spa_list_append(list, item)
Definition: list.h:81