Commit graph

863 commits

Author SHA1 Message Date
Wim Taymans
fb76f484a9 remote-node: also send spa_flags 2020-08-10 16:45:44 +02:00
Wim Taymans
5fda46fdb9 remote-node: activate node after init
Activate the node after we successfully created a proxy and
initialized it.
2020-08-07 11:52:35 +02:00
Wim Taymans
e5f85d6a4c remote-node: clean node on error 2020-08-07 11:52:14 +02:00
Wim Taymans
f4e8ebab51 improve debug and error messages 2020-08-07 10:47:18 +02:00
Wim Taymans
8b2617227a client-node: improve debug 2020-08-06 17:59:58 +02:00
Wim Taymans
8a9bb9dabb Use fcnt F_DUPFD_CLOEXEC to dup an fd
Closes #38
2020-08-06 11:08:20 +02:00
Wim Taymans
469dff0153 use global_update_keys
First set the properties in the object itself and then copy them
over to the global. This ensure that the global properties are
also in the object and makes code a bit cleaner.

It also make it possible to use the global id to make the property
values unique, if we want to later .
2020-08-05 12:55:33 +02:00
Wim Taymans
d57da19f26 client-device: first set implementation, then register
Setting the implementation updates the properties so that we
have more info when creating the global.
2020-08-03 18:11:12 +02:00
Wim Taymans
6f2e274b15 protocol: add a few more options for XDG_RUNTIME_DIR
PIPEWIRE_CORE can be used to specify a server name.
PIPEWIRE_REMOTE can be used to specify what server name to
connect to.

Either use the absolute path of the name to create and connect
to a server, or use a relative path. For a relative path, the
server name will be completed by prefixing the following paths
in order:

PIPEWIRE_RUNTIME_DIR environment variable,
XDG_RUNTIME_DIR environment variable,
HOME environment variable,
USERPROFILE environment variable,
home directory as stored in the password database.

Fixes #259
2020-07-31 12:46:58 +02:00
Wim Taymans
91d4806611 permission: add some helpers
Add PW_PERM_ALL as a shortcut for all permissions
Add PW_PERMISSION_FORMAT and PW_PERMISSION_ARGS to nicely format
permissions.
2020-07-30 16:26:29 +02:00
Wim Taymans
8db9a2741b metadata: only allow setting metadata on objects we can see
Allow a client to only set metadata on objects that it has
read access to.
2020-07-30 15:30:13 +02:00
Wim Taymans
a5ec68e61c metadata: only set default name when not already set 2020-07-30 14:28:11 +02:00
Wim Taymans
ba8522aac9 metadata: we need W permission to set and clear properties 2020-07-30 14:27:35 +02:00
Wim Taymans
e32a7a8d65 make some errors into debug
With the debug and return value we can delay writing error messages
in the log until we really need to.
2020-07-29 11:30:11 +02:00
Wim Taymans
6530c694c9 protocol: debug server we connect to 2020-07-23 20:12:25 +02:00
Wim Taymans
141238d88b core: always use explicitly configured properties first
First use the configured properties, then use the env variables.
Make the daemon use the env variable by default.

This makes it possible to start servers with PIPEWIRE_CORE env variable
names but still override with the command option.

Makes it possible to make apps connect to PIPEWIRE_REMOTE env by
default and allows you to override with the command option.
2020-07-23 13:40:02 +02:00
Wim Taymans
553337df60 remote-node: handle remove port 2020-07-22 16:20:43 +02:00
Wim Taymans
2bb1d88fbe keys: let env variables overwrite the keys 2020-07-22 11:25:19 +02:00
Wim Taymans
07cc07597c access: always put access in property
Improve debug
2020-07-17 16:47:14 +02:00
Wim Taymans
5731447357 add portal module again
This access module now only checks if the connection is comming
from the portal and tags the ACCESS property with portal in that
case. It will no longer do permission store checks, that's for
the session manager.
2020-07-17 14:12:10 +02:00
Wim Taymans
89b189d190 access: don't check access if already set
If we already have an access property, leave the client as is.
2020-07-17 13:23:50 +02:00
Wim Taymans
f2c1ab6069 access: make access property configurable
Just set the value of access.force into pipewire.access so that
the session manager can deal with it.
2020-07-17 09:59:49 +02:00
Wim Taymans
33d7b6ea43 Remove old portal module from build 2020-07-16 17:56:21 +02:00
Wim Taymans
a295901329 Move portal module to session manager 2020-07-16 17:54:18 +02:00
Wim Taymans
7d56b78bce remove some unused fields 2020-07-16 17:47:30 +02:00
Wim Taymans
5afdd507c3 access: document and improve arguments
Add option to force flatpak security
When a check is inconclusive, go to the next check instead.
2020-07-16 11:45:44 +02:00
Wim Taymans
031a8ea799 client-node: also unref the activation memblock 2020-07-10 16:11:16 +02:00
Wim Taymans
e58fcb95d0 client-node: remove the tag from the right pool 2020-07-10 16:10:45 +02:00
Wim Taymans
5cd495c93c client-node: free old mapping only after importing the new
Keep the old mapping around until we manage to successfully import
the new mapping.
2020-07-10 12:57:55 +02:00
Wim Taymans
0430e7b8dc client-node: clean up our memory mappings
Loop over our memory mappings and clean them up when we are destroyed.
2020-07-10 12:46:48 +02:00
Julian Bouzas
f75dfde89c remote-node: process the mixer if io status have HAVE_DATA flag
Needed for audio sources created locally
2020-07-06 12:08:27 -04:00
Wim Taymans
4db6e0e2b3 client-device: fix event marshall 2020-07-06 17:13:50 +02:00
Wim Taymans
1e2ad41d94 remote-node: fix user_data
Pass the node_data around instead of the proxy. Get the proxy from
the node data.
Allocate user_data before the node_data so that the caller can
use the proxy user_data without overwriting the node_data.
2020-07-03 15:19:40 +02:00
Wim Taymans
591244c53e module-device: remove useless assign 2020-07-02 10:58:35 +02:00
Wim Taymans
3df8139f4e spa-node: unload handle in failure case 2020-07-02 10:57:10 +02:00
Wim Taymans
d871adbd4d spa-device: fix leak of properties in error case 2020-07-02 10:52:15 +02:00
Wim Taymans
dfd3bd84b4 buffers: increase max datas and metadata in buffers 2020-07-01 11:43:18 +02:00
Wim Taymans
29282b8d50 module-device: remove impossible case 2020-06-23 15:26:04 +02:00
Wim Taymans
4c8f8671d7 client-node: improve error reporting 2020-06-18 15:40:53 +02:00
Wim Taymans
2a11e66417 client-node: clear array fields 2020-06-16 21:22:06 +02:00
Simon McVittie
b852b58f82 Optionally install examples and tests
This makes it easier to test PipeWire in its "as-installed" state,
for example in an OS distribution.

The .test metadata files in ${datadir}/installed-tests/${package} are
a convention taken from GNOME's installed-tests initiative, allowing a
generic test-runner like gnome-desktop-testing to discover and run tests
in an automatic way.

The installation path ${libexecdir}/installed-tests/${package} is also
a convention borrowed from GNOME's installed-tests initiative.

In addition to the automated tests, I've installed example executables
in the same place, for manual testing. They could be separated into
a different directory if desired, but they seem like they have more
similarities with the automated tests than differences: both are there
to test that PipeWire works correctly, and neither should be relied on
for production use. Some examples are installed in deeper subdirectories
to avoid name clashes.

Signed-off-by: Simon McVittie <smcv@debian.org>
2020-06-16 17:58:02 +00:00
Wim Taymans
3859b14adf client-node: dynamically allocate the mix structs 2020-06-16 18:21:58 +02:00
Wim Taymans
eac046a86b client-node: place invalid mix at begin instead of end
..so that we can resize the array later.
2020-06-16 17:52:39 +02:00
Wim Taymans
fb1ea646f5 client-node: remove unused field, add some debug 2020-06-16 17:41:54 +02:00
Wim Taymans
61c1fe546e client-node: fix buffer size calculation
Calculate the size of the buffer as the difference between the first
byte and the last byte. This takes into account the alignment.
2020-06-15 20:44:08 +02:00
Wim Taymans
014e48c1f1 protocol: add workaround for bad v0 clients
Fix up clients that say they have fixed properties while in fact
they are not. Assume that when there are alternatives, the property
was in fact not fixed.
2020-06-09 13:22:07 +02:00
Wim Taymans
62dd58a604 client: remove busy state from client in resource destroy
When a resource is doing an operation that sets the client in the busy
state, make sure we unblock the client again when the resource is
destroyed before we could complete the operation or else the client
is stuck forever.
2020-06-09 10:59:58 +02:00
Wim Taymans
180f2b0f20 client-node0: clean up resource 2020-06-08 17:14:36 +02:00
Wim Taymans
d566c8858c port: don't send reuse_buffer on node again
When we get a reuse_buffer on the input mixer we should find the
linked mixer and send the reuse_buffer to that one, not the node
itself.
2020-06-08 14:19:13 +02:00
Wim Taymans
dac60d4e5b avoid some leaks and NULL pointer derefs 2020-06-08 11:15:53 +02:00