pulse-server: add stream/device state in dev_info

Also include and update the state of the device/stream in
collect_device_info so that we can compare it against the previous value
and emit a change event.

Fixes #3660
This commit is contained in:
Wim Taymans 2023-11-20 11:39:31 +01:00
parent 90bd9adb6b
commit 0c857f5455
3 changed files with 19 additions and 28 deletions

View file

@ -42,6 +42,7 @@ void update_object_info(struct pw_manager *manager, struct pw_manager_object *o,
struct device_info {
uint32_t direction;
int state;
struct sample_spec ss;
struct channel_map map;
@ -59,6 +60,7 @@ struct device_info {
#define DEVICE_INFO_INIT(_dir) \
(struct device_info) { \
.direction = _dir, \
.state = STATE_INIT, \
.ss = SAMPLE_SPEC_INIT, \
.map = CHANNEL_MAP_INIT, \
.volume_info = VOLUME_INFO_INIT, \
@ -146,6 +148,5 @@ uint32_t find_port_index(struct pw_manager_object *card, uint32_t direction, con
struct pw_manager_object *find_peer_for_link(struct pw_manager *m,
struct pw_manager_object *o, uint32_t id, enum pw_direction direction);
struct pw_manager_object *find_linked(struct pw_manager *m, uint32_t id, enum pw_direction direction);
bool collect_is_linked(struct pw_manager *m, uint32_t id, enum pw_direction direction);
#endif