25 #ifndef PIPEWIRE_GLOBAL_H
26 #define PIPEWIRE_GLOBAL_H
69 #define PW_VERSION_GLOBAL_EVENTS 0
79 uint32_t old_permissions,
80 uint32_t new_permissions);
121 const struct spa_dict *
dict,
const char *
const keys[]);
141 int (*callback) (
void *data,
struct pw_resource *resource),
147 uint32_t permissions,
152 uint32_t old_permissions, uint32_t new_permissions);
int pw_global_bind(struct pw_global *global, struct pw_impl_client *client, uint32_t permissions, uint32_t version, uint32_t id)
Let a client bind to a global.
Definition: global.c:292
const char * pw_global_get_type(struct pw_global *global)
Get the global type.
Definition: global.c:200
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:46
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:66
uint64_t pw_global_get_serial(struct pw_global *global)
Get the serial number of the global.
Definition: global.c:121
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 object.
Definition: global.c:67
uint32_t pw_global_get_version(struct pw_global *global)
Get the global version.
Definition: global.c:212
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:270
uint32_t pw_global_get_id(struct pw_global *global)
Get the unique id of the global.
Definition: global.c:239
void pw_global_destroy(struct pw_global *global)
Destroy a global.
Definition: global.c:385
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:256
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:329
int pw_global_add_resource(struct pw_global *global, struct pw_resource *resource)
Add a resource to a global.
Definition: global.c:245
const struct pw_properties * pw_global_get_properties(struct pw_global *global)
Get the global properties.
Definition: global.c:218
struct pw_context * pw_global_get_context(struct pw_global *global)
Get the context object of this global.
Definition: global.c:194
void * pw_global_get_object(struct pw_global *global)
Get the object associated with the global.
Definition: global.c:233
bool pw_global_is_type(struct pw_global *global, const char *type)
Check a global type.
Definition: global.c:206
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:224
int pw_global_register(struct pw_global *global)
Register a global object to the context registry.
Definition: global.c:138
Global events, use pw_global_add_listener.
Definition: global.h:73
void(* free)(void *data)
The global is freed.
Definition: global.h:81
void(* destroy)(void *data)
The global is destroyed.
Definition: global.h:79
uint32_t version
Definition: global.h:76
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:83
Definition: properties.h:53
struct spa_dict dict
dictionary of key/values
Definition: properties.h:54
A hook, contains the structure with functions and the data passed to the functions.
Definition: hook.h:342