Commit graph

220 commits

Author SHA1 Message Date
George Kiagiadakis
ca8d100b3f meson: temporarily add check to conditionally enable the fade functionality
and in case it's missing, also #define some things to make compilation work,
since this is only available in a pipewire branch right now
2020-02-28 13:25:35 +02:00
Julian Bouzas
a861e47643 config-policy: fade in/out when streams are linked/unlinked 2020-02-27 08:39:15 -05:00
Julian Bouzas
8c674b9f69 base-endpoint: add wp_base_endpoint_begin_fade API 2020-02-27 08:39:15 -05:00
Julian Bouzas
b1d03cd637 stream: add wp_audio_stream_begin_fade API 2020-02-27 08:39:15 -05:00
Julian Bouzas
eaea2156cb stream: create an audio-fade-source control node if there is a control port 2020-02-27 08:37:15 -05:00
Julian Bouzas
16cdac6dd6 convert/adapter: enable control port if input direction 2020-02-27 08:37:15 -05:00
Julian Bouzas
2439cab55f convert: use factory name SPA macro 2020-02-27 08:37:15 -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
fefa4b9191 config-endpoint-context: add _get_length API 2020-02-26 11:36:09 -05:00
Julian Bouzas
49716f603c config-static-nodes-context: add _get_length API 2020-02-26 11:05:02 -05:00
Julian Bouzas
8e719eb47c config-static-nodes: use WP_PROXY_FEATURES_STANDARD when agumenting static nodes
This will solve a possible race condition in the unit test when destroying the
autotestsrc proxy while its node_event_info is being called.
2020-02-25 09:57:02 -05:00
George Kiagiadakis
87cc64b40b module-session: export session after the core is connected
wp_exported_export() used to do that internally, but it's cleaner
to do it this way now
2020-02-14 17:18:58 +02: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
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