For now, put a limit on the amount of items we can send and receive
over the native protocol. A more complex way of allocating and freeing
can be implemented later when we really need to raise the limits.
Fixes#2070
The `pw_*_info` structures in core pipewire all have 64-bit change
masks. Convert the change masks in the session manager extension
to 64-bit as the differing sizes can cause problems.
This introduces an API and ABI break unfortunately, but due to
the limited number of users of the session manager extension,
it was deemed safe.
See wireplumber#49
Make a method to return or allocate the serial for a global.
When the global is unregistered, a new serial is calculated.
Place the serial in the object info and the global info.
Mark some structures, arrays static/const at various places.
In some cases this prevents unnecessary initialization
when a function is entered.
All in all, the text segments across all shared
libraries are reduced by about 2 KiB. However,
the total size increases by about 2 KiB as well.
This also brings the advantage that all tools, examples, modules, components
can also be compiled standalone out-of-tree using libpipewire from the system
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.
SPA_MEMBER is misleading, all we're doing here is pointer+offset and a
type-casting the result. Rename to SPA_PTROFF which is more expressive (and
has the same number of characters so we don't need to re-indent).
This tool detects and fixes common English spelling mistakes, with
generally very few mistakes.
Here is the command I used to generate this commit. There were a few
changes that had to be done manually, and of course adding the ignore
file:
```shell
codespell -I .codespell-ignore -x .codespell-ignore -w
```
I didn’t add it to the CI, but this would be a good place for it.
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 .
The info structure needs to be cached because there is no way to
request it from the implementation, unless we hack the add_listener
API to be used for making info requests or add a new method that
will be used just in the implementation (both are bad ideas).
The params are cached because
1) a client doing enum_params + sync will not work correctly, since
the sync call syncs with the server and not the implementation...
we could block the client to solve that, but then there is also #2
2) the implementation is not aware of the clients and therefore
it cannot keep track of who is subscribed and who is not, this
needs to happen in the server. Then if we only keep track of the
subscriptions in the server and keep requesting params from the
impl, there is no way to know if a param event coming from the
impl matches a call to enum_params or to subscribe or if it's
just an update that needs to be forwarded to subscribers.
This is more in line with wayland and it allows us to create new
interfaces in modules without having to add anything to the type
enum. It also removes some lookups to map type_id to readable
name in debug.
The proxy API is the one that we would like to expose for applications
and the other API is used internally when implementing modules or
factories.
The current pw_core object is really a context for all objects so
name it that way. It also makes it possible to rename pw_core_proxy
to pw_proxy later.
media-session: Wait for devices to appear and be bound before setting
the profile on the device. Then wait for all the nodes to appear
before attempting the create endpoints on the device.
Pass the client.id that we made this endpoint for in the endpoint
properties. This makes it possible to let pulse find the client
that belongs to the endpiont. The client.id is used to find the
client that actually made the object (the session manager)
Create an endpoint link object when linking endpoints. Keep track
of the links in the endpoint_link and cleanup when they are all
gone.
Improve properties on session objects.
Create a helper in the session manager to link all ports between
2 nodes.
Make the output endpoint call the input endpoint create_link, passing
the node or ports to link to.
Make the input endpoint complete the link by calling the session
helper to link all ports.
Remove the node policy, we're only using a policy for the endpoints
now.
pulseaudio card is mapped to device
pulseaudio sink/source is mapped to an endpoint
prepare to map streams to card profiles
Add Route param to implement the endpoint routing later (ports)
Create an alsa endpoint for each device
Create one stream for each endpoint (Playback/Capture)
Implement create_link on the endpoint. The idea is to call
create link on the peer endpoint to complete the link. Remove
create_link on the session.
Add stream-monitor to turn pw_stream nodes into endpoints
Add a policy manager that tries to link endpoints
Use enum pw_direction for the endpoint direction. We can use the
media_class to determine if this is a pw_stream or not but it should
not really matter, you can link any output to any input.
Add autoconnect property for endpoints to make the policy connect.