webrtcbin: not emitting on-negotiation-needed when set to playing, pipeline halts (1.14.4)
I'm working on a pipeline that will eventually take a UDP/RTP source and output into an HLS sink and a webrtc sink. For now, I am testing with a videotestsrc. This pipeline is based off the centricular examples. When a client signals to initiate a WebRTC connection, a new webrtcbin element is added to a tee element, and its state is set to match the entire pipeline.
Occasionally, when a client signals to initiate a connection, I see no SDP offer made by the pipeline. Inspecting the logs shows the webrtcbin setting to PLAYING (to match the parent) but no "on-negotation-needed" signal is emitted. At the same time, the HLS sink also stops producing .ts segments.
I still haven't found a reliable way to reproduce this, but turning on more verbose logging seems to make it happen more frequently, making me think there is some race condition.
Debug logs when connection is made and video displays:
0:00:28.217246380 20401 0x562953800d30 DEBUG webrtcbin gstwebrtcbin.c:216:gst_webrtc_bin_pad_new:<'':sink_0> new visible pad with direction sink
0:00:28.218300727 20401 0x562953800d30 DEBUG webrtcbin gstwebrtcbin.c:3731:gst_webrtc_bin_change_state: changing state: NULL => READY
0:00:28.220457754 20401 0x562953800d30 DEBUG webrtcbin gstwebrtcbin.c:3731:gst_webrtc_bin_change_state: changing state: READY => PAUSED
0:00:28.220824519 20401 0x562953800d30 DEBUG webrtcbin gstwebrtcbin.c:3731:gst_webrtc_bin_change_state: changing state: PAUSED => PLAYING
0:00:28.224727744 20401 0x562953800d30 DEBUG webrtcbin gstwebrtcbin.c:3731:gst_webrtc_bin_change_state: changing state: PLAYING => PLAYING
0:00:28.320867499 20401 0x562953d6c540 INFO webrtcbin gstwebrtcbin.c:2202:_create_sdp_task:<webrtcbin_100> creating offer sdp with options (NULL)
0:00:28.322086844 20401 0x562953d6c540 DEBUG webrtcbin gstwebrtcbin.c:1691:sdp_media_from_transceiver:<webrtcbin_100> Adding 0-th caps application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, packetization-mode=(string)1, sprop-parameter-sets=(string)"Z0LAINkAUAW7AWoCAgKAAAH0gADqYEeMGSQ\=\,aMuMsg\=\=", payload=(int)96, seqnum-offset=(uint)7036, timestamp-offset=(uint)2899585439, ssrc=(uint)1295048211, a-framerate=(string)59.940059940059939, rtcp-fb-nack-pli=(boolean)true to 0-th media
Sending offer:
v=0
o=- 509666236988773271 0 IN IP4 0.0.0.0
...
Debug logs when error above happens:
0:00:50.234836437 20401 0x562953800d30 DEBUG webrtcbin gstwebrtcbin.c:216:gst_webrtc_bin_pad_new:<'':sink_0> new visible pad with direction sink
0:00:50.235433167 20401 0x562953800d30 DEBUG webrtcbin gstwebrtcbin.c:3731:gst_webrtc_bin_change_state: changing state: NULL => READY
0:00:50.235758065 20401 0x562953800d30 DEBUG webrtcbin gstwebrtcbin.c:3731:gst_webrtc_bin_change_state: changing state: READY => PAUSED
0:00:50.236223956 20401 0x562953800d30 DEBUG webrtcbin gstwebrtcbin.c:3731:gst_webrtc_bin_change_state: changing state: PAUSED => PLAYING
0:00:50.237710978 20401 0x562953800d30 DEBUG webrtcbin gstwebrtcbin.c:3731:gst_webrtc_bin_change_state: changing state: PLAYING => PLAYING
<end of logging>