Pipewire might update buffers that have not been recycled by GStreamer,
because they are still used downstream. There is nothing we can do about
it in the pipewiresrc.
If a buffer is sent downstream more than once, take an additional
reference to make sure that we don't queue a buffer that is still used
and print a warning.
Keep track of the node active state, when both are active, we can
prepare (negotiate) the link.
After a link has been prepared we can activate it. When we deactivate
the link, we don't need to prepare again.
When a port loses buffers or format, set the link back to the
unprepared state.
This fixes the case where:
1) a node becomes inactive and goes to suspend, the link becomes
unprepared
2) the node becomes active again and need to be prepared again
Keep the first active node as the fallback node. We use this node
as the target when no oher active nodes exist.
Only assign the target node to active nodes.
When we assign an unassigned node, simply update the active followers
of the target, the state of the nodes and target itself will then
be taken care of later.
When registering nodes, only active nodes can influence the state of the
graph.
Update some comments
Add reason to why we recalculate the graph for debugging purposes
Only recalculate graph when something relevant changed.
Block recalc from being called recursively.
Keep track of when a link is prepared, this is when the link has
successfully negotiated a format and buffers.
Only follow prepared links when collecting nodes in the graph.
Set the state of the driver and its nodes based on how many active
nodes the driver has. We don't have to do state changes on the nodes
from the link anymore then and we can get rid of the counters.
Only set the io on the mixer ports when prepared because we might
need a special mixer element based on the format.
Remove passive links for now.
This fixes many cases where the graph would stall when linking/unlinking
ports in various combinations.
Fixes#221
Rename (the non-exported symbol) _unref_id -> _remove_id and make it
remove the id from the map of known ids. This way, the server can send
the remove_mem and reuse the id for new memory before all references
are gone. Fixes "invalid mem id X, expected Y" errors.
Rework the metadata implementation without pw_properties to make
it easier to delete all subjects and implement the metadata API.
Remove metadata from all objects when they are destroyed.
When the resource does add_listener, send a message to the proxy
to trigger an emission of properties.
Block the client until all properties have been notified, track
this with a ping event to the implementation.
Setting the size on input stream buffers based on the elapsed
ticks does not give a meaningfull value for the queue size so
just leave it to the user to set the size field.