This allows to transparently wait until a link is PAUSED before
returning from the activation transition. This way we can also
catch negotiation/allocation errors while activating a link.
PAUSED is used instead of ACTIVE because ACTIVE depends on the
nodes being activated as well. There are cases where a link may not
activate the nodes (ex, a passive link) and the link may remain
PAUSED for a long time.
Related to: #294
Since the string length returned by wp_spa_pod_get_data() does not always match
the size of the actual json object because it is stored in contiguous memory, we
cannot always rely on that API to get the json string data.
The new wp_spa_pod_to_string() always allocates a new string with the same
length as the json size, guaranteeing that the string returned always represents
the json object, regardless of whether it is nested or not. It is always
recommented to use wp_spa_pod_to_string() unless you know what you are doing.
The data pointer of a WpSpaJson object can be bigger than the actual WpSpaJson
size. For example, this happens when iterating an array: instead of
re-allocating the nested data into a new region of memory, the iterator uses
the same region of memory as the parent, and just sets the pointer data and size
to the correct location when creating the nested WpSpaJson object.
This patch makes sure only the data represented by the size is added into the
builder when adding a json object, fixing issues that were happening before when
adding nested objects directly from a second WpSpaJson object.
Currently, if the default node appears without ports for a short period of time,
the default nodes module will never select it immediately because it does not
listen for port changes. We want to listen for port changes to reevaluate again
the nodes that did not have ports before. This allows switching to the default
node as soon as it has ports if it did not had ports before.
Currently v4l2 nodes will get higher priority than libcamera ones.
The default can be changed, of course, with wpctl.
Things are still not great if a camera is enumerated by both monitors.
The first node to be linked will grab the device and the second one
from the other subsystem will fail to negotiate.
7908b8d7be2a2992c57cd549054eda7ce46e4b44 ("m-lua-scripting: allow
converting GValue holding NULL objects to Lua") accidentally added a second
refcount. As a result, the objects are never freeded.
Remove the second refcount to fix this.
This check was originally added to avoid a small audio glitch when changing
default nodes while also changing the device profile (eg Gnome Sound Settings).
The check is removed because it causes issues when disabling alsa nodes. There
are plans to fix the audio glitch issue in the future with the planned
event-dispatcher architecture.
Fixes#279