Commit graph

604 commits

Author SHA1 Message Date
Julian Bouzas
27ff8d5ef2 modules: port config-static-nodes to use WpPlugin 2020-05-13 11:21:45 -04:00
Julian Bouzas
faa9719f53 modules: port config-policy to use WpPlugin 2020-05-13 11:21:45 -04:00
George Kiagiadakis
1aefda4128 daemon: activate plugins in an idle callback to avoid side-effects
the on_sessions_exported callback runs from within the context
of export_tmp_globals in object-manager.c and when plugins register
more object managers, it modifies the object managers list that
export_tmp_globals is iterating over, making things behave really weird
2020-05-13 18:18:52 +03:00
George Kiagiadakis
f6dacf7cf7 lib: remove WpFactory (no longer used) 2020-05-13 15:29:17 +03:00
George Kiagiadakis
68223e0ea3 tests: add unit test for WpCore disconnection 2020-05-13 15:21:10 +03:00
George Kiagiadakis
8e87bd323c core: fix disconnecting when pipewire quits 2020-05-13 15:20:26 +03:00
Julian Bouzas
21f6309621 config-endpoint: destroy the endpoint when its associated node is destroyed 2020-05-12 13:39:58 -04:00
Julian Bouzas
5ea7e6fc0b object-manager: emit the object-removed signal after the object is removed 2020-05-12 13:37:36 -04:00
George Kiagiadakis
7149745beb daemon: activate all available plugins after the sessions are ready 2020-05-12 18:18:24 +03:00
George Kiagiadakis
d13e411da3 lib: use WP_PROXY_FEATURE_LAST with a shift when declaring additional features
Features are flags, therefore we must NEVER use them without a shift,
otherwise bad mistakes happen, like the previous mistake of declaring
WP_SESSION_FEATURE_LINKS as the number after WP_SESSION_FEATURE_ENDPOINTS,
which ended up being (WP_SESSION_FEATURE_ENDPOINTS | WP_PROXY_FEATURE_PW_PROXY)
and it was always becoming available together with the ENDPOINTS feature.
2020-05-12 18:18:24 +03:00
George Kiagiadakis
e9c51653af modules: port config-endpoint to use WpPlugin 2020-05-12 18:18:24 +03:00
George Kiagiadakis
e63bf86995 lib: add a WpPlugin class
This serves as a base class for daemon plugins, which are implemented
inside modules
2020-05-12 18:18:21 +03:00
George Kiagiadakis
bfe76bf1d1 debug: honor WIREPLUMBER_DEBUG and ignore PIPEWIRE_DEBUG in pw_log
And also provide a way to disable this integration at runtime to
get pipewire's log back, with WIREPLUMBER_NO_PW_LOG=1
2020-05-12 18:16:55 +03:00
George Kiagiadakis
17c1eb3fac debug: downgrade SPA error & warn -> GLib warn & msg
The GLib error level is fatal, but pipewire doesn't use it that way.
Also, the GLib critical level is meant only for programming errors
(assertions) and not for runtime errors. warn & msg levels really
fit well with the error & warn, as they are being used in pipewire
currently.
2020-05-12 18:16:55 +03:00
Julian Bouzas
30ecff5a51 lib: remove deprecated base endpoint and policy APIs 2020-05-12 10:03:31 -04:00
Julian Bouzas
6044b23aed modules: refactor config-policy to use the new session item API 2020-05-12 10:03:29 -04:00
Julian Bouzas
4b7bc92e4b modules: remove pipewire module and move algorithms to module-si-adapter 2020-05-12 09:47:35 -04:00
Julian Bouzas
6317599477 src: config: add audio sink streams configuration 2020-05-12 09:47:35 -04:00
Julian Bouzas
7e8e6da857 si-standard-link: get the core from the stream node when its endpoint link proxy is not valid 2020-05-12 09:47:27 -04:00
Julian Bouzas
a99fa5272e si-convert: fix direction and link configuration 2020-05-11 12:47:13 -04:00
George Kiagiadakis
66a0bf6093 lib: implement a wp_init() function 2020-05-11 15:45:09 +03:00
Julian Bouzas
2e781ce607 src: config: load all session item modules 2020-05-11 12:03:43 +03:00
Julian Bouzas
104e90c98c modules: si-adapter: fix segfault when setting priority property 2020-05-11 12:03:43 +03:00
Julian Bouzas
616034174d src: main: add create-session command to create sessions when wireplumber starts 2020-05-11 12:03:43 +03:00
Julian Bouzas
af5da7a372 src: config: update default wireplumber configuration to work with new config-endpoint module 2020-05-11 12:03:43 +03:00
Julian Bouzas
17ee195902 spa-pod: rename wp_spa_pod_iterator_new to wp_spa_pod_iterate 2020-05-11 12:03:43 +03:00
Julian Bouzas
288f1f091b modules: refactor config-endpoint to use the new session item API 2020-05-11 12:03:43 +03:00
George Kiagiadakis
20708b28c7 examples: add a simple audio session management example 2020-05-11 11:40:55 +03:00
George Kiagiadakis
6537332984 si-adapter: add a config option to specify the preferred number of channels
This is mostly useful when using the adapter with audiotestsrc,
which supports an infinite number of channels. By specifying
a preference, we can limit it to the number of channels that we want.
2020-05-11 11:40:55 +03:00
George Kiagiadakis
e8e6c1d8bc algorithms: allow specifying a preferred number of channels in the format choosing algorithm 2020-05-11 11:40:55 +03:00
George Kiagiadakis
9e2aa612d8 si-adapter: return the correct stream parent when the adapter is nested 2020-05-11 11:40:55 +03:00
George Kiagiadakis
fe1ac40919 endpoint: ensure that streams are available when FEATURE_STREAMS is declared as ready 2020-05-11 09:56:06 +03:00
George Kiagiadakis
55f56fec2a session-item: remove the ACTIVATING/EXPORTING flag before the callback
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.
2020-05-08 19:56:08 +03:00
George Kiagiadakis
43711828ce transition: add the ability to use a GClosure instead of a GAsyncReadyCallback 2020-05-08 19:23:23 +03:00
George Kiagiadakis
63397a1ff2 core: debug core sync 2020-05-08 18:18:33 +03:00
George Kiagiadakis
11b99527b5 core: make the properties on wp_core_new to be (transfer full)
This aligns better with the general design of consuming property
objects on constructors, both in PipeWire and WirePlumber APIs
2020-05-08 17:12:31 +03:00
George Kiagiadakis
29c35ce8aa si-convert: fix internal link handling
* there is just one link, no need for a list
* warn if something goes wrong and don't assert
2020-05-07 17:01:27 +03:00
George Kiagiadakis
3cfd0d3dc8 si-convert: use the "reverse" port context on self for the internal links 2020-05-07 16:54:12 +03:00
George Kiagiadakis
c02bff50cd si-standard-link: add options to use different port contexts 2020-05-07 16:48:06 +03:00
George Kiagiadakis
cc72b3757c si-standard-link: manage lifetime internally 2020-05-07 16:38:14 +03:00
George Kiagiadakis
f24fc53d5a tests/common: add common function for ensuring an object manager is installed
It can be a bit tricky because the "installed" signal may be fired
from inside the context of wp_core_install_object_manager(),
in which case the main loop should not be executed (or it will never quit)
2020-05-07 16:16:45 +03:00
George Kiagiadakis
9db4a54591 session-item: handle destroyed endpoint links
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
2020-05-07 16:02:23 +03:00
George Kiagiadakis
ded2e34eb6 global: properly destroy impl proxies that were removed by the server
When a pw_global is removed on the server (by pw_registry_destroy() or other
means), it triggers the proxy removed & the registry global_remove callbacks,
but it does not necessarily destroy the pw_proxy.

For client proxies, we were previously destroying them by unrefing the WpProxy
in wp_global_rm_flags(), since the global was not "owned" by the WpProxy.

For impl proxies, we were not doing anything, as we expected that it would
only be removed from the registry if the local WpProxy was destroyed first.
This is not always the case, though, as the server or another client may
request to destroy this proxy with pw_registry_destroy()

Now we always destroy the pw_proxy as soon as it is removed from the registry,
no matter if it was a client or an impl proxy. If it was an impl proxy,
the WpProxy will continue to live and it's up to the code that created it
to handle the "pw-proxy-destroyed" signal and do something meaningful.
If it was a client proxy, the global will still unref the WpProxy right after
destroying the pw_proxy and there is no change in behavior.
2020-05-07 15:50:14 +03:00
George Kiagiadakis
3b086167ae proxy: add _request_destroy() method for destroying remote objects
Useful to destroy links and endpoint-links
2020-05-07 15:47:15 +03:00
George Kiagiadakis
bd0ede2c6a object-manager: add _is_installed() method to query installation status 2020-05-07 15:45:00 +03:00
George Kiagiadakis
a10ee91bd4 core: add idle & timeout method variants that take a GClosure 2020-05-07 11:10:12 +03:00
George Kiagiadakis
6501307d27 tests: add si-standard-link unit test 2020-05-05 18:04:50 +03:00
George Kiagiadakis
7966a8d456 si-standard-link: fix endpoint linking bugs and add some debug statements 2020-05-05 18:04:05 +03:00
George Kiagiadakis
48d7c44fd4 link: add method to get object ids 2020-05-05 18:04:05 +03:00
George Kiagiadakis
7377d15f42 debug: handle null objects in WP_OBJECT_ARGS 2020-05-05 18:04:05 +03:00