Commit graph

3116 commits

Author SHA1 Message Date
Wim Taymans
448c1937ad hook: separate spa_callbacks from the hook
Make a spa_callbacks with just the functions and data and use this
in the hook and objects.
2019-05-15 12:17:52 +02:00
Wim Taymans
6ee192dff5 hooks: use hook to implement the callbacks
This way we get the version check implemented and save some
code.
2019-05-15 11:19:23 +02:00
Wim Taymans
a78617c6a8 a2dp: cleanups 2019-05-15 10:20:28 +02:00
Wim Taymans
f6ace8a000 a2dp: add events and implementation
Use hooks for the implementation of the transport
Add events to the transport
Handle the destroy event of the transport to release the reference
in source and sink.
2019-05-14 18:10:18 +02:00
Wim Taymans
903cbeb7c1 hook: handle port and factory implementation with hook
This way we can also handle the version number.
2019-05-14 18:08:02 +02:00
Wim Taymans
23d4ed62dd device: rename internal variable for consistency with node 2019-05-14 18:06:48 +02:00
Wim Taymans
5858c992ef audioconvert: improve debug 2019-05-14 18:05:51 +02:00
Wim Taymans
e6c42d3324 hook: add option to call hook with return value 2019-05-14 18:04:34 +02:00
Michael Olbrich
5f507c804f remove libv4l2 dependency
It's not used anywhere right now.
2019-05-14 13:21:53 +02:00
Julian Bouzas
674f3e197e bluez5: add a2dp-source plugin 2019-05-14 13:02:55 +02:00
Wim Taymans
29164a0f54 link: remove error from method
We return a reason in errno
2019-05-14 12:59:18 +02:00
Wim Taymans
2889db8efb link: listen to permission changes on the ports
If one of the ports becomes invisible to a client, hide the link.
If one of the ports is owned by a client and the peer port becomes
invisible for the client, destroy the link.
2019-05-14 12:09:34 +02:00
Wim Taymans
d7c7e9bf6f global: update child permissions
When the permissions of a global change, update the child permissions
as well.
2019-05-14 12:08:35 +02:00
Wim Taymans
d39d15b0d9 global: keep track of child globals
Keep track of the child globals and unregister when the parent
is unregistered.
2019-05-14 12:07:30 +02:00
Wim Taymans
b474666e2e link: listen for permission changes
Destroy the link when the ports or nodes are no longer visible
to the other side of the link.
2019-05-13 18:03:27 +02:00
Wim Taymans
a224234acd global: don't follow NULL parent 2019-05-13 18:00:50 +02:00
Wim Taymans
79fe89412a client: update permission before calling global_update
first update the permission and then call the global update method. This
ensures that any query of the permissions will have the new permissions.
2019-05-13 17:58:58 +02:00
Wim Taymans
04c153d410 global: add permissions_changed event 2019-05-13 17:24:33 +02:00
Wim Taymans
9221b8dedd 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 17:13:58 +02:00
Wim Taymans
23d0b9e5e2 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 17:11:15 +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
07ff967285 client: call find_permission only once 2019-05-13 10:14:08 +02:00
Wim Taymans
2d3f30fb96 introspect: fix enum 2019-05-13 10:12:33 +02:00
Wim Taymans
795b14f48b protocol-native: also handle 0 recvmsg as EOF
When recvmsg returns 0, also handle it like an EOF and close to
connection otherwise we keep spinning forever.
2019-05-13 10:10:41 +02:00
Wim Taymans
a2bf4ce96e 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:28:18 +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
4e70cddf1d core: don't remove client resource in hello
Keep the client resource of a client around and make sure we don't
destroy it in hello.
2019-05-10 12:36:28 +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
a804b71267 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-10 11:56:30 +02:00
Wim Taymans
a70fd80c2d fmtconvert: fix format enumeration
Rework the format enumeration so that it also return the other
rate/channels, even when using a canonical format.
2019-05-10 11:39:51 +02:00
Wim Taymans
1a7fcaf9c6 Fix cleanup 2019-05-10 11:15:48 +02:00
Wim Taymans
41ab051b68 fmtconvert: fix format enumeration
Even if the other pad is already negotiated, we can convert all
formats to F32.
2019-05-09 09:35:03 +02:00
Wim Taymans
ecde090a1f pod: remove type check, it causes errors 2019-05-09 09:34:23 +02:00
Wim Taymans
35c2aca706 remote: only remove the proxy id when it existed 2019-05-07 17:53:57 +02:00
Wim Taymans
9a842e4643 pipewiresrc: actually use the fd when set 2019-05-07 14:53:53 +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
b01858931c v4l2: add camera media.role 2019-04-30 15:42:17 +02:00
Wim Taymans
636c02d38b audioconvert: fix native variable rate resampler 2019-04-30 15:14:05 +02:00
Wim Taymans
5ac383e7f7 alsa: improve capture slave resync
When we underrun, send out a buffer of 0 samples and catch up next
time.
Detect discont in the master and resync.
2019-04-29 10:00:42 +02:00
Wim Taymans
b43844e7c6 alsa: improve capture resync
Make sure we capture enough data even when the ringbuffer wraps
around.
Use the clock nsec to get timing, we don't need to get the new time.
Improve sync in capture.
2019-04-26 15:48:21 +02:00
Wim Taymans
317fd9fac5 alsa: handle quantum changes 2019-04-25 16:15:52 +02:00
Wim Taymans
9ec3e3ab6d private: set min quantum to 32
Going as low as 32 is possible now with the better clock rate
estimation.
2019-04-25 13:04:44 +02:00
Wim Taymans
6ce9b5acf7 jack: fix get_cycle_times 2019-04-25 13:03:19 +02:00