Commit graph

205 commits

Author SHA1 Message Date
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
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
George Kiagiadakis
efb33ddd1b lib: introduce export macros and hide all private symbols 2020-01-16 18:50:07 +02:00
Julian Bouzas
83a0725b6a modules: remove match priorities from config files and use the filename instead 2020-01-14 09:15:22 -05:00
Julian Bouzas
a9ac1fdc06 update to the latest pipewire API 2020-01-13 15:07:08 -05:00
Julian Bouzas
4ec61d79b8 config-static-nodes: add config static nodes module
This module allows wireplumber to create static nodes that match a specific
device using a spa node factory. Matching is optional, and if there is no match,
the node will always be created.
2020-01-09 08:50:03 -05:00
Julian Bouzas
3396470f01 modules: simplify config endpoint module 2020-01-09 08:50:03 -05:00
George Kiagiadakis
0e98e4150b config-policy: debug handling of endpoints 2019-12-19 14:49:57 +02:00
George Kiagiadakis
40e4ce8909 config-policy: push endpoints with keep=true to the end of the list when sorting
This ensures that endpoints with keep=false will still have
a chance to link when ones with keep=true exist. This also effectively
means that role priority does not matter when keep=true: we keep these
links active no matter what, while policy still applies normally for
all others.

For example, a final sorted list with these endpoints will end up
looking like this:

* ep1, role priority=25, keep=false
* ep2, role priority=20, keep=false
* ep3, role priority=25, keep=true
* ep4, role priority=75, keep=true

... which will effectively cause ep1, ep3 and ep4 to be linked.
2019-12-19 14:43:40 +02:00
George Kiagiadakis
729aee5c4c config-policy: do not unlink other endpoints when linking one with keep=true
keep=true should work in both ways:
* keep the endpoint with this property linked at all times
* keep other already linked endpoints when linking this one
2019-12-19 14:40:50 +02:00
George Kiagiadakis
3c5b5ea08c config-policy: remove _can_link_stream() function
This is no longer needed since we sort endpoints by role priority
before trying to link them and we link only the highest priority one.
After this sorting, the highest priority endpoint is guaranteed
to be able to link, so _can_link_stream() always returns TRUE.
2019-12-19 14:38:01 +02:00
George Kiagiadakis
152611dd3f parser-endpoint: fix typo; initialize endpoint priority instead of reseting the match one 2019-12-18 16:04:57 +02:00
George Kiagiadakis
e10b0f871d lib: debug loading of config files + endpoint priorities 2019-12-18 15:43:29 +02:00
George Kiagiadakis
c1e1d67b72 config-policy: debug rescans 2019-12-17 18:03:02 +02:00
George Kiagiadakis
56f12047ab module-session: debug default endpoint changes 2019-12-17 18:00:34 +02:00
George Kiagiadakis
bb3a91bd36 session: select the default endpoint based on endpoint priority 2019-12-17 13:54:09 +02:00
Julian Bouzas
1d00104642 config-policy: only handle the highest priority endpoint for a target, and the ones with keep=true 2019-12-16 14:05:14 -05:00
Julian Bouzas
eda8507ef7 config-policy: use the default session endpoint if target-endpoint is not defined 2019-12-16 13:37:05 -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
0552e7da87 parser-endpoint-link: don't parse unused state value 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
Julian Bouzas
50f06baf3a modules: remove alsa-udev and audio-client modules 2019-12-16 13:03:36 -05:00
Julian Bouzas
134f62a189 softdsp-endpoint: don't rename the endpoint on creation 2019-12-16 07:56:28 -05:00
Julian Bouzas
b9e594e5f9 parser-endpoint-link: higher number means higher priority 2019-12-13 14:55:13 -05:00
Julian Bouzas
db7a3a3b9c config-policy: sort endpoints by creation time when finding target 2019-12-13 14:43:50 -05:00
George Kiagiadakis
8e40b18fb1 softdsp-endpoint: implement volume controls via the exported endpoint
and drop the WpBaseEndpoint controls entirely
2019-12-12 01:37:48 +02:00
George Kiagiadakis
aa4fb5b1aa modules: implement module-session, a WpSession provider module
This keeps track of the default endpoint and selects a default
based on endpoint priorities when devices are discovered
2019-12-11 23:45:06 +02:00
George Kiagiadakis
57ac90b188 config-policy: avoid race condition in the unit tests
Clear self->pending_endpoint before sending the done signal,
because the signal will trigger a new endpoint to be added in the
unit test and this may happen before g_clear_object is called,
in which case adding the new endpoint fails
2019-12-11 19:15:02 +02:00
George Kiagiadakis
57ffc0435f softdsp-endpoint: export Endpoint object on the pipewire registry 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
e8dad1a4f2 stream: clear proxy when finalizing 2019-12-10 19:34:30 -05:00
George Kiagiadakis
f789c4bce4 link-algorithm: link mono inputs to all available target ports
This avoids hearing mono audio only on the left speaker
2019-12-11 01:55:42 +02:00
George Kiagiadakis
3a4040ddaf config-policy: fix typo in variable check 2019-12-11 01:27:41 +02:00
George Kiagiadakis
133469d566 config-policy: fix stream priority logic when the stream name comes from media.role
the _can_link function was previously assuming that the target
stream is always specified in the configuration file
2019-12-11 01:04:41 +02:00
George Kiagiadakis
dcecc217d6 config-policy: add some more debug statements 2019-12-11 00:45:05 +02:00
Julian Bouzas
34ebbe47d7 config-policy: prioritize role from configuration file
The role defined in the endpoint-link configuration files must have higher
priority than the one set in the endpoint. If none of them are set, the config
policy fallbacks to the lowest one defined in the streams configuration file
2019-12-05 10:50:10 -05:00
Julian Bouzas
9dac5fdaf5 parser-streams: add get_lowest_stream API 2019-12-05 10:46:34 -05:00
George Kiagiadakis
a11cd3b651 parser-endpoint-link: make 'properties' subtables of 'match-endpoint' and 'target-endpoint' 2019-12-05 12:21:24 +02:00
Julian Bouzas
664db8a200 modules: add config policy module 2019-12-04 16:38:35 -05:00
Julian Bouzas
c8417f8826 endpoint: add get_role API 2019-12-04 16:38:35 -05:00
Julian Bouzas
d6ed17472a modules: always use the node name when creating endpoints 2019-12-04 16:38:35 -05:00
Julian Bouzas
cd3a414e2f softdsp-endpoint: remove persistent hack 2019-12-04 16:38:35 -05:00
Julian Bouzas
7bd9f84e6f endpoint: add keep property 2019-12-04 16:38:35 -05:00