Commit graph

3259 commits

Author SHA1 Message Date
Wim Taymans
817f8fef07 Makefile.in: fix path to pipewire daemon 2020-01-08 17:02:52 +01:00
Wim Taymans
e29969f937 Use build_root to generate Makefile
Don't hardcode the buildroot but use the value from meson.

Based on patch by Jan Koester <jan.koester@gmx.net>

Fixes #202
2020-01-08 15:41:01 +01:00
Jan Koester
dfdd664160 mainloop: add SPA_EXPORT to pa_mainloop_api_once
Fixes #200
2020-01-08 15:29:37 +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
9ffa9c0b08 v4l2: handle suspend 2020-01-08 13:23:35 +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
8f3b2b9543 bluez5: implement sync, profile and enum_profile 2020-01-03 13:01:54 +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
8e6a5a1714 v4l2: print pixelformat as string
The pixelformats are actual 4 letter sequences. Print the letters
instead of the hex value to make the output more readable.
2019-12-19 15:43:13 +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
94ffe88b65 filter: return error if id cannot be dereferenced
If an ID cannot be de-referenced, e.g., because the builder buffer is
too small, spa_pod_filter() still reports success, but the result is
NULL. Any subsequent access to result will cause a segfault.

Return an error if no pod is found to properly propagate and handle the
error.

The segfault can be reproduced by using the v4l2 module with Vivid
devices [0], because the buffer for the v4l2 controls is too small.

[0] https://github.com/PipeWire/pipewire/issues/138
2019-12-19 15:43:04 +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
9657486a81 alsa-seq: update duration when slaved as well 2019-12-18 13:27:29 +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
24ab22db12 audioadapter: avoid infinite loop
Rewrite the slave/converter loop a little to avoid infinite loops.
2019-12-18 12:58: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
58a7e18ed5 audioadapter: set data flags 2019-12-17 15:08:39 +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
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
6cf6af6620 array: add multistatement macro in parenthesis 2019-12-16 10:12:50 +01:00
Philippe Normand
0d87b32f0e pw-uninstalled: Don't override environment variables
LD_LIBRARY_PATH and GST_PLUGIN_PATH might be set already in the parent shell.
2019-12-15 14:51:15 +00:00