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.
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")
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.
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.
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.
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.
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.
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.
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.
Make things work then there is no default input device and the default
source is actually the monitor of the default sink.
Also implement lookups of monitor sources with the monitor id as the
name.
Fixes#1691
pause_node() will check the IDLE state of the node and will not
deactivate the node when suspending when it was already IDLE.
Fixes an issue where node.pause-on-idle=false filters would not want to
resume after a suspend.
If we try to fetch a property as some specific type and the parsing
fails, log a warning. This should catch any client bugs where the
properties are set wrongly.