param: add a new user seq field in the param-info

Add a new seq field in the param-info struct. Users can use this
field to keep track of pending param updates.

Store the latest seq number of the param update in the seq field. Remove
all params that don't match the sequence number because they are too
old. This avoids duplicate old params in pw-dump output.

Rework the pulseaudio manager with this same method.
This commit is contained in:
Wim Taymans 2022-10-27 20:10:33 +02:00
parent a989230cb5
commit e6fd5888ee
4 changed files with 85 additions and 53 deletions

View file

@ -72,6 +72,7 @@ struct pw_manager {
struct pw_manager_param {
uint32_t id;
int32_t seq;
struct spa_list link; /**< link in manager_object param_list */
struct spa_pod *param;
};
@ -92,6 +93,9 @@ struct pw_manager_object {
int changed;
void *info;
struct spa_param_info *params;
uint32_t n_params;
struct spa_list param_list;
unsigned int creating:1;
unsigned int removing:1;