Make it possible to run the session manager without endpoint
modules. Add a simple node policy that links nodes.
Move the session-manager implementation and startup of the
endpoint monitors to a separate module.
Handle async set_param on the device
If the video format cannot be detected, GStreamer will return the
UNKNOWN format, which is translated into the Id 0 in the
Spa:Interface:TypeMap, which is added to the pod.
When the pipewire server receives the pod and tries to unmarshal the
pod, it will detect the Id 0. Unable to distinguish Id 0 from a missing
id, the server discards the message as invalid and closes the
connection.
Use the following gstreamer pipeline to reproduce (note the wrong nv12
instead of a correct NV12 format):
gst-launch-1.0 pipewiresrc ! video/x-raw,format=nv12 ! fakesink
If an ID cannot be de-referenced, e.g., because the builder buffer is
too small, spa_pod_filter() still reports success, but the result is
NULL. Any subsequent access to result will cause a segfault.
Return an error if no pod is found to properly propagate and handle the
error.
The segfault can be reproduced by using the v4l2 module with Vivid
devices [0], because the buffer for the v4l2 controls is too small.
[0] https://github.com/PipeWire/pipewire/issues/138
The gstdeviceprovider segfaults when listing the available devices,
because it the pointer to GList * is initialized with NULL instead of
the GList * itself. Don't use a pointer, but use the GList * directly.
Messages that are printed for every buffer should use the LOG debug
level, while messages that happen during setup and tear down should use
the DEBUG debug level.
Therefore, use LOG in on_process and when popping buffers and DEBUG when
Pipewire adds or removes buffers.
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.
Before using the param from EnumFormat as a format param, set the
object ID to PARAM_Format to avoid confusion later on. Clients might
use the object id to enumerate parameters and then fail to enumerate
the current Format because the id is wrong.
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.