Commit graph

39 commits

Author SHA1 Message Date
Wim Taymans
11f1298f53 spa: make a function to make a channel short name
Make a function that can generate and parse a short name for
the positions that are not in the type list, like the AUX channels.
2025-10-22 13:04:53 +02:00
Wim Taymans
818d1435ce treewide: access the position information using helpers
Make sure we don't access out of bounds and that we use the helpers
wherever we can to access the position information.
2025-10-21 13:06:25 +02:00
Wim Taymans
fdc74df383 modules: use timer-queue in avahi-poll
Pass the pw_context to get to the shared queue and loop.
Patch up the users of avahi-poll.

Fixes #4913
2025-09-26 13:39:49 +02:00
Sam James
2cec77e7df *: unify config.h handling
config.h needs to be consistently included before any standard headers
if we ever want to set feature test macros (like _GNU_SOURCE or whatever)
inside. It can lead to hard-to-debug issues without that.

It can also be problematic just for our own HAVE_* that it may define
if it's not consistently made available before our own headers. Just
always include it first, before everything.

We already did this in many files, just not consistently.
2025-05-30 10:24:13 +00:00
Pauli Virtanen
ec5684302c doc: in user-facing config examples, indicate which file it goes into
Add suggestions for config fragments in config file examples, as
applicable.
2024-09-16 15:51:59 +00:00
Wim Taymans
d2ca50399a modules: add options to discover local services as well
This makes it possible to discover a local RAOP, pulse or RTP services
and connect to them.

IPv6 addresses need the interface appended to local addresses to
make the connection work.
2024-05-15 15:39:27 +02:00
Pauli Virtanen
fdcb02ed75 modules: add Module Name section to the module reference docs 2023-11-20 08:41:13 +00:00
Pauli Virtanen
eca773fc12 modules: strip "PipeWire Module:" from Doxygen page name
Make them appear nicer in the output.
2023-11-19 16:39:15 +00:00
Wim Taymans
8d62bb1e97 module-zeroconf: fix compilation 2023-06-13 08:52:32 +02:00
Christian Glombek
d18db904b9 module-zeroconf: Fix deduplication
Ports recent fixes and improvements regarding the deduplication of sink
creation from module-raop to module-zeroconf.

- 0bb0b524c7
- 14fd7f7bf7
2023-06-13 03:09:54 +02:00
Wim Taymans
07e6f44e58 modules: clean up USAGE arguments
use () to mark optional arguments to avoid confusion with arrays.
Add some more optional arguments.
2023-03-22 16:35:55 +01:00
Barnabás Pőcze
934ab3036e treewide: use SPDX tags to specify copyright information
SPDX tags make the licensing information easy to understand and clear,
and they are machine parseable.

See https://spdx.dev for more information.
2023-02-16 10:54:48 +00:00
Wim Taymans
164e343dbf remove pipewire/private.h includes when possible
In many places this is not needed.
Expose pw_impl_node_set_param() for adapter.
2023-01-20 16:08:38 +01:00
Wim Taymans
2254c74fb9 use TARGET_OBJECT instead of the deprecated NODE_TARGET
Clarify the docs.
2023-01-10 16:51:47 +01:00
Wim Taymans
aed56719f2 modules: add pulse.latency to module-zeroconf-discover
To set latency to remote streams.
Also add latency_msec argument to the pulseaudio module for this.

See #2755
2022-10-12 12:18:47 +02:00
Demi Marie Obenour
671a7102ff Fix some badly-behaved macros
Some macros evaluated their arguments more than once when it was not
needed, or were missing parentheses.
2022-09-23 11:39:33 -04:00
Wim Taymans
a84412ccb7 modules: improve parsing of rate and channels 2022-06-04 18:54:50 +02:00
Wim Taymans
87172fde06 modules: align tunnel.mode
Source for a source, sink for a sink. We use capture and playback for
streams that link to a source/sink respectively.
2022-06-03 10:52:45 +02:00
Wim Taymans
8807aa1dcd module: add docs 2022-04-22 16:51:27 +02:00
Wim Taymans
99f9f729ff handle open_memstream errors
Fixes #2182
2022-03-02 11:48:31 +01:00
Barnabás Pőcze
45bd8532eb pipewire: use newly added function for deferred module destroy
Use the newly introduced `pw_impl_module_schedule_destroy()`
for deferred module destroy in all modules except
module-example-{sink,source}.
2022-02-18 12:30:53 +01:00
Barnabás Pőcze
4d4c6f20df pipewire: remove work queue checks
Since now `pw_context_get_work_queue()` cannot
fail, the checks can be removed.
2022-02-18 12:30:53 +01:00
Wim Taymans
3de9d3df3b pulse-server: use safer spa_scnprintf
This clamps to the max size of the input buffer so that we don't write
the next item past the allocated space.
2021-12-22 21:34:29 +01:00
Wim Taymans
73bf30efa6 module-zeroconf: translate audio format
The audio format in the avahi messages is in pulseaudio format so
translate it to PipeWire format in audio.format.

See #1745
2021-11-03 12:54:58 +01: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
Barnabás Pőcze
d2f0573369 pipewire: module-zeroconf-discover: handle module destroy events
module-zeroconf-discover loads module-pulse-tunnel for each entity
exposed on the network. Previously, however, the destroy event
of the loaded pulse-tunnel modules were not handled.

This resulted in a use-after-free because both `pw_context_destroy()`
and `module-zeroconf-discover.c:impl_free()` tried to destroy
the pulse-tunnel modules. The reason for that is that since
1de16afc40 the modules
are prepended to the module list of the context, not appended,
therefore modules are destroyed in LIFO order, thus the pulse-tunnel
modules were destroyed before the zeroconf-discover module that
loaded them.

Fix that by handling the destroy event of the loaded pulse-tunnel
modules.

Fixes #1653
2021-09-29 10:35:16 +02:00
Peter Hutterer
14112fd168 modules: use the new topic-based logging from various pipewire modules 2021-09-28 09:35:39 +02:00
Wim Taymans
9229467f20 module-zeroconf: only free impl when not NULL 2021-08-05 15:49:38 +02:00
Konstantin Kharlamov
8c013b8183 modules: remove useless comparison in pw_properties_from_avahi_string
It doesn't do anything, let's just get rid of it.
2021-07-05 23:57:35 +03:00
Konstantin Kharlamov
6f39e13f11 module-zeroconf-discover: factor out pw_properties_from_avahi_string
This allows to get rid of the empty if block in comparison to
channel_map, and makes it clear that the comparison is useless. So in
the next commit we will remove it.

Fixes an LGTM warning:

    Empty block without comment
2021-07-05 23:53:46 +03:00
Peter Hutterer
f181232a61 doc: add the documentation infrastructure for pipewire modules
All empty pages for now but at least this makes them show up in the
documentation.
2021-06-25 08:42:24 +00:00
Wim Taymans
1f04e911c5 module: handle work queue create errors
Handle NULL when creating a work queue instead of crashing. The
create can fail when we run out of fds.
2021-06-18 16:29:23 +02:00
Peter Hutterer
e0471c6757 pipewire: allow NULL pointers in pw_properties_free()
Just like the real free() we should just ignore a NULL pointer, makes the
caller code easier for those instances where properties are optional.

Patch generated with concinelle with a few manual fixes.
2021-06-02 10:56:46 +00:00
Peter Hutterer
71c6a175c4 Drop double semicolons 2021-05-20 07:24:22 +00:00
Peter Hutterer
7697ed0757 treewide: replace strcmp() == 0 with spa_streq()
This change is only done in source files for now, header files will be done
separately.
2021-05-18 22:10:27 +10:00
Wim Taymans
170294d7ac pipewire-pulse: add zeroconf module 2021-05-14 11:39:44 +02:00
Wim Taymans
5c152bab23 zeroconf: improve stream properties 2021-05-14 11:19:02 +02:00
Wim Taymans
0ff1d1e4cb zeroconf-discover: use pw_properties_serialize_dict 2021-05-14 09:09:48 +02:00
Wim Taymans
6744934734 zeroconf: add avahi zerconf discover module
Discovers remote sinks and sources and load the tunnel module to
make a local sink and source for them.
2021-05-14 09:09:48 +02:00