Commit graph

4634 commits

Author SHA1 Message Date
Tom Briden
6cea8b201b meson: Allow session-managers option to be an absolute path
If it's not an absolute_path, then set the build_ms and build_wp
as normal, otherwise use the value as passed in.
2021-10-27 08:27:53 +00:00
Simon McVittie
e167123667 Reinstate compatibility with older Linux with no getrandom()
Commit 42d8b2b1 "Remove legacy FreeBSD compatibility code" removed
compatibility with old versions of FreeBSD, but also removed
compatibility with old versions of Linux and glibc, which was requested
in #833.

This partially reverts commit 42d8b2b167.

Resolves: #833
Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-10-26 19:32:02 +01:00
Wim Taymans
a2f06be199 pulse-server: Improve combine sink properties
Make streams and sink have the same description so that they show
up as the same node in catia.
2021-10-26 10:50:28 +02:00
Wim Taymans
33653cbabf protocol-pulse: flush streams on pause
To remove any lingering data
2021-10-26 10:49:50 +02:00
Wim Taymans
ba18768246 impl-link: both ports need to be negotiated before we can allocate
Fix allocation check. Both ports need to be at least negotiated before
we can attempt to allocate buffers.
2021-10-26 10:13:21 +02:00
Peter Hutterer
9acee530e2 meson: switch to "foo in array" style for meson arrays
In Meson, string.contains() is a substring check but array.contains() is
a full string check. Let's use 'foo in bar' style instead to avoid
confusion.

Supported since meson 0.49.0
2021-10-26 06:22:20 +00:00
Wim Taymans
c4d5c01429 impl-link: check port state before allocating
At least one port needs to be ready to do allocation.
2021-10-25 18:13:47 +02:00
Wim Taymans
f9a45a8b84 impl-link: improve debug 2021-10-25 18:12:24 +02:00
Wim Taymans
f7eafe1404 stream: use user param field to track param changes
count the number of changes and then when there are any, flip the
SERIAL bit in the param info so that the server can detect a
change. Without this, 2 updated params would not flip the bit and the
param changes would not be noticed.
2021-10-25 18:08:58 +02:00
Wim Taymans
5dfc3494dc map: use uintptr_t for the next pointer
This aligns the low bits of the next field with the low bits of the
pointer on big endian cpus.

Fixes #1747
2021-10-25 16:17:35 +02:00
Wim Taymans
c07f0ccb71 map: make _insert_at() fail on a removed item
You are only supposed to use _insert_new()/_remove() or _insert_at()
on the map, If we detect a _insert_at() to a removed item,
return an error because else we might corrupt the free list.

Update unit test accordingly.
2021-10-25 16:17:35 +02:00
Peter Hutterer
d5825b8551 meson: use meson variables for the SMs' uninstalled scripts
Both wireplumber and media-session have a meson variable now that
represents the -uninstalled script, complete with filled-in BUILDDIR
etc.

Let's use those variables for pipewire-uninstalled.conf so we don't have
to fill in the paths here.
2021-10-25 07:45:56 +00:00
Philippe Normand
397a67889a examples: Add explicit break statement in video-play-reneg 2021-10-25 07:26:15 +00:00
Guilherme Henrique
8641977816 meson: Set session manager variable based on renamed project 2021-10-24 19:53:02 +02:00
Gleb Popov
65aea7c05a Avoid compiler warning by #ifdef'ing a function used only on Linux. 2021-10-22 19:08:24 +03:00
Gleb Popov
a76ccfe64b Set PW_KEY_SEC_LABEL property on FreeBSD and avoid compiler warning. 2021-10-22 19:07:45 +03:00
Gleb Popov
43ef614537 Remove unused function. 2021-10-22 19:05:43 +03:00
Gleb Popov
e26b40a75f Fix compiler warning by spelling the initializer properly. 2021-10-22 19:04:47 +03:00
Wim Taymans
e1f21ebd0b stream: add spa command include 2021-10-20 11:51:50 +02:00
Wim Taymans
45d9c2c9df pw-cat: use default metadata for default source/sink 2021-10-20 11:40:33 +02:00
Peter Hutterer
6edbbf6a23 examples: fix NAME for bluez-session 2021-10-20 08:55:27 +00:00
KangJing Huang (Chaserhkj)
22aad6eaff Tuning some webrtc parameters 2021-10-19 18:59:07 +00:00
KangJing Huang (Chaserhkj)
2bfc03f43c Allow echo-cancel to select larger buffer sizes 2021-10-19 18:59:07 +00:00
Wim Taymans
002566ae83 test: fix stream ABI test 2021-10-19 17:16:25 +02:00
Wim Taymans
34609389e3 filter: add event to notify command
All commands send to the filter are emited in the command event.
2021-10-19 15:27:14 +02:00
Wim Taymans
dfa3f631ec stream: add event to notify commands 2021-10-19 15:23:20 +02:00
Wim Taymans
100c12460f client-node: handle events, send them to the server part 2021-10-19 12:28:23 +02:00
Wim Taymans
b4dc04c777 stream: use sizeof instead of hardcoded value 2021-10-19 12:26:02 +02:00
Wim Taymans
b6059fd007 stream: add some debug for commands 2021-10-19 12:25:46 +02:00
Wim Taymans
32c7121e54 impl-node: add method to send a command to a node 2021-10-19 12:24:47 +02:00
Barnabás Pőcze
4c27c3fd43 pulse-server: use for-each loop
Use `SPA_FOR_EACH_ELEMENT` to enumate the elements
in the array instead of an "indexed" loop.
2021-10-18 15:36:22 +02:00
Barnabás Pőcze
3fefb55ef2 pulse-server: return NULL instead of 0
... to be consistent with the vast majority of the
existing source code.
2021-10-18 15:36:22 +02:00
Barnabás Pőcze
ee7b82ac9e pulse-server: remove unnecessary NULL check
`spa_streq()` already checks for NULL pointers, so the
pointer does not need to be checked before calling it.
2021-10-18 15:36:22 +02:00
Barnabás Pőcze
80ae688cc6 pulse-server: compile extensions separately
Avoid including other C source files. Compile them separately.
2021-10-18 15:36:17 +02:00
Peter Hutterer
b78371f702 tools: update pw-reserve so don't need to include the c file 2021-10-18 20:44:11 +10:00
Peter Hutterer
1bced6b2ef Remove media-session from this tree
It is now available as a separate project in
https://gitlab.freedesktop.org/pipewire/media-session

The code required by pw-reservice has moved to src/tools/reserve.{c|h}
2021-10-18 20:44:07 +10:00
Wim Taymans
bd8ec29bb5 link-factory: avoid using 0 for invalid id
Use SPA_ID_INVALID instead of 0 when we fail to parse the port id
so that we don't accidentally match an internal port id.

See #1724
2021-10-18 11:35:25 +02:00
Peter Hutterer
dfb63d55dd media-session: use the SESSION_PREFIX for any fallback config dir
Regression introduced in 3560f3ba2d

MEDIA_SESSION_CONFIG_PATH expects the actual directory while
PIPEWIRE_CONFIG_PATH and the built-in fallback both expect the files to
reside within the SESSION_PREFIX subdirectory.

Fixes #1725
2021-10-18 07:23:00 +00:00
Peter Hutterer
56f01a293c media-session: fix config load path
config_dir is the new MEDIA_SESSION_CONFIG_DIR environment variable (if
set), impl.config_dir is that or the fallback, whichever applies.

Fixes 00bd3b5b59
Fixes #1725
2021-10-18 07:23:00 +00:00
Wim Taymans
e1deecc3cd impl-link: also update node id in properties
The link might have been made using the node name/nick/description but
we always want to place the id in the properties to make it easier for
apps to handle the relations between objects.

See #1723
2021-10-15 17:58:05 +02:00
Peter Hutterer
00bd3b5b59 media-session: store the config dir path in our object
The media session modules need to load config files through
sm_media_session_load_conf() and that must be the same config dir as our
main configuration file's directory.
2021-10-15 10:53:32 +10:00
Michael Olbrich
d2ce51d504 stream: decrement busy counter when releasing dequeued buffers
For buffers on the 'dequeued' list, the busy counter was already
incremented in impl_node_process_input(). So it must be decremented again
when these buffers are removed.
2021-10-14 19:16:56 +00:00
Michael Olbrich
314ff82ff0 pipewiresrc: fix handling outstanding buffers when stopping
The current code has several issues if a pipewiresrc is stopped and deleted
while a buffer is still in use downstream.

 - pw_stream_queue_buffer() is never called for the corresponding
   pw_buffer. As a result, the busy counter is never decremented and
   pw_stream_dequeue_buffer() of the corresponding pipewire output will
   return NULL whenever it encounters this buffer.

 - The pipewiresrc does not own the buffer reference unless the buffer is
   queued in the source, so calling gst_buffer_unref() unconditionally
   causes refcount issues for the buffer.

 - buffer_recycle() can race with on_remove_buffer() and
   gst_pipewire_src_close(). As a result, buffer_recycle() may access pwsrc
   when it was already deleted.

The buffer has its own reference to the pool. So the pool object lock can
be used to ensure that the pwsrc, core and stream remain valid in.
buffer_recycle(). If the 'dispose' function pointer was already cleared,
then on_remove_buffer() has already finished, so abort early.

With the pool lock held, it is save to access the pipewire loop. Now the
loop lock can be used to synchronize with on_remove_buffer(). 'dispose'
must be checked again in case on_remove_buffer() was triggered by something
other than gst_pipewire_src_close().

In on_remove_buffer() unref the buffer if it is queued. Otherwise call
pw_stream_queue_buffer() to ensure that the busy counter is decremented
correctly.
2021-10-14 19:16:56 +00:00
Michael Olbrich
744a8aaeb7 gst: init last_error
Otherwise, it may be used uninitalized.
2021-10-14 19:16:56 +00:00
Wim Taymans
1f5396fedb stream: don't change to the error state on proxy errors
The proxy errors are really from the session manager informing us about
decisions it made (failure to link, etc). The state of the stream is not
really affected by this so just emit the error signal and let the app
decide what to do.
2021-10-14 16:00:40 +02:00
Wim Taymans
8c346ab3a7 pulse-server: list NETWORK flag on devices
Mark network sinks and sources with node.network.
2021-10-14 13:45:58 +02:00
Wim Taymans
d6c1479ba0 module-zeroconf-discover: also parse the channel_map
So that we create the device with the same channel_map as the remote
end.

Fixes #1692
2021-10-14 13:28:43 +02:00
Wim Taymans
257bbb1fd5 echo-cancel: flush streams in PAUSED
so that we don't end up with old data when we resume.

Fixes #1660
2021-10-14 12:18:37 +02:00
Wim Taymans
30f8219afd stream: improve some debug 2021-10-14 10:02:13 +02:00
Peter Hutterer
40eb9578d5 media-session: make a few debug messages easier to understand
Especially with PIPEWIRE_LOG_LINE=false, those messages are too
confusing otherwise.
2021-10-14 07:51:27 +00:00