This is no longer used and likely not very useful now that we have
a simpler design.
We can re-add it in the future if necessary, but let's keep it out
of the 0.4 release.
Also rename the intermediate lua api table WpDebug -> WpLog
Keeps things more consistent with the function names (wp_log*),
with the lua api (Log.*) and with pipewire using log.{h,c} as well.
After all, these functions are for logging...
This adds WP_SESSION_ITEM_FEATURE_ACTIVE and WP_SESSION_ITEM_FEATURE_EXPORTED
features, so _activate and _export APIs have been removed. Modules and unit
tests have also been updated.
This is an attempt to unclutter the API of WpProxy and
split functionality into smaller pieces, making it easier
to work with.
In this new class layout, we have the following classes:
- WpObject: base class for everything; handles activating
| and deactivating "features"
|- WpProxy: base class for anything that wraps a pw_proxy;
| handles events from pw_proxy and nothing more
|- WpGlobalProxy: handles integration with the registry
All the other classes derive from WpGlobalProxy. The reason
for separating WpGlobalProxy from WpProxy, though, is that
classes such as WpImplNode / WpSpaDevice can also derive from
WpProxy now, without interfacing with the registry.
All objects that come with an "info" structure and have properties
and/or params also implement the WpPipewireObject interface. This
provides the API to query properties and get/set params. Essentially,
this is implemented by all classes except WpMetadata (pw_metadata
does not have info)
This interface is implemented on each object separately, using
a private "mixin", which is a set of vfunc implementations and helper
functions (and macros) to facilitate the implementation of this interface.
A notable difference to the old WpProxy is that now features can be
deactivated, so it is possible to enable something and later disable
it again.
This commit disables modules, tests, tools, etc, to avoid growing the
patch more, while ensuring that the project compiles.
It is a valid use case to do things like call wp_session_item_export()
from within the async ready callback of _activate(), and it's not
possible unless the ACTIVATING flag has been cleared first.
To do this, use a GCClosure to wrap the callback and install marshal
guards, which are called before and after the callback, to modify
the flags.
We can now call wp_proxy_request_destroy() on endpoint links and
the WpImplEndpointLink together with the session item that created
it will be cleaned up
+ expose the export transition in the session item class
+ make the export-related flags immutable
+ add an export error flag
+ update and improve documentation
+ replace calling execute_step(..., STEP_ERROR) with rollback
+ implement deactivate internally using rollback
This unifies deactivation steps, which are common between deactivate()
and calling execute_step() with WP_TRANSITION_STEP_ERROR at the
end of a failed activation transition.
* It should be possible to activate/deactivate while an item
is exported (if the item supports it, but that's a subclass matter)
* It should be possible to deactivate without resetting configuration
* introduces API to export session items
* introduces small changes in the WpSiEndpoint & WpSiStream
interfaces to make it nicer to work with
* ports WpImplEndpoint to use PW_TYPE_INTERFACE_Endpoint
to export. Depends on:
https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/246
(was merged after 0.3.2)