Commit graph

985 commits

Author SHA1 Message Date
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
Wim Taymans
2fd64f1591 connection: dup and close fds
dup the fd when added to the outgoing buffer and close it againç
when sent. This ensures the fd remains valid in the buffer. A
quick add/remove of memory before a buffer flush could close the
fd before we can send it and then we get a bad fd and disconnect
the client.
2020-06-05 17:36:03 +02:00
Wim Taymans
2462cac4f2 add some more debug 2020-06-05 16:44:35 +02:00
Wim Taymans
51ae60b0c4 portal: fix small leak 2020-06-05 15:49:39 +02:00
Wim Taymans
0efadbb297 client-node: free old mem after setting new mem 2020-06-05 13:04:43 +02:00
Wim Taymans
972a790cf2 client-node: send error when node_set_io fails 2020-06-05 13:03:16 +02:00
Wim Taymans
969377b079 client-node: simplify cleanup
Remove the extra proxy to the node, it's awkward and not needed.
pw_core_export() returns a handle to the remote object with the
interface of the factory.

If the node is destroyed, make sure the proxy doesn't access
it anymore.

If the handle is removed or destroyed, make sure we remove the
proxy related info around the node. Never destroy the proxy
ourselves, this is something the app needs to do when it is
ready.
2020-06-05 12:43:26 +02:00
Wim Taymans
8292c556e9 client-node: first set param, then clear buffers
Because setting the param might still access the buffer to do
cleanup.
2020-06-04 10:15:37 +02:00
Wim Taymans
6d0fd7b58c remote-node: run _destroy in the _removed handler 2020-06-03 15:42:45 +02:00
Wim Taymans
4405fe4c14 remote-node: handle deleted client-node 2020-06-03 15:28:28 +02:00
Wim Taymans
b4b7ba4cbb remote-node: suspend node before cleanup
When the proxy is destroyed, suspend the node before we start
removing the memory or else the node might still be using it from
the data thread and crash.
2020-06-03 12:04:01 +02:00
George Kiagiadakis
17d7cdc80e spa-node-factory: cleanup node when binding the client resource fails 2020-06-02 15:47:06 +00:00
George Kiagiadakis
16c1a7fe33 spa-device-factory: destroy device when the creator resource is destroyed 2020-06-02 15:47:06 +00:00
Wim Taymans
09913ca4ab metadata: free when the global is destroyed 2020-06-02 17:16:09 +02:00
Wim Taymans
4060934109 client-node: keep track of the client allocated fd
when we get port_buffers with memory from the client, store this
in the buffer data and make sure we close the fd when the buffers
are removed.
2020-06-02 15:19:39 +02:00
Wim Taymans
c04a9b546d client-node: refuse the wrong amount of client buffers
Make sure we get the same amount of buffers from the client as
we asked to allocate.
2020-06-02 15:18:18 +02:00
Wim Taymans
bb1cb530fc add more debug of fd create and close 2020-06-02 14:06:51 +02:00
George Kiagiadakis
6ecbe00774 session-manager: emit cached info with CHANGE_MASK_ALL on new resources 2020-06-01 16:25:40 +00:00
Wim Taymans
6a689b3c7f client-node: don't ref destroyed resource
Ownership of the node_resource is taken by _new() and freed.
Don't try to use it afterwards to send an error when something
goes wrong but use the original resource.
2020-05-20 15:24:25 +02:00
Wim Taymans
963b00b77b adapter: return an error when we can't find a format 2020-05-20 15:24:25 +02:00
Wim Taymans
c2028a1695 Fix some leaks in error cases 2020-05-20 15:24:25 +02:00
Wim Taymans
8669fd03a6 initialize variables better 2020-05-20 15:24:25 +02:00
Wim Taymans
ce98162ed2 Make sure we don't read too much 2020-05-20 15:24:25 +02:00
Wim Taymans
eb93f259e0 avoid some useless assignments 2020-05-20 15:24:25 +02:00
Wim Taymans
459acda619 client-node: use spa_system functions 2020-05-20 15:24:25 +02:00
Wim Taymans
a19bab4b16 avoid following NULL pointers 2020-05-20 15:24:25 +02:00
Wim Taymans
a898f21c87 improve debug
When we fail to read the eventfd, don't try to use the value.
2020-05-20 15:24:25 +02:00
Wim Taymans
9e6a047788 portal: add portal module again
Add this again for now until we can integrate this into the
session manager somehow.
2020-05-18 16:30:09 +02:00
Wim Taymans
fdb3985f1a client-node: handle NULL port
Don't try to remove an already removed port.
2020-05-12 10:12:28 +02:00