Commit graph

279 commits

Author SHA1 Message Date
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
cc72b3757c si-standard-link: manage lifetime internally 2020-05-07 16:38:14 +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
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
George Kiagiadakis
52b52ea63c session/endpoint/node: proxy the object-manager API for looking up child objects 2020-05-05 18:04:05 +03:00
George Kiagiadakis
b97540a109 endpoint: add wp_endpoint_create_link method 2020-05-05 18:04:05 +03:00
George Kiagiadakis
adc4b20487 session-bin: improve iterator 2020-05-04 18:03:53 +03:00
George Kiagiadakis
82abe41759 session-bin: add _get_n_children() method 2020-05-04 14:13:32 +03:00
George Kiagiadakis
9612d35ca4 si-interfaces: drop the multi-endpoint interface
It's not well-defined; we'll come back to that later
2020-05-04 09:35:22 +03:00
Julian Bouzas
791e9170aa si-interfaces: transfer full when returning from _get_stream_parent_endpoint 2020-05-03 19:54:31 +03:00
Julian Bouzas
230c103f18 session-item: add _get_parent API 2020-05-03 19:54:31 +03:00
Julian Bouzas
2f43e3a1e7 lib: add new session-bin class to handle multiple session items 2020-05-03 19:54:31 +03:00
George Kiagiadakis
bccb160bc2 port some more deprecated object-manager calls 2020-05-03 19:49:21 +03:00
George Kiagiadakis
735b44c238 object-manager/proxy: sprinkle some debug/trace statements 2020-05-03 19:44:42 +03:00
George Kiagiadakis
3617ca07ae lib: align node/endpoint/session features ports/streams/endpoints,links
- Use similar code for consistency
- Add changed signals everywhere
- Port to the new object-manager API
2020-05-03 19:42:42 +03:00
George Kiagiadakis
83f399395c proxy: emit 'bound' after setting FEATURE_BOUND
signal handlers expect FEATURE_BOUND to be set
2020-05-03 17:46:49 +03:00
George Kiagiadakis
9e1b5de93f object-manager: port to WpObjectInterest and add more useful API based on it 2020-05-01 19:23:54 +03:00
George Kiagiadakis
db40a593b3 lib: implement WpObjectInterest 2020-05-01 19:21:08 +03:00
George Kiagiadakis
70214fcd26 debug: add wp_critical* macros 2020-05-01 12:00:28 +03:00
George Kiagiadakis
738b88aaba debug: randomize object printout colors
This way we can more easily distinguish different objects when
looking at the log, although it's not perfect
2020-04-27 11:49:55 +03:00
George Kiagiadakis
2c1df41a16 debug: optimize wp_log_level_is_enabled()
Add the 'const' attribute to let the compiler know that it doesn't
need to call it multiple times for the same debug level argument,
since the enabled log levels cannot change at runtime.
2020-04-27 10:57:59 +03:00
George Kiagiadakis
1faa752cd0 core: trace pw main loop execution 2020-04-24 20:42:27 +03:00
George Kiagiadakis
9f1b46eed6 object-manager: implement the 'installed' signal and improve state management
The 'installed' signal can be used to know that there are no
known objects that are being prepared internally, so the object
manager is ready to use.

This also improves internal state management so that the 'objects-changed'
signal cannot be fired earlier than it should. Previously there
were corner cases with complex proxy features, as the object manager
relied on the fact that after a core 'sync' it is safe to assume
that all proxies are augmented... that's not always the case.
2020-04-24 20:36:53 +03:00
George Kiagiadakis
1c74a83a5c tests: si-simple-node-endpoint: add export test 2020-04-23 17:25:57 +03:00
George Kiagiadakis
99f7220064 node: ensure FEATURE_PORTS gets enabled after the ports are discovered
+ add a ports-changed signal
2020-04-23 15:23:41 +03:00
George Kiagiadakis
d61b7904f9 modules: fix small issues in the session items 2020-04-23 15:22:32 +03:00
George Kiagiadakis
32859356e8 module: add annotations in wp_module_load() 2020-04-22 17:06:29 +03:00
George Kiagiadakis
45059cb348 si-interfaces: add default implementations of optional methods
Implementations are not required to provide implementations for these
if they don't need them
2020-04-22 13:49:37 +03:00
George Kiagiadakis
78fe4dc30e spa-type: add the AUDIO_CHANNEL table 2020-04-22 13:44:40 +03:00
George Kiagiadakis
33e67f2189 port: add wp_port_get_direction() 2020-04-22 10:59:12 +03:00
George Kiagiadakis
72ff4577c5 node: add useful API to access node info, associated ports and state changes 2020-04-22 10:57:30 +03:00
Julian Bouzas
135b1c2cbf object-manager: only get proxy properties when needed 2020-04-21 16:11:05 -04:00
Julian Bouzas
0045fe03c9 proxy: add set and get control vmethods, and remove them from sub-classes 2020-04-21 16:11:05 -04:00
Julian Bouzas
cfbcb5eca3 proxy: use WpSpaPod instead of struct spa_pod in public API 2020-04-21 16:11:05 -04:00
Julian Bouzas
fe4bef8bbc spa-pod: fix constness and add get_object_type_name and get_choice_type_name 2020-04-21 16:11:05 -04:00
Julian Bouzas
03c15a8132 spa-type: add format, param-port-config and param-profile tables 2020-04-21 16:10:38 -04:00
Julian Bouzas
058f8ae1e0 spa-pod: add wp_spa_pod_equal API 2020-04-21 09:38:36 -04:00
George Kiagiadakis
1dccdcf415 object-manager: replace GPtrArray API with WpIterator
+ add the useful _find_proxy() method
2020-04-21 13:21:03 +03:00
George Kiagiadakis
49b63b6045 session-item: refactor export to use a process similar to activate
+ expose the export transition in the session item class
+ make the export-related flags immutable
+ add an export error flag
+ update and improve documentation
2020-04-16 17:38:31 +03:00
George Kiagiadakis
441a778b2e session-item: introduce a rollback() virtual method
+ 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.
2020-04-16 13:18:21 +03:00
George Kiagiadakis
6b51e5842c tests: add session-item unit test 2020-04-16 11:55:23 +03:00
George Kiagiadakis
78cdf4b8e6 debug: use the "default" domain to log messages without a domain
This allows filtering messages without a domain using WIREPLUMBER_DEBUG
2020-04-15 18:33:33 +03:00
George Kiagiadakis
9ca342f89f debug: update all library code to use the new debug system
+ enable the new log writer on the executables
+ enable structured logging in the tests
2020-04-14 18:31:17 +03:00
George Kiagiadakis
5bf40e86cb endpoint: fix compiler warnings 2020-04-14 15:18:44 +03:00