Webrtcbin SDP Renegotation (1.18): Not in the correct state (stable) for setting remote answer description

Matthew Waters ystreet00 at gmail.com
Fri Dec 4 20:14:24 UTC 2020



On 5/12/20 7:02 am, Trey Hutcheson wrote:
> I know SDP renegotiation is something that saw lots of improvements 
> from 1.16->1.18, but I'm currently stuck.
>
> Here's my workflow:
> * create webrtcbin instance for peer 1. Initialize with one audio 
> source. Create offer (sdp contains one audio m= line), 
> set-local-description, send to remote peer. Remote peer responds with 
> answer, then set-remote-description.
> * Create another webrtcbin instance for peer 2. Same workflow. 
> Exchange sdp, with webrtcbin generating the offer.
> * Media (audio) flows from remote peer 2. Dynamically connect audio 
> (opus, opusdepay then opuspay  to re-payload the rtp) from webrtcbin2 
> to webrtcbin1.
> * Ask webrtcbin1 to create a new offer, then set-local-description. 
> Offer now has two audio m= lines. Send offer to remote peer, peer 
> responds with new answer (with two m= lines). set-remote-description 
> on webrtcbin1
>
> When I call set-remote-description with the updated answer, webrtcbin 
> complains:
>
> ERROR              webrtcbin 
> gstwebrtcbin.c:4320:_set_description_task:<webrtcbin> Not in the 
> correct state (stable) for setting remote answer description
>
> And that's because sdp was previously negotiated, and the signalling 
> state had achieved stable. But I want to re-negotiate, and I assumed 
> invoking create-offer a second time (after connecting a new sink pad 
> and verifying caps) would change the signalling state?
>

If you have completed a full SDP negotiation, then the state of 
webrtcbin will be 'stable'.  This specific line: 'Not in the correct 
state (stable) for setting remote answer description' probably means 
that you didn't actually 'set-local-description' on this webrtcbin 
instance (or you're confusing which webrtcbin instance you're calling 
against).

Calling 'create-offer' does not change any of the state properties. They 
are only changed with the 'set-*-description' calls as specified in the 
JSEP specification.

Cheers
-Matt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 495 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20201205/ed3d6af8/attachment.sig>


More information about the gstreamer-devel mailing list