<div dir="ltr">I am observing some unexpected behavior regarding datachannels and webrtcbin; this is gstreamer 1.18.2.<div><br></div><div>Scenario 1:</div><div>* 1 peer (webrtcbin) is initialized and a data channel is created, but no media (audio/video) is linked as an input. Webrtcbin can successfully create an offer, and I can successfully negotiate sdp with a remote peer (chrome). The data channel is opened, and I can send data to the browser.</div><div><br></div><div>*However*, if I later attach any media whatsoever and then try to create a new offer from the first peer, it dies horribly. The entire process crashes with the following messages:</div><div><br></div><div>0:00:14.748822643 2066528 0x7fffb00116a0 INFO               webrtcbin gstwebrtcbin.c:3322:_create_sdp_task:<webrtcbin_ep1> creating offer sdp with options (NULL)<br>**<br>ERROR:../gst-plugins-bad/ext/webrtc/gstwebrtcbin.c:2304:sdp_media_from_transceiver: assertion failed: (trans->mline == -1 || trans->mline == media_idx)<br>Bail out! ERROR:../gst-plugins-bad/ext/webrtc/gstwebrtcbin.c:2304:sdp_media_from_transceiver: assertion failed: (trans->mline == -1 || trans->mline == media_idx)<br></div><div><br></div><div>So what I'm saying is this - if I create a data channel *first* and negotiate a stable signalling state, I can not then later add actual media and re-negotiate. </div><div><br></div><div>* Scenario 2:</div><div>I tried to reproduce this behavior in a separate repo with two separate gstreamer pipelines using webrtcbin (instead of a browser as the remote peer). In this case, I can create an offer from the first peer that only defines a data channel, and the second peer will respond with an answer, and both sides each swap ice candidates, but they never actually connect. But again, if I attach any input media first, then things connect and work just fine.</div><div><br></div><div>I'm still investigating to make sure I can add data channels *after* a successful initial negotiation with media and continue to renegotiate. </div></div>