Commit graph

28 commits

Author SHA1 Message Date
Barnabás Pőcze
4e69507b18 pulse-server: pass FILE to message handlers
Use `open_memstream()` to create a FILE stream and pass
that to message handlers to store their response. This allows
the `open_memstream()` calls and related error handling to be
removed from the message handlers.
2023-10-06 16:16:18 +02:00
Wim Taymans
c9b7367f8f pulse-server: keep track of sink/monitor changes
For sink nodes, keep a separate device_info around for the sink and
the monitor source part of the node. Only emit changes for the sink
and monitor source part when it changed.

See #3388
2023-07-31 11:23:47 +02:00
Wim Taymans
3f77c4e25f pulse-server: move the changed counter internally
We don't actually use this counter anywhere.

Change the counter to a mask that will contain object specific changes
to the params. This should make it possible to track what kind of
changes where done to the object and make it easier to emit the right
events later.
2023-07-28 13:31:02 +02:00
Wim Taymans
39a1887a0b pulse-server: improve network and virtual node checks
Tag the sink/source as HARDWARE when it's not virtual, the presence
of a DEVICE_API property is not a good check.

Make a method to check if a node is a NETWORK sink/source to make it
use the same logic everywhere.
2023-07-26 11:51:48 +02: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
e6fd5888ee param: add a new user seq field in the param-info
Add a new seq field in the param-info struct. Users can use this
field to keep track of pending param updates.

Store the latest seq number of the param update in the seq field. Remove
all params that don't match the sequence number because they are too
old. This avoids duplicate old params in pw-dump output.

Rework the pulseaudio manager with this same method.
2022-10-27 20:10:33 +02:00
Pauli Virtanen
83be5d866f pulse-server: implement temporary data attached to manager objects
Add functions for setting timer-based lifetimes for object data.

Having the timers in the object data themselves simplifies life cycle
management, as client/manager disconnects are handled without further
work.
2022-05-15 17:14:52 +00:00
Wim Taymans
1d03923a97 pulse-server: use object serial as index
Use the lower 32 bits of the object serial as the index. When there is
an overflow, use an invalid index, which will probably result in a
protocol error.
2022-01-17 12:48:31 +01:00
Wim Taymans
0904a35ba8 pulse-server: make separate index
Separate the id (the pipewire object id) from the index (what we send to
the client to identify the objects).
2022-01-17 12:01:13 +01:00
Wim Taymans
3b85369ff6 pulse-server: use key instead of id for the data key 2022-01-17 10:03:02 +01:00
Barnabás Pőcze
987c7fc1e4 pulse-server: manager: add mechanism to query object data
Add `pw_manager_object_get_data()` which can fetch linked
data by its id. And use it in the zeroconf-publish module.
2021-12-28 21:23:21 +01:00
Nicolai Syvertsen
7b773433f4 pipewire-pulse: add manager disconnect event
Drop client connections when pipewire goes away. pipewire-pulse daemon can remain running and pulseaudio clients will be able to connect again once pipewire is up and running.
2021-11-10 19:26:03 +00:00
Wim Taymans
7031471807 pulse-server: add property to make virtual nodes
Make a property to mark virtual nodes and use it to hide the client
id from the sink-input/source-output info in pulse-server.
2021-04-20 21:05:59 +02:00
Arun Raghavan
74140abada pulse-server: Factor out module code to compile independently
This starts breaking up the giant monolith that is the pulse-server.c
code into more manageable chunks by trying to split the module code into
individual compilation units.
2021-04-15 19:37:15 -04:00
Pauli Virtanen
132786c202 pulse-server: implement send_object_message
Use it for providing Bluez codec listing/switching interface.  It
currently works by just switching device profiles.
2021-03-20 23:30:38 +02:00
Björn Daase
5913eb098c treewide: fix issues found by codespell 2021-03-16 19:11:25 +00:00
Wim Taymans
82c452a93d pulse-server: expose sync method 2021-03-09 12:08:45 +01:00
Pauli Virtanen
ed9614077c pulse-server: implement node latency offset
Also add facility for storing user data on objects.
2021-02-18 11:33:45 +00:00
Pauli Virtanen
59452a0904 pulse-server: send server change events when default nodes change
Send server change events to subscribers, when default nodes change due
to some nodes being added/removed/changed, also if there is no metadata
change.  Make sure the event is consistent with the result from
find_device at the time.

Previously, these were not necessarily sent, or information from
find_device immediately after the event might not reflect the change
yet.
2021-01-23 07:17:19 +01:00
Wim Taymans
4f0f5fccc9 pulse-server: keep metadata for the routes
Pass all metadata objects to the pulse-server and keep track of
some. Keep route restore info in properties.
2020-11-23 10:44:12 +01:00
Wim Taymans
22cec7823e pulse-server: skip objects being created
Skip iterating over objects that still have pending updates.
Make sure we have all info and properties before we process
objects.

Fixes #376
2020-11-13 09:52:02 +01:00
Wim Taymans
18c57efb39 pulse-server: take type from info 2020-11-09 09:42:53 +01:00
Wim Taymans
b472abe65b pulse-server: improve GET_SERVER_INFO
We don't need to bind to the core object again, we can just use the
events on the manager core.
We don't actually have info when the Core is added so don't try to
use it to get defaults for the client.
Use the manager core info in server info.
2020-11-05 10:36:13 +01:00
Wim Taymans
c619d7851f pulse-server: add move and default sink/source
Clean up error handling, use errno everywhere and convert when needed.
2020-10-29 11:59:16 +01:00
Wim Taymans
124b1221a6 pulse-server: add more introspection
Emit new/change/remove events
Handle suspended state of peer
Handle direct_on_input record streams.
Place the tag in error messages
2020-10-27 14:57:15 +01:00
Wim Taymans
a372e4e90e pulse-server: add more introspection
Add default nodes support and subscription events when it changes.
Fix stream id.
Fix node lookup.
Fix node volume.
2020-10-26 13:28:45 +01:00
Wim Taymans
fdf3485902 pulse-server: add sink/source sink_input/source_output introspect 2020-10-25 19:51:42 +01:00
Wim Taymans
1cbad89862 pulse-server: add introspection of clients and modules
Add manager object to collect object info
Wait for object info until completing client connect
Implement clients and modules list and info.
2020-10-25 15:28:42 +01:00