Commit graph

1230 commits

Author SHA1 Message Date
Thomas Zimmermann
473fb330cf autogen.sh: Reuse existing build directory
Removing the build directory might delete important development files
as well.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
2019-05-22 10:19:58 +02:00
Wim Taymans
0951a97a36 destroy resources first, then the global 2019-05-22 10:09:48 +02:00
Wim Taymans
c67f903c61 Return -EEXIST when registering an object twice 2019-05-22 10:09:12 +02:00
Wim Taymans
92808809ec client-node: don't destroy the resource from its event
Do no destroy the resource from within the event handler
2019-05-22 10:05:24 +02:00
Wim Taymans
b700d76ff4 list: use spa_list_consume some more
If we know the item is removed in each iteration, _consume can handle
deletion of any item while being iterated.
2019-05-21 17:11:27 +02:00
Michael Olbrich
6b269cce35 node: use spa_list_for_each_safe() for pw_node_events_*
Introduce spa_hook_list_call_simple_safe() as a new helper that uses
spa_list_for_each_safe() and use it for pw_node_events_* This way multiple
threads can iterate at the same time and, if only one thread is active, the
current list entry can be safely removed (e.g. in
pw_node_events_destroy()).

Without this the node listener_list may be corrupted when the main and data
loop iterate over the list at the same time (See #143).
2019-05-21 17:10:09 +02:00
Jonas Ådahl
323917ab4b module-portal: Handle no app_id being set
Avoid crashing if the portal would for whatever reason fail to set this.
2019-05-20 16:10:12 +02:00
Jonas Ådahl
55eadd6c4c module-portal: Ignore if pipewire.access.portal.is_portal is "yes"
This is for the remotes that the portal itself owns, such as ones that
track the number of cameras.
2019-05-20 16:10:12 +02:00
Wim Taymans
abaf40ba8b core: small cleanup in _find_format() 2019-05-17 12:37:25 +02:00
Michael Olbrich
1c8daa4a50 core: fix pw_core_find_format() for active ports
pw_core_find_format() is currently broken when one of the ports is already
active: The format of the active port is used and the other port is
completely ignored.
As a result, the autolink module may try to link a new port to the first
already active port even if the formats do not match.

To fix this, use the format of the active port as a filter and enumerate
the formats of the other port.
2019-05-17 12:23:49 +02:00
Jonas Ådahl
777b97b7d8 module-portal: Use permission store for portal initiated clients
Detect what clients were started by the portal, and use the permission
store to determine permissions of existing and future nodes.

Clients are detected whether they are from the portal or not by
comparing the PID of the client with the PID of the owner of the
portal D-Bus name.

It is assumed that the portal will set an appropriate app_id, and a
comma seperated list of media roles (e.g. "Camera"), that should be
queried. If app_id is an empty string, it's assumed to be a
non-sandboxed client, and permissions are assumed to be allowing.
2019-05-16 18:07:52 +02:00
Jonas Ådahl
31145b58dc Rename module-flatpak module-portal
It'll use the portal and permission store explicitly, and nothing
particularly flatpak specific.
2019-05-16 18:07:52 +02:00
Jonas Ådahl
3ce0c4b81a pipewire/node: Pass along 'media.role' node property too 2019-05-16 18:07:52 +02:00
Michael Olbrich
5f507c804f remove libv4l2 dependency
It's not used anywhere right now.
2019-05-14 13:21:53 +02:00
Wim Taymans
98da5a2e9e global: emit permissions_changed event
Add a permissions_changed event when the permissions change for a
global for a client.
Recheck if a link is still allowed when node permissions changed
and destroy the link if not.
2019-05-13 17:04:43 +02:00
Wim Taymans
83bc033837 global: combine all permissions of the object tree
To get the permissions of an object, combine the permissions
of the object and all the parent nodes up to the root.

This is necessary to enforce that a client can never see and
object id (in this case the parent id) it is not allowed to see.
2019-05-13 15:46:32 +02:00
Wim Taymans
d7acbb222e link: check permissions
When creating a link between two nodes, check if the owner of a
node (when it is a client) can see the other node.
2019-05-13 12:51:20 +02:00
Wim Taymans
3854f8557a protocol: add security label to a client
Don't pass the ucred to the client construct, just set the properties
in the protocol.
Use the client properties to get ucred.
Add the security label to the client properties (from SO_PEERSEC)
2019-05-10 13:12:22 +02:00
Wim Taymans
e0eeedc369 core: don't send remove_id in hello
The hello method should also destroy the resources for a client but not
send a remove_id for them.
2019-05-10 12:09:26 +02:00
Wim Taymans
5d2f0f5182 remote: only remove the proxy id when it existed 2019-05-06 17:48:23 +02:00
Wim Taymans
7670ee7eec core: destroy all resources on hello
Destroy all resources (except the core) for a client when it
does a hello. This typically needs to be done after passing the
connection fd from one client to another.
2019-05-06 17:05:05 +02:00
Wim Taymans
2b5c6fd676 list: add _consume method
Add safer way to destroy a list of objects.
2019-05-06 17:04:16 +02:00
Wim Taymans
fa0b4f9321 client: properties with "pipewire." prefix are read-only
Properties that start with "pipewire." can only be set once. This
prevents a client from overwriting the ucred or any of the other
protected properties once they are set by the core or a module.
2019-05-06 15:41:26 +02:00
Wim Taymans
3f5b3b7cb1 pipewiresrc: actually use the fd when set 2019-05-06 12:07:25 +02:00
Wim Taymans
e4be9837c4 v4l2: add Camera media.role 2019-04-30 15:54:29 +02:00
Wim Taymans
9f7c9022cf format: map all mjpeg formats to video/mjpeg
Fixes #139
2019-04-10 17:03:14 +02:00
Wim Taymans
9f2cfe1cd6 rtkit: improve DISABLE_RTKIT
DISABLE_RTKIT should not even try to get the dbus connection or
anything.
2019-04-10 16:45:44 +02:00
Nicolas Dufresne
6e7db20bf5 rtkit: Allow disabling with DISABLE_RTKIT
Allow disabling real time thread, this is useful to run inside
valgrind without being killed.

Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
2019-04-10 16:45:38 +02:00
Matthias Fend
bdc81f6dc0 daemon: use correct type for getopt_long() return value
Depending on the compiler configuration 'char' may be an unsigned type
which will not work as expected.

Signed-off-by: Matthias Fend <matthias.fend@wolfvision.net>
2019-04-02 23:26:40 +02:00
Philipp Zabel
181a6a2cea v4l2: do not keep non-capture devices open
If VIDIOC_QUERYCAP fails, or V4L2_CAP_VIDEO_CAPTURE is not set,
spa_v4l2_open should close the port file descriptor again.
2019-04-02 23:25:34 +02:00
ncraun-vivint
737851df6c Quote "$@" in autogen.sh
An unquoted $@ will break for arguments with spaces in their names. Unquoted $@ will work until it doesn't, and then it can be tricky to track down exactly what went wrong. Using "$@" will save someone some headache in the future.
2019-02-13 11:18:31 +01:00
Wim Taymans
f6391be214 add SPA_EXPORT where needed 2019-02-06 11:59:05 +01:00
Wim Taymans
3424c05298 example: use core methods to register types 2019-02-06 11:43:47 +01:00
Wim Taymans
703309f6cd spa: don't use constructor attribute to register factories 2019-02-06 11:38:12 +01:00
Wim Taymans
e4cac644d2 fix some compiler warnings with clang 2019-02-06 11:35:36 +01:00
Wim Taymans
317f3b6be7 type: add function to map types
Add a helper function to map the types. This should be used instead
of calling directly into the type mapper when CFI is used.
2019-02-06 11:10:44 +01:00
Wim Taymans
dd3eb55aee utils: add SPA_EXPORT 2019-02-06 09:21:16 +01:00
Jan Grulich
371da358d1 Avoid invalid conversion error with C++ compilators 2019-01-02 10:44:12 +01:00
Wim Taymans
f8b156ac14 thread-loop: fix leak of event
Destroy the event when the loop is destroyed
2018-12-20 10:34:12 +01:00
Wim Taymans
c511b530ed thread-loop: improve error checking 2018-12-20 10:33:59 +01:00
Wim Taymans
bcec14decb Release 0.2.5 2018-12-20 10:06:16 +01:00
Wim Taymans
5c6bd8e5c7 free() can handle NULL just fine so skip the check
Fixes #117
2018-12-20 09:32:28 +01:00
Wim Taymans
5390079b4a video-src: set valid cursor id 2018-12-18 16:01:12 +01:00
Wim Taymans
7f52246caf Add some more error checking
Fixes #116
2018-12-18 15:37:08 +01:00
Wim Taymans
053e01177d loop: use simple hook emission
Add new simple hook emision without a cursor. The one with the cursor
is not thread safe and is not needed for the loop.

Fixes #110
2018-12-14 10:07:55 +01:00
Wim Taymans
73aac68908 flatpak: only update permissions on sandboxed clients 2018-12-12 15:47:01 +01:00
Wim Taymans
39078f2abc meta: use spa_point and spa_rectangle
Change Cursor and Bitmap to what the work branch uses
2018-11-30 15:49:58 +01:00
Wim Taymans
8205486554 video-play: handle arbitrary cursor sizes
video-play: only allocate the texture when we know the size and
format of the cursor bitmap.
video-src: make cursor size defined with constants.
2018-11-30 12:09:31 +01:00
Wim Taymans
218fd081df meta: define invalid cursor metadata 2018-11-30 12:08:53 +01:00
Wim Taymans
cd53eca92b meta: add cursor metadata and examples
Add a moving and flashing circle cursor to video-src
Render the cursor in video-play
2018-11-30 11:07:45 +01:00