Commit graph

6195 commits

Author SHA1 Message Date
Wim Taymans
b5f9983c4e properties: add method to parse key=value list 2018-01-27 11:46:15 +01:00
maxice8
1e411bfe09 pipewire/private.h: add missing sys/types.h for pthread_t 2018-01-27 07:40:04 +01:00
Emmanuele Bassi
a52ba92378 build: Use mathlib for the libm dependency object
The libm variable is defined in `spa`, but the top-level meson.build
defines mathlib.
2018-01-26 08:51:38 +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
5df5afd0a9 module: load and register in one go
Load and register the module in one go because we need to have the
global set when calling the init function so that factories and nodes
can use this as the parent global.
Set the name in the global properties.
2018-01-23 15:25:48 +01:00
Wim Taymans
1ed63e7ba0 add commented line for bluez5 monitor 2018-01-23 13:16:47 +01:00
Jonas Ådahl
f2aafffb2c gstpipewiresrc: Add fd parameter
Will be passed to a pw_remote_connect_fd() instead of plain a
pw_remote_connect() call.
2018-01-23 10:19:25 +01:00
Wim Taymans
3c9eb13500 video-src: set buffer size 2018-01-22 10:35:19 +01:00
Wim Taymans
4851a827f4 video-play: add example of steal_fd 2018-01-19 18:00:45 +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
527f4683ba pipewiresink: add fd property
Add fd property to connect with a given fd
2018-01-19 17:54:47 +01:00
Wim Taymans
8da8dbe025 core: add some core properties to the global 2018-01-19 16:10:32 +01:00
Wim Taymans
4384097227 factory: set fixed properties as global properties 2018-01-19 13:37:24 +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
a79e8923b5 link: remove obsolete cleanup code
Whe the port is destroyed, we destroy the link and perform the
cleanup aleady in the destroy.
2018-01-19 13:08:58 +01:00
Wim Taymans
04f77d2565 global: only unregister when it was registered 2018-01-19 11:31:05 +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
47dd97049c examples: also handle SDL events in main-thread 2018-01-18 15:49:56 +01:00
David Svensson Fors
0b523e4334 SDL examples: all SDL operations in one thread
Fix video in SDL examples by invoking rendering in the same thread
(pw_loop) that created the window, renderer and texture.

At least on some systems, no video is shown without this patch. In
those error cases, SDL_RenderPresent triggers an SDL error "The
specified window has not been made current". That, in turn, has to do
with how SDL uses the current thread for determing the current window.
In general, the page linked to below states that the SDL API is not
designed to be used from multiple threads.

Reference: https://wiki.libsdl.org/CategoryRender
2018-01-18 15:43:46 +01:00
Wim Taymans
0eb44b340a link: use DISABLED flag on port of inactive links
Don't unlink the ports of an inactive link because then it might be
possible that the scheduler can't recycle a buffer, instead use
a port flag to mark the ports disabled and change to scheduler to
skip those ports.
2018-01-18 15:39:03 +01:00
Wim Taymans
a8fa4383a1 mixer: also install mixer on new nodes 2018-01-18 12:49:01 +01:00
Wim Taymans
d50037c2f7 global: separate create and register
That way we can place the global in the wrapped object before we
emit the new_global object and have things work better.
2018-01-18 12:47:44 +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
4a57f88345 link: fix param enumeration
When we have no input parameter we always need to use NULL as the
filter for the output parameter.
2018-01-11 10:16:40 +01:00
Wim Taymans
79129f81a7 export-source: allow more formats and channels 2018-01-11 10:15:51 +01:00
Wim Taymans
690f6ca372 module: improve error reporting 2017-12-18 13:17:02 +01:00
Wim Taymans
82ea32bcdf flatpak: use support dbus connection 2017-12-18 13:16:42 +01:00
Wim Taymans
f7b6fea43d Add dbus support interface
Add an interface that can manager a dbus connection.
Make a dbus interface in the core that can create connections running
in the core main loop. Keep this as support for spa plugins.
2017-12-18 12:41:47 +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
e5e360d5df props: improve property introspection
Make a new PropInfo parameter that allows us to iterate all
properties. Make some new fields to set labels and names for
properties. We will be able to add more things to describe the
properties this way.
Use the Props param to simply query or set properties.
We can now make int enum properties and describe all possible
values with labels, we don't need to register types anymore.
This then makes it possible to enumerate the v4l2 controls and make
them available as control params.
2017-12-15 16:30:56 +01:00
Wim Taymans
a9ece1df91 export-sink: add an example permission call 2017-12-14 18:53:05 +01:00
Wim Taymans
e42fd9301b client: warn for invalid global ids 2017-12-14 18:45:55 +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
1ace2a5daf make systemd dependency optional
Don't recurse into the directory of systemd when it was not found.
There are still some issues because libudev is actually provided
by systemd these days and we still need that for building the v4l2 and
alsa monitors.
2017-12-14 09:30:34 +01:00
Wim Taymans
8aa12e6b62 examples: use main_loop 2017-12-04 15:17:01 +01:00
Wim Taymans
e747fb2224 port: fix mixer status
When the mixer has no input ports, return OK
Don't increment required inputs for optional ports.
2017-12-04 15:05:56 +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
4019da39c1 remote: use mmap helpers
Use the mmap helpers to only map the data that is needed.
2017-12-01 12:42:18 +01:00
Wim Taymans
a8cbffac7f core: get page size 2017-12-01 12:41:48 +01:00
Wim Taymans
ccd19f1e49 mem: add mmap helper
Add function and structure to help with mmap and mlock
2017-12-01 12:40:32 +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