Commit graph

189 commits

Author SHA1 Message Date
Wim Taymans
135a0a18d8 client-node: track memory for client
Keep track of the memory we sent to the client to only send memory
once and choose better memid values.
2018-03-01 14:46:49 +01:00
Wim Taymans
7bc9230a79 client-node: proxy -> node 2018-03-01 12:13:00 +01:00
Wim Taymans
b91a2a4207 link-factory: don't leak properties 2018-02-27 12:49:22 +01:00
Wim Taymans
760e046dcf client-node: handle port set_io 2018-02-26 16:16:53 +01:00
Wim Taymans
bc669f5def audio-dsp: small cleanups
Fix some compilation errors
implement port cleanup
2018-02-26 16:09:47 +01:00
Wim Taymans
944d205e8e protocol-native: print connection info after remap
Print the connection messages after mapping the ids or else we
can't really make sense of the ids.
2018-02-26 12:36:16 +01:00
Wim Taymans
e2f01c5838 protocol-native: disconnect remote
Disconnect the node and all the streams instead of just changing the
state.
2018-02-26 12:29:02 +01:00
Wim Taymans
6f61ac9357 fix some signed vs unsigned comparisons 2018-02-20 18:19:11 +01:00
Wim Taymans
5f92c152e3 remove module-jack
It's better to make a replacement client library
2018-02-20 18:17:01 +01:00
Wim Taymans
20e0d8b4ea dsp: use format in the port.dsp property 2018-02-20 15:49:10 +01:00
Wim Taymans
58667d6ced params: make method on node and port to enum params
Do not pass the params of the node in the node_info, instead,
make a method to enumerate the params. This makes it possible for
clients to only enumerate what they need and when they need it.
Improve introspection of a port, add the name and properties.
Add an enum_param method on the port that can be used to enumerate
port formats.
Change -monitor and -cli and add support for enum_params on the node
and port.
2018-02-20 10:31:55 +01:00
Wim Taymans
a9a95a4205 audio-dsp: start counting from 1, to match jack ports 2018-02-20 10:01:10 +01:00
Wim Taymans
0e5a1b6327 props: use macro for property alternatives 2018-02-20 09:36:05 +01:00
Wim Taymans
f039238288 audio-dsp: implement buffer size param 2018-02-16 18:15:37 +01:00
Wim Taymans
3db9a44679 dsp: make separate nodes for sinks and sources
Make separate nodes for sinks and sources
Add aliases for ports
2018-02-16 12:02:39 +01:00
Wim Taymans
0173180e78 module-audio-dsp: add dsp module
Add an audio dsp module that adds an interleaver for each audio sink
and only allows 1 buffer size and format on the ports. The idea is that
dsp (pro-audio) nodes can be inserted in this part of the pipeline.
2018-02-15 17:54:08 +01:00
Wim Taymans
6c000229f0 port: add port globals
Expose all ports as globals, linking is then done by specifying
the global id of the ports.
Add method to destroy objects. not much security on this one but
yet but it should allow priviledged clients to kill connections
and other clients etc.
Make events on the global object. Implement the bind with the event,
handle destroy of the globals.
Add link properties
Use append to preserve the order.
2018-02-15 17:49:04 +01:00
Wim Taymans
b86f141273 add more debug info 2018-02-15 11:41:07 +01:00
Wim Taymans
95e27c27ca protocol: signal when connection was closed 2018-02-15 10:49:01 +01:00
Wim Taymans
fdfce79edb connection: return false on read error
Return false to indicate that there is no more data to read or else
we add the -1 to buffer_size and things go wrong..
2018-02-12 17:32:09 +01:00
Wim Taymans
70687e466d client-node: update port properties
Handle port properties
Set the client name
2018-02-09 18:10:51 +01:00
Wim Taymans
9d4b0d8358 dbus: move rtkit to module
Move the rtkit code to a module.
Make sure we don't need to include the dbus headers in the spa dbus
interface. This removes the dependency on dbus.
2018-02-08 10:02:17 +01:00
Wim Taymans
2fe6a8245d control: keep track of prop_id
Keep track of the property id which describes the property
functionality.
Link controls based on the property instead of the param_id.
2018-02-07 17:56:35 +01:00
Wim Taymans
053f251be8 client-node: handle io reset 2018-02-07 17:54:43 +01:00
Wim Taymans
d14c7abe11 protocol: make connect async
Make the protocol client connect call async with a callback when it
completes.
Move the connect methods into separate files, add an empty connect
method that will use the screencast portal to get a pipewire fd.
Use the remote intention to get the connect method.
Add some better error reporting.
2018-01-30 15:11:39 +01:00
Wim Taymans
ad1e5fdc10 monitor: set node enabled state
Let the monitor update the node enabled states when creating
and on change events.
2018-01-30 15:08:44 +01:00
Wim Taymans
cb0811860f jack: add property to select node to link to 2018-01-27 11:46:15 +01:00
Wim Taymans
1361a12094 spa-node: use new function to parse arguments 2018-01-27 11:46:15 +01:00
Wim Taymans
5fbf79a4b2 jack: fix param enum 2018-01-27 11:46:15 +01:00
Wim Taymans
f115646bcd core: remove permission callback
Remove the core permission check callback. We can now use the per
client permission configuration.
Rework the flatpak module to use the permissions. When a client
connects, do the portal call and iterate all globals, updating the
permissions. Also update the permissions of newly added globals.
The client is owner of itself.
2018-01-24 16:17:13 +01:00
Wim Taymans
ff17fb68b5 permissions: use current_client for security checks
Don't pass around the client object but keep track of the current
client in the core object. This way we don't need to add a client
argument to functions and can check security when needed.
2018-01-24 12:04:32 +01:00
Wim Taymans
ab099d09dd permissions: check permissions more
Pass client to some core functions to make it possible to check
permissions when iterating globals.
Check permissions of factory before using it.
Check permissions in link factory, only allow linking of nodes we can
see.
Check permissions in the autolink module, only try to link to nodes
we can see.
Make client permissions update behave like an atomic update of an
unordered set of permissions, which is perhaps a bit more intuitive.
2018-01-24 10:42:40 +01:00
Wim Taymans
1c44629cf9 rework initial connection
Make a steal_fd method on the remote.
Add a hello method that sends the initial core info and types to
the client.
With an explicit method we can do this multiple times when we steal
the fd from a remote and use it to make a new remote.
2018-01-19 17:57:59 +01:00
Wim Taymans
bc35d30407 remote: add _get_fd method
Add a method to get the fd of the connection.
2018-01-19 13:10:11 +01:00
Wim Taymans
c593d868fb global: add properties
Add properties to global objects to make it easier to select what
nodes and objects to bind too. They can also be used to implement
permissions on the globals based on properties.
Add more error handling in _register.
Make more functions return a result code.
Make a separate pw_module_register, like all other objects.
2018-01-19 11:27:54 +01:00
Wim Taymans
a8fa4383a1 mixer: also install mixer on new nodes 2018-01-18 12:49:01 +01:00
Wim Taymans
67b06d4ad2 core: remove create-link
Make a link factory and use create-object to make links. That way
we can have different kinds of links based on the factory and we
can also hide the factory when link creation should be blocked.
2018-01-16 16:53:08 +01:00
Wim Taymans
f1345f91a8 spa-node: pass properties to plugin init func 2018-01-16 16:51:24 +01:00
Wim Taymans
21aad20f94 node-factory: activate elements 2018-01-16 16:50:53 +01:00
Wim Taymans
82ea32bcdf flatpak: use support dbus connection 2017-12-18 13:16:42 +01:00
Wim Taymans
4d6ac37398 Use int instead of bool as result
Prefer to use an int return from a function instead of bool because
it can contain more info about failures.
2017-12-18 11:38:30 +01:00
Wim Taymans
d5643e8472 core: add permissions call
Add a permissions call that can be used to update the permissions
of global objects. This can be used to set specific permissions
on certain objects, hide objects and define the permissions on new
objects. The system is quite generic so that we can extend it later
with more complicated match rules or so.
2017-12-14 18:37:05 +01:00
Wim Taymans
ef800581f0 core: make pw_core_for_each_global more powerful
Make the for_each function more powerful by allowing more than just
a bool return value.
2017-12-14 18:32:02 +01:00
Wim Taymans
1f4d1d071c modules: make events structure static
They are only used locally and otherwise we might get symbol clashes.
2017-12-14 18:28:03 +01:00
Wim Taymans
c1aa3b4625 client-node: move to per node memory
Remove the per-port memory and only use per-node memory. This will
make it possible to share memory between ports in the future.
Keep refs to memory on the buffers and free (close) the memory
when no longer used.
2017-12-01 17:24:03 +01:00
Wim Taymans
08814bd808 data: clean up fd and data management
Do not send the offset and size in the add_mem call, just send the
fd and the flags. The area that we need to map from this to find the
meta, chunk and data are sent in a separate call. This should make
it possible to truncate the memory to a larger size to dynamically
allocate more shared memory for a client.
Remove the Id data type, it's not needed.
Don't automatically map memory in remote.c
Pass the original memory type from server to client.
Handle DmaBuf mem in video-play now that the server passed it on.
2017-12-01 09:34:53 +01:00
Wim Taymans
541553be1c control: add control objects
Add control objects for all controllable properties on ports.
Try to link compatible control properties in autolink.
Allocate shared memory for the output property memory and configure
the io area on the ports when the controls are linked.
Send the shared memfd to clients when the io area is configured.
Add port_set_io support in remote.c, mmap the control io area and
set on the port.
Add some param helpers
Add volume control to export-source update the volume before
sending each buffer.
2017-11-30 16:36:29 +01:00
Wim Taymans
91a3670610 node: make port for_each more powerful
Make an int return from pw_node_for_each_port() so that we can return
errors or early exit.
Add pw_port_for_each_param() to iterate params. And use this to collect
the formats.
2017-11-29 16:58:17 +01:00
Wim Taymans
425073afd8 param-io: work on IO parameters
Reorganize the io parameter ids and objects. Make separate enumerations
for buffer, control, input and output properties.
Add a volume output property to export-source. This is still unused
but will eventually be routed to a PropsIn io area where it can
control the volume of a mixer, for example.
2017-11-29 13:25:56 +01:00
Wim Taymans
140c3959ab meta: remove shared meta data
Make a method to find the memory block for the given ptr. We can
use this to find the memfd of the memory if there is any. We can
then remove the Shared metadata on buffers.
2017-11-28 18:30:29 +01:00