Commit graph

7656 commits

Author SHA1 Message Date
Peter Hutterer
a1908e7d9d po: update the potfile paths 2021-10-20 09:59:32 +10:00
Barnabás Pőcze
c24e78ccc9 meson.build: fix MEDIA_SESSION_CONFIG_DIR in devenv
Since the project has been moved to a different repository,
the directory layout has changed. Adapt the meson devenv accordingly.
2021-10-19 17:36:09 +02:00
Peter Hutterer
da0b9c2aef Replace PIPEWIRE_CONFIG_DIR with MEDIA_SESSION_CONFIG_DIR in the config files 2021-10-19 14:47:37 +10:00
Peter Hutterer
ef8f1f3777 Don't install the with-jack/with-pulseaudio files twice
Already part of the config files a few lines north of here.
2021-10-19 14:44:31 +10:00
Peter Hutterer
752d7ba37f meson: drop the dbus option, it's not optional
See b4aaaeac4c
2021-10-19 14:41:50 +10:00
Peter Hutterer
3378df04cd Remove the template file for installed tests
See b852b58f82 for the history, we can
bring this back when we have tests.
2021-10-19 14:29:01 +10:00
Peter Hutterer
8e3ec51a8f Drop the Cirrus CI file
Cirrus is used on upstream pipewire for a BSD run, please submit a new
file for media-session if need be.
2021-10-19 14:29:01 +10:00
Peter Hutterer
092927269f meson.build: drop the headers check
Of the checked headers, we either don't use them or we don't guard them.
So let's drop the checks and re-instated them when we have a need for
those.
2021-10-19 14:29:01 +10:00
Peter Hutterer
a223fe8df9 Drop the unnecessary pwd.h include
Obsolete in media session as of fc90a4e48a
2021-10-19 14:29:01 +10:00
Peter Hutterer
5443e24bc9 meson.build: clean up pipewire things we no longer need here
- No C++ compiler needed for this repo
- No Makefile, so we can drop that config
- No epoll needed here (at least not explicitly)
- None of the HAVE_FOO are actually in use
2021-10-19 14:29:01 +10:00
Peter Hutterer
fe2ed1af89 ci: fix the reserve.c sync job
Bash || and && precedence is not what I expected
2021-10-19 14:22:31 +10:00
Peter Hutterer
a54e2e4cfb alsa-monitor: include the reserve.h header, not the source file
See matching pipewire commit b78371f7023536ae4810c483a283fc3c2261705c
2021-10-19 14:15:52 +10:00
Peter Hutterer
090b39541e Drop the duplicated src/media-session.d dir
Anther rebase fail, changing this upstream while trying to rebase this
directory left us with two copies.
2021-10-19 11:14:30 +10:00
Peter Hutterer
c374e0ea91 meson.build: fix project name to media-session
Only our binary itself is still called pipewire-media-session, the rest
(including the git repo) just uses media-session.
2021-10-18 21:01:11 +10:00
Peter Hutterer
49fdfea420 ci: add a job to check reserve.{c|h} from PipeWire
This file is used by the Media Session plugin and by the pw-reserve
tool. Add a job here so where our file differs from the PipeWire one, we
get a warning in the CI.
2021-10-18 10:54:31 +00:00
Peter Hutterer
7502e044c3 Revert "Restore the pw-reserve tool"
This tool will stay in PipeWire which now has a copy of the reserve.c|h
file as well. Ideally those files are kept in sync.

This reverts commit 621f27a98b.
2021-10-18 10:54:31 +00:00
Peter Hutterer
1ca8988a63 media-session: use the SESSION_PREFIX for any fallback config dir
Regression introduced in 3560f3ba2d

MEDIA_SESSION_CONFIG_PATH expects the actual directory while
PIPEWIRE_CONFIG_PATH and the built-in fallback both expect the files to
reside within the SESSION_PREFIX subdirectory.

Fixes #1725

(cherry picked from commit dfb63d55dddabb6cc211880fca3974d9c2c297ba)
2021-10-18 20:42:06 +10:00
Peter Hutterer
275f9b94b0 media-session: fix config load path
config_dir is the new MEDIA_SESSION_CONFIG_DIR environment variable (if
set), impl.config_dir is that or the fallback, whichever applies.

Fixes 00bd3b5b59
Fixes #1725

(cherry picked from commit 56f01a293c7cd12858b83247282eb419effb77e7)
2021-10-18 20:42:06 +10:00
Peter Hutterer
7d73dbc07b Drop another leftover meson.build file 2021-10-18 05:44:17 +00:00
Peter Hutterer
e7462e61c1 Remove leftover v4l2 code
Rebasing error, this code was added in pipewire while the media session
patches were being rebased against it.
2021-10-18 05:44:17 +00:00
Peter Hutterer
71f6e9af54 ci: add a spellchecker for Media Session 2021-10-18 09:46:01 +10:00
Peter Hutterer
f95e6a15ee ci: fix the spellcheck job 2021-10-18 09:46:01 +10:00
Peter Hutterer
88c8aa34d0 Merge branch 'wip/standalone-media-session' into 'master'
Make media-session its own standalone package

See merge request pipewire/media-session!1
2021-10-15 02:11:34 +00:00
Peter Hutterer
621f27a98b Restore the pw-reserve tool
This tool relies on media-session's reserve.c implementation, so let's
ship it here.
2021-10-15 11:09:43 +10:00
Peter Hutterer
b4aaaeac4c meson: require DBus
This looked like it was optional but the media-session code doesn't
treat it as such, more work is needed here.

Meanwhile, make it unconditional until that bug is fixed.
2021-10-15 11:09:43 +10:00
Peter Hutterer
d2880ed23a Update auxiliary files 2021-10-15 11:09:43 +10:00
Peter Hutterer
9df68b0dd8 Make media-session its own standalone package
This removes the rest of pipewire from the tree, but keeps the git repo.
The package name is now just 'media-session' but the binary remains
pipewire-media-session for backwards compatibility.

No functional changes besides the removal but a few renames for
variables from PIPEWIRE_FOO to MEDIA_SESSION_FOO (and its lowercase
version).

In docs/ folder, the media-session.dox moved to be the new mainpage
index.dox and all other dox files are removed.

pw-uninstalled.sh becomes media-session-uninstalled.

Finally, the hierarchy was flattened, so
- src/media-session/* goes into src/
- src/daemon/systemd goes into systemd/
- src/media-session/media-session.d goes into media-session.d
2021-10-15 11:09:43 +10:00
Peter Hutterer
00bd3b5b59 media-session: store the config dir path in our object
The media session modules need to load config files through
sm_media_session_load_conf() and that must be the same config dir as our
main configuration file's directory.
2021-10-15 10:53:32 +10:00
Barnabás Pőcze
5cfdc2620c meson.build: set MEDIA_SESSION_CONFIG_DIR in devenv
Commit 6c156cdbb4 made pw-uninstalled.sh
export the MEDIA_SESSION_CONFIG_DIR environmental variable, its value
being the location of the media-session configuration files in the
build directory.

Export this environtmental variable in the meson devenv as well.

Fixes: 6c156cdbb4 ("media-session: move the media-session config files to here")
2021-10-14 21:54:37 +02:00
Michael Olbrich
d2ce51d504 stream: decrement busy counter when releasing dequeued buffers
For buffers on the 'dequeued' list, the busy counter was already
incremented in impl_node_process_input(). So it must be decremented again
when these buffers are removed.
2021-10-14 19:16:56 +00:00
Michael Olbrich
314ff82ff0 pipewiresrc: fix handling outstanding buffers when stopping
The current code has several issues if a pipewiresrc is stopped and deleted
while a buffer is still in use downstream.

 - pw_stream_queue_buffer() is never called for the corresponding
   pw_buffer. As a result, the busy counter is never decremented and
   pw_stream_dequeue_buffer() of the corresponding pipewire output will
   return NULL whenever it encounters this buffer.

 - The pipewiresrc does not own the buffer reference unless the buffer is
   queued in the source, so calling gst_buffer_unref() unconditionally
   causes refcount issues for the buffer.

 - buffer_recycle() can race with on_remove_buffer() and
   gst_pipewire_src_close(). As a result, buffer_recycle() may access pwsrc
   when it was already deleted.

The buffer has its own reference to the pool. So the pool object lock can
be used to ensure that the pwsrc, core and stream remain valid in.
buffer_recycle(). If the 'dispose' function pointer was already cleared,
then on_remove_buffer() has already finished, so abort early.

With the pool lock held, it is save to access the pipewire loop. Now the
loop lock can be used to synchronize with on_remove_buffer(). 'dispose'
must be checked again in case on_remove_buffer() was triggered by something
other than gst_pipewire_src_close().

In on_remove_buffer() unref the buffer if it is queued. Otherwise call
pw_stream_queue_buffer() to ensure that the busy counter is decremented
correctly.
2021-10-14 19:16:56 +00:00
Michael Olbrich
744a8aaeb7 gst: init last_error
Otherwise, it may be used uninitalized.
2021-10-14 19:16:56 +00:00
Wim Taymans
d4207d3b0c pw-v4l2: fix script as suggested by shellcheck 2021-10-14 21:14:45 +02:00
columbarius
07d0b14955 spa: specify SPA_FORMAT_VIDEO_MODIFIER as DMA-BUF only
SPA_FORMAT_VIDEO_MODIFIER is only valid with DMA-BUF transport.
For using other types of buffers omit this property.
2021-10-14 20:19:21 +02:00
Wim Taymans
1f5396fedb stream: don't change to the error state on proxy errors
The proxy errors are really from the session manager informing us about
decisions it made (failure to link, etc). The state of the stream is not
really affected by this so just emit the error signal and let the app
decide what to do.
2021-10-14 16:00:40 +02:00
Wim Taymans
8c346ab3a7 pulse-server: list NETWORK flag on devices
Mark network sinks and sources with node.network.
2021-10-14 13:45:58 +02:00
Wim Taymans
d6c1479ba0 module-zeroconf-discover: also parse the channel_map
So that we create the device with the same channel_map as the remote
end.

Fixes #1692
2021-10-14 13:28:43 +02:00
Wim Taymans
257bbb1fd5 echo-cancel: flush streams in PAUSED
so that we don't end up with old data when we resume.

Fixes #1660
2021-10-14 12:18:37 +02:00
Wim Taymans
12567ea5d8 pipewire-v4l2: add enum_framesize ioctl 2021-10-14 10:16:35 +02:00
Wim Taymans
3ee852b808 pipewire-v4l2: More improvements
Keep separate map for fd to files so we can implement dup.

Filter out duplicates in enumfmt.

tryfmt should return the closest match.

Use pthread_once to init the global state.

Make things mostly work in GStreamer.
2021-10-14 10:16:35 +02:00
Wim Taymans
8175c8276d pipewire-v4l2: more improvements
Add support for more formats.
Connect in the reqbufs ioctl so that we can negotiate the right amount
of buffers.
Keep file and buffer maps so that we can map an address to a file and
then the address to a buffer of that file. We can then also check if the
buffers were unmapped properly.
Implement some more ioctls.
Add some more checks.
2021-10-14 10:16:35 +02:00
Wim Taymans
b466fe67dd pipewire-v4l2: Implement more ioctls
Collect all video/source nodes and enumerate their formats. We use this
to return the supported formats and to check if a format is supported.

Use evenfd as the even we return from open. Make the eventfd readable
when we have a new buffer ready.

Connect a stream when setting a format. Collect buffers. Implement
mmap/munmap on the buffer memory. Implement queue and dequeue of buffers.

This is enough to make the webcam test work in firefox.
2021-10-14 10:16:35 +02:00
Wim Taymans
e68fd36f90 pipewire-v4l2: the start of a v4l2 LD_PRELOAD library 2021-10-14 10:16:35 +02:00
Wim Taymans
57b3fe537e v4l2: handle discrete and stepwize frame size enumeration 2021-10-14 10:15:34 +02:00
Wim Taymans
30f8219afd stream: improve some debug 2021-10-14 10:02:13 +02:00
Peter Hutterer
40eb9578d5 media-session: make a few debug messages easier to understand
Especially with PIPEWIRE_LOG_LINE=false, those messages are too
confusing otherwise.
2021-10-14 07:51:27 +00:00
Peter Hutterer
6c156cdbb4 media-session: move the media-session config files to here 2021-10-14 07:51:27 +00:00
Peter Hutterer
3560f3ba2d media-session: add MEDIA_SESSION_CONFIG_DIR as lookup location
Use this to override the default $PIPEWIRE_CONFIG_DIR/media-session.d
directory. This allows us to have separate configuration directories for
pipewire and media-session.
2021-10-14 07:51:27 +00:00
Peter Hutterer
4bfe8fb319 Remove empty PROTOCOL file
Having a file like this that is empty is just teasing.
2021-10-14 09:44:26 +10:00
Peter Hutterer
d812f32d18 Remove leftover github pages configuration
We don't seem to produce github pages, no need for a config file.
2021-10-14 09:17:26 +10:00