media-session: (re)schedule rescan after new pending operation

Every time a new operation is started, schedule a rescan. This
ensures that there are no more pending actions before the policy
module scans the nodes.

This has the effect that all devices and nodes are up to data and
ready to be used by policy-node.

Fixes #789
This commit is contained in:
Wim Taymans 2021-03-08 13:20:02 +01:00
parent 59f86df9f3
commit d603c1086a
3 changed files with 6 additions and 0 deletions

View file

@ -960,6 +960,7 @@ static void alsa_udev_object_info(void *data, uint32_t id,
} else {
alsa_update_device(impl, device, info);
}
sm_media_session_schedule_rescan(impl->session);
}
static const struct spa_device_events alsa_udev_events =

View file

@ -470,6 +470,7 @@ static void device_event_info(void *object, const struct pw_device_info *info)
}
}
sm_object_sync_update(&device->obj);
sm_media_session_schedule_rescan(&impl->this);
}
static void device_event_param(void *object, int seq,
@ -570,6 +571,7 @@ static void node_event_info(void *object, const struct pw_node_info *info)
}
}
sm_object_sync_update(&node->obj);
sm_media_session_schedule_rescan(&impl->this);
}
static void node_event_param(void *object, int seq,
@ -1263,6 +1265,7 @@ registry_global(void *data, uint32_t id,
impl, id, obj->type, type);
update_object(impl, info, obj, id, permissions, type, version, props);
}
sm_media_session_schedule_rescan(&impl->this);
}
int sm_object_add_listener(struct sm_object *obj, struct spa_hook *listener,
@ -1410,6 +1413,7 @@ static void monitor_sync(struct impl *impl)
pw_core_set_paused(impl->policy_core, true);
impl->monitor_seq = pw_core_sync(impl->monitor_core, 0, impl->monitor_seq);
pw_log_debug(NAME " %p: monitor sync start %d", impl, impl->monitor_seq);
sm_media_session_schedule_rescan(&impl->this);
}
struct pw_proxy *sm_media_session_export(struct sm_media_session *sess,

View file

@ -255,6 +255,7 @@ static void v4l2_device_object_info(void *data, uint32_t id,
} else {
v4l2_update_node(dev, node, info);
}
sm_media_session_schedule_rescan(dev->impl->session);
}
static const struct spa_device_events v4l2_device_events = {