gstpipewiresrc: Add a wait_negotiated() call to create()

Add a wait_negotiated() call to gst_pipewire_src_create(). This works
around a race-condition that we experience where the function is
called after the state is transitioning to paused, and after a
SPA_PARAM_Format with a NULL parameter has been passed. That event
is handled in the pipewire source by setting its negotiated flag to
False, which results in gst_pipewire_src_create() returning
GST_FLOW_NOT_NEGOTIATED, resulting in a failed stream attempt.

With this change, the stream survives the state change.

Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
This commit is contained in:
Daniel Scally 2026-06-23 13:06:50 +01:00 committed by Wim Taymans
parent 8d93b779cd
commit 551eb0a473

View file

@ -1574,8 +1574,10 @@ gst_pipewire_src_create (GstPushSrc * psrc, GstBuffer ** buffer)
pwsrc = GST_PIPEWIRE_SRC (psrc);
pw_thread_loop_lock (pwsrc->stream->core->loop);
if (!pwsrc->negotiated)
goto not_negotiated;
if (!pwsrc->negotiated) {
if (wait_negotiated(pwsrc) == PW_STREAM_STATE_ERROR)
goto not_negotiated;
}
while (TRUE) {
enum pw_stream_state state;