mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
pulse-server: implement temporary data attached to manager objects
Add functions for setting timer-based lifetimes for object data. Having the timers in the object data themselves simplifies life cycle management, as client/manager disconnects are handled without further work.
This commit is contained in:
parent
36ad886388
commit
83be5d866f
2 changed files with 74 additions and 6 deletions
|
|
@ -55,6 +55,9 @@ struct pw_manager_events {
|
|||
const char *type, const char *value);
|
||||
|
||||
void (*disconnect) (void *data);
|
||||
|
||||
void (*object_data_timeout) (void *data, struct pw_manager_object *object,
|
||||
const char *key);
|
||||
};
|
||||
|
||||
struct pw_manager {
|
||||
|
|
@ -115,6 +118,8 @@ int pw_manager_for_each_object(struct pw_manager *manager,
|
|||
|
||||
void *pw_manager_object_add_data(struct pw_manager_object *o, const char *key, size_t size);
|
||||
void *pw_manager_object_get_data(struct pw_manager_object *obj, const char *key);
|
||||
void *pw_manager_object_add_temporary_data(struct pw_manager_object *o, const char *key,
|
||||
size_t size, uint64_t lifetime_nsec);
|
||||
|
||||
bool pw_manager_object_is_client(struct pw_manager_object *o);
|
||||
bool pw_manager_object_is_module(struct pw_manager_object *o);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue