Commit graph

556 commits

Author SHA1 Message Date
Julian Bouzas
188a10e0e7 pipewire-object-mixin: make sure enum params task is only triggered once
Always remove the task from the list before returning to make sure it will
always be triggered once.
2021-05-19 10:26:17 -04:00
Julian Bouzas
7e23f313b3 proxy: don't accept NULL pw_proxy in set_pw_proxy API 2021-05-18 10:01:13 -04:00
Julian Bouzas
8fdd99d956 global-proxy: delay object creation until bound feature is requested
Allows handling errors if creation fails
2021-05-18 09:24:33 -04:00
George Kiagiadakis
63239bdfda proxy: relax proxy error warning messages
These are also printed by libpipewire on the DEBUG level
and they are really not that harmful, so we don't need to spam
users with "failed" messages and alarm them
2021-05-13 08:52:22 -04:00
George Kiagiadakis
7ff2bbc0eb pw-object-mixin: watch for proxy errors during enum_params 2021-05-13 08:52:22 -04:00
George Kiagiadakis
0b558eca74 proxy: add a "bind" watch, to watch for proxy errors while binding/exporting
Add a unit test for this. Create a link with invalid nodes and expect
the activation transition to error out.
2021-05-13 08:52:22 -04:00
George Kiagiadakis
7cf67a821a proxy: add error signal 2021-05-13 08:52:22 -04:00
Julian Bouzas
58db9e1fad global-proxy: destroy the global when proxy is destroyed 2021-05-12 14:04:34 -04:00
Julian Bouzas
d8ed6e4376 global-proxy: inherit from WpProxy when declaring class 2021-05-12 13:33:08 -04:00
Julian Bouzas
419af5a228 spa-pod: respect the SPA size for long and int APIs
Fixes some issues for 32bit architectures
2021-05-12 11:53:31 -04:00
Julian Bouzas
51964d30cf si-interfaces: add WpSiAdapter interface to set and get session item fortmat 2021-05-12 10:36:31 -04:00
Julian Bouzas
a37b4bf20d session-item: add _get_property API 2021-05-12 10:36:31 -04:00
Julian Bouzas
d68636f9b3 si-interfaces: rename WpSiPortInfo to WpSiLinkable 2021-05-11 10:56:44 -04:00
Julian Bouzas
e4d8f2a2df session-item: remove undefined API 2021-05-06 13:41:42 -04:00
George Kiagiadakis
a93dbf0845 wp: remove WpSessionBin
This is no longer used and likely not very useful now that we have
a simpler design.
We can re-add it in the future if necessary, but let's keep it out
of the 0.4 release.
2021-05-06 16:04:39 +03:00
George Kiagiadakis
257d5cba47 wp: rename debug.{h,c} to log.{h,c}
Also rename the intermediate lua api table WpDebug -> WpLog

Keeps things more consistent with the function names (wp_log*),
with the lua api (Log.*) and with pipewire using log.{h,c} as well.
After all, these functions are for logging...
2021-05-06 15:50:07 +03:00
George Kiagiadakis
6939d8900a core: use log.level from the pw_context
And don't override PIPEWIRE_DEBUG, unless WIREPLUMBER_DEBUG is set.
This allows pipewire to use log.level as well to set up its logging.

If WIREPLUMBER_DEBUG is set, though, override PIPEWIRE_DEBUG to prevent
log.level from being used.
2021-04-21 19:03:47 +03:00
George Kiagiadakis
61876a97b9 log: factor out the log level configuration into wp_log_level_set()
Initialize the log level with WIREPLUMBER_DEBUG in wp_init()
2021-04-21 13:49:03 +03:00
George Kiagiadakis
44c96b6c49 impl-node: implement WpPipewireObject
This fixes adjusting volume for bluetooth nodes.
Previously, the spa device would request a software volume change
that we did not handle because WpImplNode was not a WpPipewireObject
and there was no way to set the Props param on it.
2021-04-16 20:02:54 +03:00
George Kiagiadakis
9b74fbc6ac device: debug and enhance spa device event handling 2021-04-16 20:01:56 +03:00
George Kiagiadakis
3485befc81 endpoint: remove useless pw_proxy_destroyed handlers 2021-04-05 16:03:55 +03:00
George Kiagiadakis
d264bc460c registry: fix issues with dangling WpGlobal objects causing assertion failures
The main problem observed is when a link that is owned by a WpLink
is removed from the server because one of the linked nodes is gone.
This would cause the APPEARS_ON_REGISTRY flag to go away but the
WpGlobal would still remain in the globals list...

To fix this, forcibly remove the global from the globals list when
it is removed from the registry, even if it is still owned by some
proxy. The proxy at that point is unable to function anyway, because
we make sure to destroy the pw_proxy by removing FEATURE_BOUND when
the global is removed from the registry.

Additionally, ref global->proxy before removing FEATURE_BOUND to
prevent crashing. If the proxy owns the global and the pw-proxy-destroyed
signal causes whoever owns the proxy to drop his reference, _deactivate()
will crash because no-one will be holding a ref to the proxy.
2021-04-05 16:03:55 +03:00
Julian Bouzas
fb1daa0bf2 modules: use dots instead of dashes for session item properties
Keeps consistency with PipeWire
2021-04-02 11:22:22 -04:00
George Kiagiadakis
5f1f96a5da registry: fix odd assertion failures that occured from time to time
The assumption about the global id in wp_registry_prepare_new_global()
was not valid because this function may also be called from the proxy
bound event and this may be before the registry has signalled the
removal of an old global with the same id, for instance

We should instead check this at the point where we expose the global.
If the assertion doesn't hold at that point, we are going to leak an
old WpGlobal, so we must ensure it.
2021-04-01 12:48:57 +03:00
Julian Bouzas
ec30336fcf session-item: add id property
Makes it easier when handling session items in Lua
2021-03-26 16:16:02 -04:00
Julian Bouzas
ebf52adb21 si-interfaces: make WpSiLink work with WpSiPortInfo instead of WpSiEndpoint 2021-03-26 16:16:02 -04:00
Julian Bouzas
64cf2bd644 si-interfaces: rename WpSiEndpointAcquisition to WpSiAcquisition
The get_endpoint_acquisition() vmethod has also been moved to WpSiPortInfo, and
therefore renamed to get_acquisition().
2021-03-26 16:16:02 -04:00
Julian Bouzas
13fc0adb22 m-si-standard-link: use a weak reference for in and out endpoints
Allows checking if the endpoints are still valid before releasing the
acquisition. Sometimes the endpoints are destroyed before the link, and
releasing acquisition is not needed. There is no way to check that with raw
pointers.
2021-03-26 16:15:38 -04:00
George Kiagiadakis
eeccb24017 properties: add wp_properties_sort()
Depends on pipewire!555 to avoid breaking stuff
2021-03-26 19:06:06 +02:00
George Kiagiadakis
c1f1614eb6 object: deactivate only the features that were previously active 2021-03-25 18:13:11 +02:00
Julian Bouzas
17873c3ace object-interest: add support for session item properties 2021-03-18 14:30:11 -04:00
Julian Bouzas
3aef916d51 session-item: add _register and _remove API
Allows using object managers to listen for registered items
2021-03-18 14:30:11 -04:00
Julian Bouzas
120aab04ae session-item: refactor and inherit from WpObject
This adds WP_SESSION_ITEM_FEATURE_ACTIVE and WP_SESSION_ITEM_FEATURE_EXPORTED
features, so _activate and _export APIs have been removed. Modules and unit
tests have also been updated.
2021-03-18 14:30:05 -04:00
Julian Bouzas
5a11510e21 session-bin: remove unused wp_session_bin_new API 2021-03-18 12:10:37 -04:00
Julian Bouzas
5a1dfc02d2 lib: make WpImplEndpoint and WpImplEndpointLink public 2021-03-18 12:10:37 -04:00
Julian Bouzas
12b2c00d0b lib: remove WpEndpointStream API
Add all that goes with it.
2021-03-18 12:10:37 -04:00
George Kiagiadakis
9609a79903 wp_init: set PIPEWIRE_DEBUG
It is inevitable to avoid setting PIPEWIRE_DEBUG, because the
log.level from client.conf will kick in and change the pipewire log
level when the pw_context is created. PIPEWIRE_DEBUG is the only
way to override.
2021-03-16 17:45:30 +02:00
George Kiagiadakis
faff5c644c spa-device: do not assert if the activation transition fails 2021-03-16 16:15:32 +02:00
Julian Bouzas
5e69a82d4b object: add wp_object_activate_closure API 2021-03-13 20:10:30 -05:00
George Kiagiadakis
5a0a4532d7 lib: remove WpConfiguration
it's not used anymore
2021-03-04 19:11:53 +02:00
George Kiagiadakis
7eed2acd76 lib: documentation fixes 2021-03-04 19:10:10 +02:00
George Kiagiadakis
941b0324e5 object-interest: remove type checks
They are not strictly necessary and just make our life harder
2021-03-02 18:25:34 +02:00
George Kiagiadakis
9f50117fa7 lib: remove module.{c,h} 2021-02-25 17:12:04 +02:00
George Kiagiadakis
47b6417bbe object-interest: allow matching against WpProperties objects 2021-02-13 11:55:00 +02:00
Julian Bouzas
dc2ad1f25d rename all foo_iterate APIs to foo_new_iterator
Avoids confusion with LUA iterate API
2021-02-05 11:33:23 -05:00
George Kiagiadakis
ce66025846 node: change send_command() to take a string
Use the spa type system to locate the enumeration value that corresponds
to that string and send that
2021-02-05 11:05:26 +02:00
George Kiagiadakis
096a9b4c15 proxy: add a method to query the interface type 2021-02-04 16:51:25 +02:00
George Kiagiadakis
29559b4065 wp: add wp_get_data_dir() 2021-02-03 17:16:51 +02:00
George Kiagiadakis
9fa17e04b4 object-interest: add a NOT_EQUALS verb 2021-02-03 17:16:51 +02:00
George Kiagiadakis
cb228637d6 wp: export functions to get the module & config dirs 2021-02-03 17:16:51 +02:00