Commit graph

59 commits

Author SHA1 Message Date
George Kiagiadakis
6b51e5842c tests: add session-item unit test 2020-04-16 11:55:23 +03:00
George Kiagiadakis
914e2b84df tests: remove the global G_LOG_DOMAIN to avoid issues with including code from elsewhere
including wp/spa-props.c currently re-defines G_LOG_DOMAIN
in the spa-props.c unit test
2020-04-15 18:40:52 +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
2ac6210b6d Merge branch 'master' into next 2020-04-14 15:17:01 +03:00
Julian Bouzas
8c209ecf48 lib: add spa pod API 2020-04-13 13:32:04 -04:00
Julian Bouzas
b79fcf9418 lib: add spa type API 2020-04-09 13:09:57 -04:00
George Kiagiadakis
4a1a19d7cd session: add FEATURE_ENDPOINTS, a feature to cache endpoint proxies 2020-04-01 13:38:39 +03:00
George Kiagiadakis
79a39e98c9 transition: call execute_step() with _STEP_ERROR in error conditions
This allows the implementation to rollback changes, cancel jobs, etc
2020-03-31 16:11:08 +03:00
George Kiagiadakis
405e8ba0d5 session-item / endpoint: implement exporting a WpSiEndpoint
* 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)
2020-03-29 15:18:20 +03:00
George Kiagiadakis
5f169d190f lib: implement a new WpTransition class
This is an asynchronous operation class, like GTask,
but it is made to execute several operations underneath,
using a state machine, instead of just a single operation.
2020-03-29 15:02:59 +03:00
Julian Bouzas
daa8091666 modules: add monitor dbus device reservation API with unit tests 2020-03-20 14:01:20 -04:00
Julian Bouzas
8adde3df75 tests: don't load unneeded audioconvert plugin in config-policy tests 2020-03-10 12:50:27 -04:00
Julian Bouzas
64f131cbdd tests: implement begin_fade vmethod on WpFakeEndpoint 2020-02-27 08:39:15 -05:00
Julian Bouzas
620f95b628 core: add source nullable parameter in _idle_add and _timeout_add APIs 2020-02-27 08:39:10 -05:00
Julian Bouzas
8aa695770c tests: config-policy: run the main loop in the same thread 2020-02-26 15:51:58 -05:00
Julian Bouzas
3fd65ac964 tests: config-endpoints: run the main loop in the same thread 2020-02-26 11:37:23 -05:00
Julian Bouzas
266b5422f2 tests: config-static-nodes: run the main loop in the same thread 2020-02-26 11:14:52 -05:00
Julian Bouzas
46aaa9ef4f tests: fix memleak when destroying test server 2020-02-25 15:40:39 -05:00
George Kiagiadakis
753e708544 object-manager: refactor to be able to track locally created proxies
There are 3 kinds of WpProxy objects:
 * the ones that are created as a result of binding a global
   from the registry
 * the ones that are created as a result of calling into a remote
   factory (wp_node_new_from_factory, etc...)
 * the ones that are a local implementation of an object
   (WpImplNode, etc...) and are exported

Previously the object manager was only able to track the first kind.
With these changes we can now also have globals associated with
WpProxies that were created earlier (and caused the creation of the global).
This saves some resources and reduces round-trips (in case client
code wants to change properties of an object that is locally
implemented, it shouldn't need to do a round-trip through the server)
2020-02-14 17:12:23 +02:00
George Kiagiadakis
a92e1a64ec global & object-manager: use GType instead of the pipewire type 2020-02-12 14:15:51 +02:00
George Kiagiadakis
c9cab2cd53 endpoint: refactor into WpEndpoint & WpImplEndpoint 2020-02-12 11:30:21 +02:00
George Kiagiadakis
8e50fab112 session: refactor into WpSession & WpImplSession 2020-02-12 11:28:02 +02:00
George Kiagiadakis
9330208ada proxy/core: refactor object creation
* core no longer exposes create_remote/local_object
* node, device & link have constructor methods
  to enable the create_remote_object functionality
* added WpImplNode to wrap pw_impl_node and allow creating
  "local" node instances
* added WpSpaDevice to wrap spa_device and allow creating
  "local" device instances
* exporting objects in all cases now happens by requesting
  FEATURE_BOUND from the proxy, eliminating the need for WpExported
* replaced WpMonitor by new, simpler code directly in module-monitor
* the proxy type lookup table in WpProxy is gone, we now
  use a field on the class structure of every WpProxy subclass
  and iterate through all the class structures instead; this is
  more flexible and extensible
2020-02-11 11:07:44 +02:00
George Kiagiadakis
d8ae151aba proxy: replace global-id with bound-id
+ use the pw_proxy API to find the bound id instead
of relying on WpGlobal

This has the advantage that it works also for exported
objects and for objects that have been created by calling
into a remote factory (such as the link-factory), so we can
now know the global id of all proxies, not only the ones
that have been created by the registry.
2020-02-10 18:58:41 +02:00
George Kiagiadakis
c671b0faca lib: drop the proxy- prefix from client, device, link, port & node 2020-01-22 19:46:17 +02:00
George Kiagiadakis
5c47f1df2c proxy: unify common info/params API in the WpProxy base class 2020-01-22 18:30:44 +02:00
George Kiagiadakis
6f2844ac13 proxy: remove interface-quark
This is not used anymore. It was useful when we were using it as
a detail in the global-added signal, but that is gone now.
2020-01-22 18:07:16 +02:00
George Kiagiadakis
f7a0e710a5 lib: remove wp_proxy_sync in favor of wp_core_sync
They are equivalent, there is no real benefit in having both
2020-01-22 18:07:16 +02:00
Julian Bouzas
a9ac1fdc06 update to the latest pipewire API 2020-01-13 15:07:08 -05:00
Julian Bouzas
df6d1e7e2b tests: add config-static-nodes unit test 2020-01-09 08:50:03 -05:00
Julian Bouzas
d3d977cbe4 config-policy: add timeout when waiting on conditional variables 2019-12-27 08:38:07 -05:00
Julian Bouzas
d485c1192a base-endpoint: add _get_global_id API 2019-12-16 13:37:05 -05:00
Julian Bouzas
7ac9c6359c modules: only allow 'sink' and 'source' strings when parsing direction in config files 2019-12-16 13:37:05 -05:00
Julian Bouzas
0ad0c9fb9d base-endpoint: add _get_priority API 2019-12-16 13:37:05 -05:00
Julian Bouzas
3fe1e96e2e config-policy: remove parsing of streams file
This is now done by the config endpoint module
2019-12-16 13:37:05 -05:00
Julian Bouzas
acda80d77c modules: add config endpoint module 2019-12-16 13:36:56 -05:00
George Kiagiadakis
a71d433a5e lib: implement WpEndpoint (interface + Proxy + Exported + unit test)
heavily based on the WpSession implementation
2019-12-11 19:05:09 +02:00
George Kiagiadakis
c0455c981d lib: rename WpEndpoint* to WpBaseEndpoint*
to avoid name clashing with the upcoming WpEndpoint interface
that is going to be the common interface of Wp{Proxy,Exported}Endpoint
2019-12-11 19:05:05 +02:00
Julian Bouzas
b999ecf9d4 tests: improved config policy priority test to make sure endpoint role works 2019-12-11 08:55:00 -05:00
Julian Bouzas
1dec637ab5 tests: clear core weak reference when finalizing endpoint-link-fake 2019-12-10 19:35:12 -05:00
Julian Bouzas
aab57d791e tests: make sure core is connected before starting config-policy tests 2019-12-06 13:26:56 -05:00
Julian Bouzas
8bdadd5a71 tests: fix config policy role test to work with new priotity logic 2019-12-05 10:51:39 -05:00
Julian Bouzas
d5c3f7ee87 tests: add config-policy unit test 2019-12-04 16:38:35 -05:00
Julian Bouzas
9a9d773b06 wptoml: add new library to parse TOML files 2019-12-04 16:38:35 -05:00
George Kiagiadakis
6e4752a736 tests: add unit test for WpSession (proxy + exported) 2019-12-04 18:50:43 +02:00
George Kiagiadakis
ce3883c1a2 lib: add WpSpaProps, a helper to deal with SPA_PARAM_Props & SPA_PARAM_PropInfo 2019-12-04 18:49:14 +02:00
George Kiagiadakis
6f358e9a3a adapter: select a reasonable device format instead of letting pipewire choose its own 2019-11-18 11:02:03 +02:00
George Kiagiadakis
e7e5c66853 lib: introduce WpObjectManager
* rework how global objects are stored in the core
* rework how users get notified about global objects
  and proxies of remote global objects

The purpose of this change is to have a class that can manage
objects that are registered in the core or signalled through the
registry. This object can declare interest on certain types
of global objects and only keep & signal those objects that it is
interested in. Additionally, it can prepare proxy features and
asynchronously deliver an 'objects-changed' signal, which is
basically telling us that the list of objects has changed.

This is useful to simplify port proxies management in WpAudioStream.
Now the stream object can declare that it is interested in ports
that have "node.id" == X and the object manager will only maintain
a list of those. Additionally, it will emit the 'objects-changed'
signal when the list of ports is complete, so there is no reason to
do complex operations and core syncs in the WpAudioStream class
in order to figure out when the list of ports is ready.

As a side effect, this also reduces resource management. Now we
don't construct a WpProxy for every global that pipewire reports;
we only construct proxies when there is interest in them!

Another interesting side effect is that we can now register an
object manager at any point in time and get immediately notified
about remote globals that already exist. i.e. when you register
an object manager that is interested in nodes, it will be immediately
notified about all the existing nodes in the graph. This is useful
to avoid race conditions between connecting the signal and objects
beting created in pipewire
2019-11-13 15:49:39 +02:00
Bastien Nocera
e8fadbcbda build: Fix build after recent PipeWire header changes
PipeWire headers were recently cleaned up to reduce the number of
included headers. This leads to a number of functions and types not
being included when needed in wireplumber.
2019-11-06 16:18:30 +02:00
George Kiagiadakis
5a70ed31a8 tests: proxy: fix failure due to property key change in pipewire 2019-10-10 12:30:45 +03:00