Commit graph

3164 commits

Author SHA1 Message Date
Wim Taymans
d70a47b7fe move proxy implementations in their own file
Rearrange headers
2019-12-11 10:58:51 +01:00
Wim Taymans
49d736bbb7 pw_registry_proxy -> pw_registry 2019-12-11 09:44:48 +01:00
Wim Taymans
ecc6b27cd7 rename core_proxy -> core
Rename core_proxy to core and move the introspect and interface
contents to core.h

In an effort to promote the proxy API.
2019-12-11 07:46:59 +01:00
Wim Taymans
8ea78c2e3f pw_core -> pw_context
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.
2019-12-10 18:19:56 +01:00
Wim Taymans
42103a8218 export-spa: implement with core-proxy 2019-12-10 17:09:52 +01:00
Wim Taymans
e2ba3dc6e4 local-v4l2: implement with core-proxy
Implement the local-v4l2 example with a core-proxy connected to
a local instance. We can export and instantiate objects and
link nodes and ports without having to touch the implementations.
2019-12-10 16:37:22 +01:00
Wim Taymans
c0f5e8d967 protocol-native: always create a local server
Always create a local server without any socket. We can use this
to create clients that connect locally (in-process), such as
the cli or any app that wants to create a local pipeline.
2019-12-10 16:23:43 +01:00
Wim Taymans
8917e1e149 cli: set error when connection failed 2019-12-10 16:03:19 +01:00
Wim Taymans
49a4440692 audioadapter: pass slave properties directly 2019-12-10 12:48:18 +01:00
Wim Taymans
84c91c44e3 port: emit info changed on new port 2019-12-10 12:33:29 +01:00
Wim Taymans
468cbb8892 core-proxy: improve cleanup
Don't disconnect and destroy on errors, let the app do that.
Don't try to use a destroyed core-proxy.
2019-12-10 12:33:10 +01:00
Wim Taymans
2c492ff71f client-node: don't check format
Don't check if we got a Format param to be able to set buffers,
let the implementation decide on that.
2019-12-10 12:21:02 +01:00
Wim Taymans
5a2ad084e8 proxy: add pw_proxy_set_bound_id
Add method to set bound_id and emit the signal.

Rename resource_bound_id -> resource_set_bound_id and add
resource_get_bound_id.
2019-12-10 12:19:11 +01:00
Wim Taymans
030d2a075b stream: improve params 2019-12-09 15:22:45 +01:00
Wim Taymans
b5811280ef core-proxy: improve cleanup
Also disconnect filters.
Ignore multiple destroy calls. This can happen when the protocol
destroys the core-proxy and some implementation cleanup code
does the same. The cleanup code can't reliably know about this
cleanup.
2019-12-09 12:30:49 +01:00
Wim Taymans
e27331a25e filter: use spa_node directy
There is not need to make a pw_node first and export that, we ca
directly export the spa_node.
Fix property updates on node and port.
Fix some leaks
2019-12-09 12:28:55 +01:00
Wim Taymans
2070ad37df example: handle connect error 2019-12-09 12:27:01 +01:00
Wim Taymans
181c2de2ee parser: only recurse into CHOICE when 1 value
Only try to collect the CHOICE value when there is only 1 value.
This makes it possible to parse the complete choice as a SPA_Pod.
2019-12-09 12:23:24 +01:00
Wim Taymans
6204c95ee3 remote-node: restore old activation after we unmap the server one 2019-12-06 22:56:35 +01:00
Wim Taymans
cfeb724d58 pulse: don't add listener when connection failed 2019-12-06 22:27:27 +01:00
Wim Taymans
d677aeeeca stream: remove our ref to the stream on destroy 2019-12-06 22:18:01 +01:00
Wim Taymans
9b1c3c211e stream: disconnect the core_proxy when needed 2019-12-06 22:13:01 +01:00
Wim Taymans
a8c3dc6a8a improve properties on stream and filter 2019-12-06 22:12:38 +01:00
Wim Taymans
ed8dadca15 core-proxy: expose more methods 2019-12-06 22:11:05 +01:00
Wim Taymans
c990c73d62 support absolute paths 2019-12-06 17:54:05 +01:00
Wim Taymans
9610a4a573 fix interface call 2019-12-06 17:53:57 +01:00
Wim Taymans
af605cdda2 use opaque types for proxies
This makes it easier to implement the proxies
2019-12-06 17:37:41 +01:00
Wim Taymans
7dc8a33e3e fix unit tests 2019-12-06 17:12:07 +01:00
Wim Taymans
05565b21b1 proxy: improve cleanup
Remove the core_proxy from objects so that it doesn't try to use it
when it's being destroyed.
We need to recheck the core_proxy because it might have been removed
in the destroy signal.
2019-12-06 17:11:03 +01:00
Wim Taymans
7b0b5b77c3 core-proxy: add connect_self 2019-12-06 17:10:21 +01:00
Wim Taymans
ca6f1bd2f1 remote: remove the remote
Mostly rename pw_remote_* to pw_core_proxy_*
2019-12-06 13:40:23 +01:00
Wim Taymans
3d79970d88 remote: remove events and states 2019-12-06 12:03:45 +01:00
Wim Taymans
8a959ea7a1 core_proxy: prepare to rename pw_remote -> pw_core_proxy
The pw_remote object is really a wrapper around the pw_core_proxy.
The events it emits are also available in the core proxy and are
generally awkward to use.

With some clever new pw_core_proxy_* methods and a pw_core_connect
to create the core_proxy, we can convert all code away from pw_remote.

This is a first step in this conversion, using the pw_remote behind
the scenes. It leaks into some places because it really needs to become
its own struct in a next step.
2019-12-06 11:48:40 +01:00
Wim Taymans
f8aabe69fe interfaces: don't define opaque types
Let the types be opaque so that we can make a private implementation
later.
2019-12-06 11:43:38 +01:00
Wim Taymans
1ba5a17236 core: add PW_KEY_CORE_PROFILE_MODULES
Let the core load a set of default modules.
Add a key to control what default set to load, falling back to a
reasonable set. Make the daemon not load any set and rely on the
config script to load modules.
2019-12-05 16:17:42 +01:00
Wim Taymans
6b1e1a82f1 alsa: improve debug 2019-12-05 13:17:43 +01:00
Wim Taymans
c67c73d64d remote: install core_proxy right after connect
Make the core proxy available right after we called connect. This
makes it possible to avoid waiting for the remote state change and
start using the core_proxy right away.
2019-12-05 12:18:17 +01:00
Wim Taymans
d5ea24ae2c proxy/resource: add method to remove 2019-12-05 12:04:45 +01:00
Wim Taymans
ed9d4e5e80 mem: add method to clear pool 2019-12-05 11:50:00 +01:00
Wim Taymans
0b2e4a18ff protocol-native: make the connection earlier
Make the connection as soon as we create the client. We create it
without file descriptor and then set it when we connect. This
makes it possible to use the connection to queue messages before
we connect.
2019-12-05 11:43:05 +01:00
Wim Taymans
8bb1ccf587 protocol-native: emit a core error on disconnect
Let the listeners on the core_proxy know about connection errors.
2019-12-05 11:32:51 +01:00
Wim Taymans
7594eabdc8 remote: pass core_proxy to export function
We want to remove the need for the pw_remote in most cases.
2019-12-05 11:15:04 +01:00
Wim Taymans
dd2fa2caee core: move export function to core.h 2019-12-05 10:54:47 +01:00
Wim Taymans
2474f9ae7d Add some more useful functions 2019-12-05 10:47:20 +01:00
Wim Taymans
b0932e687f pulse: avoid errors with const 2019-12-05 10:35:07 +01:00
Wim Taymans
4314fba7c4 alsa: close fd before destroying the loop 2019-12-04 15:30:30 +01:00
Wim Taymans
279e6706b2 stream: do not call process if the queue is not empty enough 2019-12-03 17:48:44 +02:00
Wim Taymans
125fcb5660 session-manager: remove obsolte _set_id
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.
2019-11-29 13:34:09 +01:00
Wim Taymans
e1ef01c860 alsa-endpoint: move to separate service
Let the session manager monitor device objects as well.

Make the alsa-endpoint monitor a separate service instead of letting
the alsa-monitor call it directly. This means that it listens for
device objects and then tries to configure the endpoints when the
device profile is set to active. This does not work yet because we
can't link the nodes to the device yet because there is no way to know
what the global id is of the device we created.

Make sure implementations of objects run in a separate remote connection
because the main remote connection might block while waiting for a
return value from the implementation.

Trigger an object update after all object info is collected. We do this
by triggering a roundtrip after receiving the info event. When we get
the reply, we can assume all info is flushed. This includes the
parameters that we received.
2019-11-29 13:34:09 +01:00
Wim Taymans
8c06760480 alsa-endpoint: monitor and update node params 2019-11-29 13:34:09 +01:00