Commit graph

359 commits

Author SHA1 Message Date
Wim Taymans
c4b2be2aad use true and false for boolean properties
So that it's easier to convert them to booleans in introspection
code later.
2020-03-03 18:17:46 +01:00
Wim Taymans
b60d7bf2bc examples: always use last buffers
Skip buffers and always use the last buffer in the queue. This
compensates for slow reading clients.
2020-03-03 13:28:21 +01:00
Wim Taymans
2d88970dab examples: use better Buffer values 2020-03-03 11:17:22 +01:00
Wim Taymans
ce275e5917 small cleanups 2020-03-03 10:25:03 +01:00
Wim Taymans
a3ec0cf49e examples: improve some debug 2020-03-02 17:28:10 +01:00
Wim Taymans
9cdcd07c02 example: update example 2020-02-22 13:50:20 +01:00
Wim Taymans
d3634aca7e media-session: rework device reservation
Monitor the device reservation objects and mark the device available.
Don't select nodes from devices that are not available.
Acquire the device reservation when a device starts.
Release the device reservation when we suspend the device again.
2020-02-19 18:15:57 +01:00
Wim Taymans
88c6db8a82 policy-node: give more priority to newer video output nodes
A slight workaround for old firefox that doesn't specify the target
node, nor the media role when doing screen sharing.
2020-02-06 17:42:52 +01:00
Wim Taymans
b4c76ba78a policy-node: only set PortConfig when we find a format 2020-01-28 15:38:35 +01:00
Wim Taymans
d2d1647634 media-session: fix cleanup of objects
Don't free the proxy twice in some cases.
2020-01-28 15:38:11 +01:00
Wim Taymans
6ac9b7b3a7 spa: add spa_aprintf helper
Add a asprintf helper function that handles errors correctly.
Use this in places where we use asprintf to avoid warnings when we
don't check the return value.
2020-01-27 12:19:21 +01:00
Wim Taymans
aee3191bad examples: don't fail when alsa is not found
Avoid building the session-manager when alsa was not found.
2020-01-27 10:46:19 +01:00
Wim Taymans
f792c3f536 fix some segfaults 2020-01-16 16:47:01 +01:00
Wim Taymans
6af00219e1 media-session: avoid some segfaults 2020-01-16 16:19:09 +01:00
Wim Taymans
043e7f24fe add some more useful defines
Add define to match all ids for nodes and params.
Add define for invalid permissions
2020-01-15 11:15:51 +01:00
Wim Taymans
c21c42e943 media-session: pause policy while creating objects
While we are creating objects on the monitor connection, pause the
policy connection until we have completed a roundtrip and the global
id is bound to the new object.

This way, when we resume the policy connection, we can always find the
newly created and bound object. Without the pause, it's possible that
we receive the new global on the policy connection before we got the
bind reply on the monitor connection and then we would end up with 2
proxies that are not linked together correctly.

Fixes #204
2020-01-14 16:38:40 +01:00
Wim Taymans
c624ca7591 alsa-monitor: don't crash when dbus connection failed 2020-01-14 10:53:12 +01:00
Wim Taymans
6c8fd3c29d media-session: instal media session
Install the example media-session
Load the media session according to the PATH
Include the example directory in the PATH so we can run the media
session.
2020-01-13 16:27:46 +01:00
Wim Taymans
b99074879f policy-node: use the daemon samplerate
Use the samplerate of the daemon to configure the nodes.
2020-01-09 15:52:53 +01:00
Wim Taymans
852ac043d3 Use the DSP format for dsp formats
Use the DSP media subtype to describe DSP formats. DSP formats
don't include the rate, channels and channel position in the
format and must use the rate and duration from the position io. This
makes it possible to later change the samplerate dynamically without
having to renegotiate the graph.

The same goes for the video DSP format, which uses the io_video_size
from the io_position to get the size/stride. Set this up in the node
based on the defaults from the context.

Make it possible to define defaults in the daemon config file, such
as samplerate, quantum, video size and framerate. This is stored in
the context and used for the DSP formats.
2020-01-09 15:18:59 +01:00
Wim Taymans
96d4ec3207 use defined key for factory.name 2020-01-09 09:46:04 +01:00
Wim Taymans
2bca786fff policy-node: use priority of the nodes 2020-01-08 17:29:11 +01:00
Wim Taymans
92c26fa124 suspend-node: only suspend devices 2020-01-08 15:16:17 +01:00
Wim Taymans
a3ddc6b744 media-session: add module to suspend nodes 2020-01-08 13:24:06 +01:00
Wim Taymans
ffbb74c4af policy-node: implement video nodes
Always activate video nodes right away
Implement exclusive access again
2020-01-08 10:48:48 +01:00
Wim Taymans
fa98389fef node: copy more properties to the global
Copy media.type and category to global
Set media_class in example
2020-01-08 10:48:00 +01:00
Wim Taymans
b312e77385 Make simple node policy
Make it possible to run the session manager without endpoint
modules. Add a simple node policy that links nodes.

Move the session-manager implementation and startup of the
endpoint monitors to a separate module.

Handle async set_param on the device
2020-01-07 17:19:09 +01:00
Wim Taymans
3b05896cd6 bluez5: cleanups
Use export_device
2020-01-03 13:02:59 +01:00
Wim Taymans
73cc2e054c examples: pause timer in PAUSED 2020-01-03 09:33:20 +01:00
Wim Taymans
df519ee3b3 avoid including private.h
Expose some more methods to make it possible to build without
including the private.h header, especially in modules.
2020-01-02 13:48:50 +01:00
Wim Taymans
437b97f160 media-session: cleanup some objects 2019-12-19 15:31:55 +01:00
Wim Taymans
d3db9d12bc proxy: never free a proxy automatically
Never free a proxy without the application doing a pw_proxy_destroy.

It's hard to use when proxies are freed randomly when the server
removes the ids. You have to add destroy notify to all proxies and
deal with the arbirary order in which proxies can be freed.
Instead notify the client of the remove and let it destroy the
proxies itself in the right order. This is in line with how wayland
handles proxies.

A pw_proxy_destroy() will now send a destroy to the server and mark
the proxy as a zombie, waiting for the remove_id confirmation and
then destroy the proxy.

A server remove_id will mark the proxy as removed and emits the
removed event. The app should then pw_proxy_destroy the proxy
to free it.

Leaks all proxies in the session manager because cleanup now needs
to be handled by the app correctly.
2019-12-19 15:25:21 +01:00
Wim Taymans
f391353c7f Make interface types a string
This is more in line with wayland and it allows us to create new
interfaces in modules without having to add anything to the type
enum. It also removes some lookups to map type_id to readable
name in debug.
2019-12-19 13:36:04 +01:00
Wim Taymans
686a5cf47e media-session: improve shutdown
First emit a remove of all objects. Then signal a session
destroy and then destroy the context.
2019-12-18 12:59:42 +01:00
Wim Taymans
147f488514 media-session: improve cleanup 2019-12-18 12:15:03 +01:00
Wim Taymans
616806bec2 update some docs 2019-12-17 17:55:01 +01:00
Wim Taymans
cc0be0d606 stream: only set portconfig on audio formats 2019-12-17 17:35:46 +01:00
Wim Taymans
59c92bddba policy-ep: allow linking to nodes
When the target node or target endpoint is specified, try to
link to it.
2019-12-17 15:58:43 +01:00
Wim Taymans
05f93cd750 media-session: improve cleanup 2019-12-17 10:47:31 +01:00
Wim Taymans
3c846fbb1d v4l2: add v4l2 endpoints
Monitor and add endpoints for the v4l2 nodes.
2019-12-16 13:39:42 +01:00
Wim Taymans
f06fc5a62b media-session: add sync_update
Add method to only emit the update event when all actions up to
the sync point completed.

Update the available bits on NODES/PORTS/STREAMS/ENDPOINTS
2019-12-16 13:38:16 +01:00
Wim Taymans
c7456d579a alsa-endpoint: fix stream names 2019-12-16 13:35:41 +01:00
Wim Taymans
2242c4bab2 stream-monitor -> stream-endpoint 2019-12-16 11:57:58 +01:00
Wim Taymans
5cfb155827 policy: link endpoints based on direction and media 2019-12-16 11:27:19 +01:00
Wim Taymans
cc139a07bb v4l2-monitor: clean up names 2019-12-16 10:45:29 +01:00
Wim Taymans
1bca1b15ea context: add object store
Add method to set and get typed objects from the context. This can
be used to pass around context objects between modules without having
to register them.
2019-12-16 10:28:18 +01:00
Wim Taymans
7c3d58a909 media-session: remove object when proxy is destroyed 2019-12-13 12:34:14 +01:00
Wim Taymans
828bd30879 handle policy_core destroy 2019-12-13 11:27:23 +01:00
Wim Taymans
1317ca140c pass spa_dict around as config
Don't pass pw_properties around when we simply need to pass around
config info, only use pw_properties when used to construct an object
that keeps the properties.
2019-12-13 11:26:05 +01:00
Wim Taymans
bc0dcd2e34 pw_impl_module_load -> pw_context_load_module 2019-12-11 17:40:32 +01:00