When the permissions change on a node for a client, only check the
link permissions if the nodes of the link belong to the client.
Otherwise, we might destroy a link when the permissions are removed
from a node for an unrelated client.
First check if we can adjust priorities with rlimits, if we can't and we
need to use rtkit, spawn a thread-loop to handle the rtkit stuff.
First do a pw_loop_invoke() to do the rtkit setup, including getting
some properties and then setting the nice level and rlimits.
Use pw_loop_invoke to queue rtkit realtime requests, this ensures we
always perform the requests after the setup and when the properties
are fetched.
See #3357
Don't use a timer but use an event to trigger a flush of the collected
data. We are now using a per-driver buffer and we don't want to make
this too large so make sure we flush the data quickly.
Don't block on the method calls to make realtime or high priority.
Those calls don't return anything and other errors (invalid method,
invalid arguments, no service,...) can be caught differently async.
Fixes#3357
Make a ringbuffer per driver because each driver might run in a
different threads and because a shared ringbuffer can not be written to
from multiple threads. Assemble all the driver stats into one buffer
before sending out the profile info.
Remove the context_driver events and replace them with realtime node
events. The problem is that the realtime node events are emitted from
the node data thread, which can be different for each node and
aggregating them into context_driver events is not a good idea.
It's also nice for the stream drained event, which no longer needs to go
through the context_driver events.
Pass on the device numbers property of libcamera to session managers, with they
are better equipped to filter the camera/video devices across v4l2 and libcamera.
First update some stream defaults, then apply generic property updates.
Before connecting, fill in some more default with the flags and the
direction of the stream, then evaluate the rules, then overwrite with
environment values.
This ensure that the rules can also use the flags and direction used
during _connect().
See #3355
Enforce that the owner client of the output node can see the input node
and vice versa.
This works around an issue where the session manager performs a link
between nodes that should not be linked, like when doing screensharing
and the portal has set permissions to only see the screenshared stream,
wireplumber will link to the camera when the target.object is not set.
See also wireplumber#218
This has unfortunately the downside that patchbays like helvum will also
not be able to link those nodes. We should probably add a new link
permission to allow this explicitly.
This reverts commit 21d16b1ad5.
The change causes the sound of videos to be way out of sync when streaming from Fedora to Sonos.
It seems the issue is a device-specific quirk, and the change cannot be applied universally to all devices,
thus reverting until a better solution is found that does not affect other devices.
For all the modules that include the private header we require that the
library and compiler versions match.
Otherwise we might end up poking into new or old fields that got moved or
changed in the private struct and crash.
See #3243
Remove some includes of private.h
Add some methods to get the mempool of client and context so that we can
remove direct access.
Move some things around.
Use methods to get pw_loop variables.
See #3243