mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-03 09:01:54 -05:00
gst: reset negotiated state before connect
Right before connecting, set ourselves to not negotiated. First look for errors, then the negotiated state. Handle NULL caps after negotiation.
This commit is contained in:
parent
47a6360112
commit
799fe7f90c
1 changed files with 7 additions and 3 deletions
|
|
@ -683,6 +683,7 @@ gst_pipewire_src_negotiate (GstBaseSrc * basesrc)
|
|||
}
|
||||
|
||||
GST_DEBUG_OBJECT (basesrc, "connect capture with path %s", pwsrc->path);
|
||||
pwsrc->negotiated = FALSE;
|
||||
pw_stream_connect (pwsrc->stream,
|
||||
PW_DIRECTION_INPUT,
|
||||
pwsrc->path ? (uint32_t)atoi(pwsrc->path) : PW_ID_ANY,
|
||||
|
|
@ -695,18 +696,21 @@ gst_pipewire_src_negotiate (GstBaseSrc * basesrc)
|
|||
enum pw_stream_state state = pw_stream_get_state (pwsrc->stream, &error);
|
||||
|
||||
GST_DEBUG_OBJECT (basesrc, "waiting for NEGOTIATED, now %s", pw_stream_state_as_string (state));
|
||||
if (pwsrc->negotiated)
|
||||
break;
|
||||
|
||||
if (state == PW_STREAM_STATE_ERROR)
|
||||
goto connect_error;
|
||||
|
||||
if (pwsrc->negotiated)
|
||||
break;
|
||||
|
||||
pw_thread_loop_wait (pwsrc->core->loop);
|
||||
}
|
||||
caps = pwsrc->caps;
|
||||
pwsrc->caps = NULL;
|
||||
pw_thread_loop_unlock (pwsrc->core->loop);
|
||||
|
||||
if (caps == NULL)
|
||||
goto no_caps;
|
||||
|
||||
gst_pipewire_clock_reset (GST_PIPEWIRE_CLOCK (pwsrc->clock), 0);
|
||||
|
||||
GST_DEBUG_OBJECT (pwsrc, "set format %" GST_PTR_FORMAT, caps);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue