Set the destroyed flag on globals and make sure they are not
available anymore during the signal emissions. One such instance
is where a global is destroyed, the resources are destroyed,
a waiting client is resumed, the clients asks to bind to the
global and causes an error.
See #298
When the core is disconnected, first do _remove on all active
proxies and then run the _destroy handles. This makes it easier
to clean up dependent resources.
Remove the modules after removing all objects. It's harder for
odules to track and remove all objects.
Keep track if the proxy is still in the core object map or not
and make sure to only delete it once.
In _remove, just remove the item from the object map if the proxy
is destroyed. There is no need to call _proxy_destroy again (and
do the extra unref)
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
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
Make a new DRAINED status.
Place the DRAINED status on an input IO when a stream is out of
buffers and draining.
All nodes that don't have HAVE_DATA on the input io need to copy
it to the output io and return the status. This makes sure the
DRAINED is forwarded and nodes return DRAINED from _process()
DRAINED on the resampler flushes out the last queued samples and then
forwards the DRAINED in the next iteration.
Emit a new drained signal from the context when a node returns
DRAINED. Use this to trigger the drained signal in the stream.
Don't use pthread_cancel by default to stop the data thread but
instead use an eventfd. pthread_cancel uses a signal and is not
nice to use in a library as it can cause strange crashes.
See #211
Log an error when we send an error to the client so that we don't need
to log and error anymore.
Improve the error messages when we can
Move some warnings and errors to debug
So that we can check for negative value.
Also don't signal incomplete graph when we signaled more than
expected, this can happen when we add new nodes in the current
cycle and then triggered the driver.
Use the DSP media subtype to describe DSP formats. DSP formats
don't include the rate, channels and channel position in the
format and must use the rate and duration from the position io. This
makes it possible to later change the samplerate dynamically without
having to renegotiate the graph.
The same goes for the video DSP format, which uses the io_video_size
from the io_position to get the size/stride. Set this up in the node
based on the defaults from the context.
Make it possible to define defaults in the daemon config file, such
as samplerate, quantum, video size and framerate. This is stored in
the context and used for the DSP formats.
Never free a proxy without the application doing a pw_proxy_destroy.
It's hard to use when proxies are freed randomly when the server
removes the ids. You have to add destroy notify to all proxies and
deal with the arbirary order in which proxies can be freed.
Instead notify the client of the remove and let it destroy the
proxies itself in the right order. This is in line with how wayland
handles proxies.
A pw_proxy_destroy() will now send a destroy to the server and mark
the proxy as a zombie, waiting for the remove_id confirmation and
then destroy the proxy.
A server remove_id will mark the proxy as removed and emits the
removed event. The app should then pw_proxy_destroy the proxy
to free it.
Leaks all proxies in the session manager because cleanup now needs
to be handled by the app correctly.
This is more in line with wayland and it allows us to create new
interfaces in modules without having to add anything to the type
enum. It also removes some lookups to map type_id to readable
name in debug.
Make sure only emit destroy once by making the proxy a zombie
from the first call to destroy. Also make sure we don't call destroy
twice without remove.
Add method to set and get typed objects from the context. This can
be used to pass around context objects between modules without having
to register them.
Make the thread_loop alloc its own loop by default to simplify
some core. Add extra new_full method to pass a custom pw_loop.
Make other loop implementations ready to support custom loops
if we want that later.
Move the core implementation to a separate file. Make a default
core object in the context.
Pass impl-core to server. We now tie the server to a core. Also
keep track of the core that a client connected to.
Fill the properties that we usually use to connect in the context
and copy them when a connection is made.
Use "internal" as the remote name to connect to the default
internal core.