policy-node/create-item: fix handling of linkables pending activation

Policies need to know if there are session items that are pending
activation. Linkables are not activated in the same order as nodes
appear, which causes problems for e.g. resolving target nodes, if some
of the linkables are pending.

Register linkables in create-items before they are activated.  When
activation completes, remove those that did not activate successfully.
Policies can filter out inactive items by tracking active-features
flags.

If there are existing linkables that are not ready, suspend policy-node
processing, and continue it only after all linkables are ready.
This commit is contained in:
Pauli Virtanen
2022-02-20 20:19:42 +02:00
parent edf0dc69d1
commit c6aa44ca26
4 changed files with 77 additions and 6 deletions

View File

@@ -199,6 +199,7 @@ linkables_om = ObjectManager {
-- only handle device si-audio-adapter items
Constraint { "item.factory.name", "=", "si-audio-adapter", type = "pw-global" },
Constraint { "item.node.type", "=", "device", type = "pw-global" },
Constraint { "active-features", "!", 0, type = "gobject" },
}
}
links_om = ObjectManager {