pulse: use metadata to store default source/sink

The metadata is implemented by the session manager and it can decide
what to do when the defaults change. It can also choose to save
(some of) the metadata to a database.

The metadata is also shared between applications so that changes can
be picked up immediately.
This commit is contained in:
Wim Taymans 2020-07-07 17:09:46 +02:00
parent 2991a814cd
commit ee54cb96aa
5 changed files with 232 additions and 11 deletions

View file

@ -310,6 +310,9 @@ struct global {
struct {
pa_client_info info;
} client_info;
struct {
struct pw_array metadata;
} metadata_info;
};
};
@ -350,6 +353,8 @@ struct pa_context {
int no_fail:1;
int disconnect:1;
struct global *metadata;
};
struct global *pa_context_find_global(pa_context *c, uint32_t id);
@ -474,6 +479,11 @@ pa_operation *pa_operation_new(pa_context *c, pa_stream *s, pa_operation_cb_t cb
void pa_operation_done(pa_operation *o);
int pa_operation_sync(pa_operation *o);
int pa_metadata_update(struct global *global, uint32_t subject, const char *key,
const char *type, const char *value);
int pa_metadata_get(struct global *global, uint32_t subject, const char *key,
const char **type, const char **value);
#ifdef __cplusplus
}
#endif