Go to the documentation of this file.
25 #ifndef PIPEWIRE_GLOBAL_H
26 #define PIPEWIRE_GLOBAL_H
66 #define PW_VERSION_GLOBAL_EVENTS 0
76 uint32_t old_permissions,
77 uint32_t new_permissions);
94 struct spa_hook *listener,
118 const struct spa_dict *
dict,
const char *keys[]);
141 uint32_t permissions,
146 uint32_t old_permissions, uint32_t new_permissions);
static uint32_t int int res
Definition: core.h:326
struct pw_context * pw_global_get_context(struct pw_global *global)
Get the context object of this global.
Definition: global.c:185
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:58
static void pw_map_remove(struct pw_map *map, uint32_t id)
Remove an item at index.
Definition: map.h:157
SPA_EXPORT 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:248
void(* destroy)(void *data)
The global is destroyed.
Definition: global.h:70
SPA_EXPORT 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
#define pw_log_error(...)
uint32_t pw_global_get_version(struct pw_global *global)
Get the global version.
Definition: global.c:203
SPA_EXPORT void pw_global_destroy(struct pw_global *global)
Destroy a global.
Definition: global.c:377
void(* free)(void *data)
The global is freed.
Definition: global.h:72
SPA_EXPORT uint32_t pw_global_get_version(struct pw_global *global)
Get the global version.
Definition: global.c:203
uint32_t version
Definition: global.h:67
Global events, use pw_global_add_listener.
Definition: global.h:65
PipeWire client object class.
#define PW_PERM_IS_R(p)
Definition: permission.h:53
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
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
SPA_EXPORT const struct pw_properties * pw_global_get_properties(struct pw_global *global)
Get the global properties.
Definition: global.c:209
A global object visible to remote clients.
static uint32_t pw_map_insert_new(struct pw_map *map, void *data)
Insert data in the map.
Definition: map.h:105
SPA_EXPORT bool pw_global_is_type(struct pw_global *global, const char *type)
Check a global type.
Definition: global.c:197
struct spa_dict dict
dictionary of key/values
Definition: properties.h:46
SPA_EXPORT uint32_t pw_global_get_id(struct pw_global *global)
Get the unique id of the global.
Definition: global.c:231
static int pw_map_insert_at(struct pw_map *map, uint32_t id, void *data)
Insert data in the map at an index.
Definition: map.h:133
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:248
SPA_EXPORT void * pw_global_get_object(struct pw_global *global)
Get the object associated with the global.
Definition: global.c:225
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(...)
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
void * pw_global_get_object(struct pw_global *global)
Get the object associated with the global.
Definition: global.c:225
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:74
#define PW_PERM_ALL
Definition: permission.h:58
uint32_t pw_global_get_id(struct pw_global *global)
Get the unique id of the global.
Definition: global.c:231
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 int pw_global_add_resource(struct pw_global *global, struct pw_resource *resource)
Add a resource to a global.
Definition: global.c:237
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:321
SPA_EXPORT 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
void pw_resource_destroy(struct pw_resource *resource)
Destroy a resource.
Definition: resource.c:264
bool pw_global_is_type(struct pw_global *global, const char *type)
Check a global type.
Definition: global.c:197
Definition: pipewire.c:66
const char * pw_global_get_type(struct pw_global *global)
Get the global type.
Definition: global.c:191
SPA_EXPORT 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:321
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
SPA_EXPORT struct pw_context * pw_global_get_context(struct pw_global *global)
Get the context object of this global.
Definition: global.c:185
const SPA_EXPORT char * pw_global_get_type(struct pw_global *global)
Get the global type.
Definition: global.c:191
SPA_EXPORT struct pw_properties * pw_properties_new(const char *key,...)
Make a new properties object.
Definition: properties.c:98
#define PW_ID_CORE
Definition: core.h:49
SPA_EXPORT 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
SPA_EXPORT int pw_global_register(struct pw_global *global)
register a global to the context registry
Definition: global.c:128
const struct pw_properties * pw_global_get_properties(struct pw_global *global)
Get the global properties.
Definition: global.c:209
SPA_EXPORT 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:284
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:220
#define NAME
Definition: global.c:35
A collection of key/value pairs.
Definition: properties.h:45
SPA_EXPORT void pw_properties_free(struct pw_properties *properties)
Free a properties object.
Definition: properties.c:335