Commit graph

260 commits

Author SHA1 Message Date
Julian Bouzas
585ad72c7c spa-json: add null character when finishing building json 2022-02-01 16:07:12 +00:00
Julian Bouzas
b0ddd6f890 m-lua-scripting: add Json.Raw constructor 2022-01-26 09:53:24 -05:00
Julian Bouzas
20187e07b5 m-lua-scripting: add WpSpaJson API 2022-01-25 07:20:35 -05:00
Julian Bouzas
4c1574117a spa-json: add new WpSpaJson API 2022-01-25 07:20:35 -05:00
Wim Taymans
7d4369c1af tests: don't leak fd in test 2022-01-21 09:45:29 +01:00
Julian Bouzas
72b3be9e83 m-si-audio-endpoint: use an internal audio adapter session item
Avoids code duplication with si-audio-adapter.
2021-10-21 14:03:10 -04:00
Julian Bouzas
6624eaaf3e m-si-audio-adapter: remove unused audio utilities 2021-10-20 07:41:21 +00:00
Ashok Sidipotu
e2e3c5a69c wp-factory: enumerate pw_factory objects
pw_factory objects allow permissions to be set on its clients,
wp-factory exposes this funtionality to wireplumber clients.
2021-10-19 05:46:46 +00:00
George Kiagiadakis
c444ebaae1 meson: replace deprecated dep.get_pkgconfig_variable() with dep.get_variable() 2021-10-15 12:12:20 +03:00
George Kiagiadakis
03f14105cf si-audio-adapter: find the device format early and store format-specific flags
* find out if the node supports iec958 or dsd
* use spa_pod_fixate() to get the default format of the node, like p-m-s does
* use _enum_formats_sync() to utilize the param cache, assuming that the node
  always has all features enabled (which is always the case when coming from
  an ObjectManager that was defined in Lua)
* simplify the activation / deactivation procedure
* configure nodes with unpositioned channels early, as if they were devices
2021-10-12 20:00:10 +03:00
George Kiagiadakis
e76c67c45c policy: refactor/improve policy-node & session items to fix linking to monitors
* populate most session item properties from create-item.lua to keep
  things more compact and readable
* use a standard naming scheme for the session item properties
* use session item properties instead of node properties in policy-node.lua
* improve policy-node's performance by converting the properties dictionary
  less times for each session item
* refactor some policy logic and make things slighly more readable
* change the accepted values for 'context' in wp_si_linkable_get_ports();
  use "input" and "output" to keep things clear, because the previous use
  of NULL and "reverse" were implying that a node has only one "standard"
  direction, but this is complicated for sinks w/ monitors and duplex nodes
* allow using monitors (which are Audio/Sink nodes in fact) as sources
* treat Audio/Duplex nodes as sinks, like p-m-s does
* respect the "stream.capture.sink" property of streams

Fixes #66
2021-10-08 00:26:41 +03:00
Julian Bouzas
711d1ee686 spa-pod: add support for custom Id properties
Allows creating and parsing Pod Objects with custom properties.
2021-09-21 12:29:54 -04:00
George Kiagiadakis
8949e98d1f remove wpipc
This component has been split out to form a separate project,
moved to https://git.automotivelinux.org/src/pipewire-ic-ipc/
2021-08-19 16:53:28 +03:00
George Kiagiadakis
e6f2dc17ff tests: file-monitor: also remove the 'foo' file at the end of the test 2021-08-19 10:44:31 +03:00
George Kiagiadakis
daa4da5ffc tests: state: remove the "escaped" state file at the end of the test 2021-08-19 10:39:49 +03:00
George Kiagiadakis
07b4a13315 tests: use .local/state instead of .local/.state for the state dir 2021-08-19 10:39:14 +03:00
Julian Bouzas
907a67fcb1 modules: add new API module to monitor files 2021-08-10 11:50:51 +03:00
Julian Bouzas
8b95b4ae23 tests: skip test if specific spa lib is not installed
Avoids tests failing if pipewire was built without the spa lib
2021-07-19 09:40:19 -04:00
Julian Bouzas
eb8f9a1a83 tests: common: add API to check if spa lib is installed
Allows to skip tests if specific spa lib is not installed
2021-07-16 11:49:35 -04:00
Julian Bouzas
2792cecbcf properties: use a boxed WpPropertiesItem type when iterating
Needed for JavaScript bindings
2021-07-15 08:55:00 -04:00
Peter Hutterer
be1a077eaf state: store our WpState files in $XDG_STATE_HOME/wireplumber 2021-07-14 14:44:11 +10:00
George Kiagiadakis
6e6852b391 tests: create wpipc tests sockets also in /tmp with a random name
See #39, #16
2021-07-02 16:34:31 +03:00
George Kiagiadakis
655898e61f tests: run with PIPEWIRE_RUNTIME_DIR=/tmp
... and hope for the best, because sockets apparently can't
have more than 108 characters in their path

See #39, #16
2021-07-02 16:34:28 +03:00
Julian Bouzas
ee190411f4 state: escape invalid key file characters 2021-06-30 08:48:57 -04:00
Julian Bouzas
8505078a80 tests: endpoint: fix coverity 'side effect in assertion' error 2021-06-30 08:44:35 -04:00
George Kiagiadakis
d576fde2d7 tests: set PIPEWIRE_RUNTIME_DIR and stop using XDG_RUNTIME_DIR
Using XDG_RUNTIME_DIR is problematic in test-reserve-device
because GTestDBus also exports XDG_RUNTIME_DIR and then unsets it,
which makes pipewire end up using $HOME for its socket.
Using PIPEWIRE_RUNTIME_DIR is safer, as this variable is only used
by pipewire.

Also use the build directory as a runtime dir (it always exists and
nothing is going to interfere with it) and unset XDG_RUNTIME_DIR from
the CI scripts, since nothing else is using it.

Closes #39
2021-06-30 11:53:21 +03:00
Julian Bouzas
85820f7aef tests: examples: print error if buffer is not valid in wpipc-client
If we lose connection with the server while a request was pending, the request
callback is still triggered but with NULL buffer.
2021-06-28 11:38:38 -04:00
Julian Bouzas
9fd76570c4 tests: wpipc: check if new connection to new receiver is valid after losing connection 2021-06-28 11:38:37 -04:00
Julian Bouzas
ac4d5bd22a tests: wpipc: use GCond instead of while loop to wait for events
Fixes hanging issues when running test with valgrind.
2021-06-28 11:38:37 -04:00
Julian Bouzas
d0b26fd70f tests: wpipc: fix typo in sender-receiver unit test 2021-06-28 11:38:37 -04:00
Julian Bouzas
f7483ebd3d tests: transition: make sure transition is still valid after advancing
Advancing a transition might free it, so we ref before advancing it, and unref
after checking its completion.
2021-06-25 11:04:15 -04:00
Julian Bouzas
70197f498c tests: fix coverity scan side effect in assertion issues 2021-06-25 08:50:08 -04:00
Julian Bouzas
892b0dada6 lib: Use #define instead of 'static const' for constants
Fixes build errors when using GCC older than v8.1
2021-06-24 09:24:16 -04:00
George Kiagiadakis
c24db9f353 tests: add pipewire env variables when running tests, tidy up common_env
Related to pipewire!767
2021-06-18 19:34:25 +03:00
George Kiagiadakis
b222411356 tests/metadata: also fix failing metadata unit test
latest pipewire exports settings metadata too, so we need to filter
2021-06-18 15:30:55 +03:00
George Kiagiadakis
b6a5750595 Revert "tests: enable G_SLICE=debug-blocks in all tests"
This breaks the valgrind test setup, as this G_SLICE overrides
G_SLICE=always-malloc from valgrind_env

This reverts commit a0d0069f18.
2021-06-10 14:52:30 +03:00
George Kiagiadakis
606a9765d6 meson: add '--keep-debuginfo=yes' to the valgrind command line
ensures that we get debug symbols from modules printed correctly
2021-06-09 15:43:08 +03:00
George Kiagiadakis
7355215cf1 pipewire-object: change params-changed signal to take a string param name
To be consistent with the rest of the API where strings are used
to identify param types
2021-06-09 13:29:34 +03:00
George Kiagiadakis
a0d0069f18 tests: enable G_SLICE=debug-blocks in all tests
This can catch allocation mistakes in the g_slice allocator
2021-06-09 12:21:56 +03:00
George Kiagiadakis
82c054f1bd meson: use environment() objects to define env for tests
it's just a nicer syntax
2021-06-09 12:03:14 +03:00
George Kiagiadakis
b39514a455 meson: add a test setup to run tests under valgrind 2021-06-09 11:55:07 +03:00
Julian Bouzas
0f01c8b6da tests: si-standard-link: remove unneeded core syncs 2021-06-08 13:23:44 -04:00
Julian Bouzas
85a7f01cb6 tests: common: make sure no events are pending before destroying core 2021-06-08 13:23:39 -04:00
George Kiagiadakis
1ca67abc66 object-manager: support declaring interest on all properties of globals
Until now, object manager could only match pw global properties on
pw global objects, because this is the only available properties set
at the time the registry creates the global.

With this change, the object manager will now bind the proxy
if the type and the pw global properties have matched and will wait
until the proxy is available with all of its properties and tries
the check again.
2021-06-07 17:47:42 +03:00
George Kiagiadakis
997bdb65cd object-interest: enrich _matches_full() to be able to check all constraints 2021-06-07 17:47:42 +03:00
George Kiagiadakis
f91653dbfe tests: store temporary WpState files in the build directory
or else the .config sub-directory stays in the source directory
and clutters it
2021-06-04 18:36:19 +03:00
George Kiagiadakis
38f7483793 state: remove support for groups and propagate save errors
There is no real use for groups in our API. Just use the name of
the file as the default group and be done with it...
Storing multiple groups with this API is problematic because it
forces flushing the file to disk multiple times, one for each group,
and it's just more performant if we use a prefix in the keys
to implement some form of logical separation.

This commit also makes the GKeyFile a temporary object. As we
always load the file from the file system in _load()
and we always replace its contents with a new dictionary in _save(),
there is no point in keeping the keyfile's internal data structures
stored in memory.

Save errors are now also propagated to adhere to the programming
practices of GObject
2021-06-04 18:36:19 +03:00
George Kiagiadakis
ae99e50182 tests: si-audio-adapter: test is.device property 2021-05-27 17:01:55 +03:00
George Kiagiadakis
b5ad7b3996 tests: si-standard-link: fix racy test
- use si-audio-adapter, to keep the original test's spirit
  of linking two terminal nodes, not two intermediate ones
- setup null sink to be a virtual device sink with 2 channels
  and the audiotestsrc to be a stream, so that it is also configured
  to have 2 channels via si-standard-link's logic
- don't use a second client core, as it introduces races;
  we don't need that anymore because we don't export endpoint-links
2021-05-27 16:55:26 +03:00
Julian Bouzas
265abd444b tests: enable si-standard-link test and port it to new API 2021-05-24 11:07:56 -04:00