Commit graph

3628 commits

Author SHA1 Message Date
Wim Taymans
4e8d85da2f Fix some unit test
Run abi checks only on x86_64 until we have sizes for more archs
Don't start a daemon in the tests because that would require
XDG_RUNTIME_DIR set
2020-01-15 13:23:49 +01:00
Wim Taymans
1cedfade3a protocol: improve old version check
Check if the pod size is > 4 because the unit test adds one fd
in the first message.
2020-01-15 12:24:11 +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
cf53ededd0 connection: improve old version check
Check the type of the pod in the message instead. Old versions
should not have 0 there, new versions keep the number of file
descriptors, which should be 0 for the first message.
2020-01-15 10:29:58 +01:00
Wim Taymans
a5b3538053 impl-core: handle NULL resources 2020-01-14 18:07:56 +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
0ea8a92ea5 core: implement pw_core_set_paused
Make it possible to pause emision of events from the core object.
This is interesting if we need to wait for completion of some operations
on another connection before resuming processing.

See #204
2020-01-14 16:37:01 +01:00
Wim Taymans
6ed219c48c core: add some defines 2020-01-14 11:07:45 +01:00
Wim Taymans
c624ca7591 alsa-monitor: don't crash when dbus connection failed 2020-01-14 10:53:12 +01:00
Wim Taymans
3d8c8b4a85 client: don't update client permissions with defaults
Make the default permissions only apply to other objects than the
client. Otherwise when hiding all objects, we would also hide the
client and be disconnected.
2020-01-14 10:00:54 +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
f42ca8b52e stream: emit io_changed event 2020-01-09 13:27:43 +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
7c615f4e64 stream: only set media.class when not set before 2020-01-08 15:16:32 +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
b0705a89b0 filter: handle NULL param 2020-01-08 13:22:23 +01:00
Wim Taymans
aa36a72427 main: handle execv failure
Log an error, exit daemon
2020-01-08 12:38:46 +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
bdc82bb94b typemap: add more video types 2020-01-03 09:33: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
Michael Tretter
eea3bc22b7 gst: do not send UNKNOWN format
If the video format cannot be detected, GStreamer will return the
UNKNOWN format, which is translated into the Id 0 in the
Spa:Interface:TypeMap, which is added to the pod.

When the pipewire server receives the pod and tries to unmarshal the
pod, it will detect the Id 0. Unable to distinguish Id 0 from a missing
id, the server discards the message as invalid and closes the
connection.

Use the following gstreamer pipeline to reproduce (note the wrong nv12
instead of a correct NV12 format):

	gst-launch-1.0 pipewiresrc ! video/x-raw,format=nv12 ! fakesink
2019-12-19 15:43:10 +01:00
Michael Tretter
5fa7630934 gst: fix NULL pointer when listing devices
The gstdeviceprovider segfaults when listing the available devices,
because it the pointer to GList * is initialized with NULL instead of
the GList * itself. Don't use a pointer, but use the GList * directly.
2019-12-19 15:43:00 +01:00
Michael Tretter
dfa8011ed4 gst: fix log level of GStreamer debug messages
Messages that are printed for every buffer should use the LOG debug
level, while messages that happen during setup and tear down should use
the DEBUG debug level.

Therefore, use LOG in on_process and when popping buffers and DEBUG when
Pipewire adds or removes buffers.
2019-12-19 15:42:55 +01:00
Michael Tretter
d5b1ab9db4 gst: replace tabs with spaces
In general, the GStreamer elements use spaces for indentation. Replace
the tabs by spaces.
2019-12-19 15:42:42 +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
2a4c57798d client-node0: remap target node property 2019-12-17 17:55:15 +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
e9b62c0ce6 v0: set media class
Set the media class on the client-node after we know the number of
ports.
Add more type mappings
Fix change_mask on core_info
2019-12-17 17:34:10 +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
d67d012362 audioadapter: loop until we have data
Keep caling the slave processing function until we have data from
the converter or until no process can be made.
2019-12-17 15:11:31 +01:00
Wim Taymans
096db6d87d link: set the object id correctly
Before using the param from EnumFormat as a format param, set the
object ID to PARAM_Format to avoid confusion later on. Clients might
use the object id to enumerate parameters and then fail to enumerate
the current Format because the id is wrong.
2019-12-17 11:35:28 +01:00
Wim Taymans
d3f4dda51b client-node: improve debug 2019-12-17 11:35:04 +01:00
Wim Taymans
05f93cd750 media-session: improve cleanup 2019-12-17 10:47:31 +01:00
Wim Taymans
98c81fff93 proxy: only call destroy once
Make sure only emit destroy once by making the proxy a zombie
from the first call to destroy. Also make sure we don't call destroy
twice without remove.
2019-12-17 10:44:22 +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