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,
137 uint32_t permissions,
142 uint32_t old_permissions, uint32_t new_permissions);
static uint32_t int int res
Definition: core.h:323
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:238
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:252
#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:367
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:50
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:252
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
SPA_EXPORT uint32_t pw_global_get_id(struct pw_global *global)
Get the unique id of the global.
Definition: global.c:221
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:238
SPA_EXPORT void * pw_global_get_object(struct pw_global *global)
Get the object associated with the global.
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:210
#define PW_PERM_RWX
Definition: permission.h:48
void * pw_global_get_object(struct pw_global *global)
Get the object associated with the global.
Definition: global.c:215
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
uint32_t pw_global_get_id(struct pw_global *global)
Get the unique id of the global.
Definition: global.c:221
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 int pw_global_add_resource(struct pw_global *global, struct pw_resource *resource)
Add a resource to a global.
Definition: global.c:227
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:311
void pw_resource_destroy(struct pw_resource *resource)
Destroy a resource.
Definition: resource.c:265
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:311
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
SPA_EXPORT const 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:95
#define PW_ID_CORE
Definition: core.h:46
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:274
#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:330