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,7 +72,9 @@ struct spa_param_info {
uint32_t flags;
uint32_t user; /**< private user field. You can use this to keep
* state. */
uint32_t padding[5];
int32_t seq; /**< private seq field. You can use this to keep
* state of a pending update. */
uint32_t padding[4];
};
#define SPA_PARAM_INFO(id,flags) ((struct spa_param_info){ (id), (flags) })