WebRTC, create-answer doesn't work too soon after set-remote-description

Stuart Marshall stuart at seelye.net
Wed Oct 23 00:01:15 UTC 2019


Hi, with webrtcbin it appears that if one attempts to create-answer immediately after set-remote-description, that the promise is often not called back with the answer.

From looking at the logs I can see the webrtcbin create_answer_task run and it even appears to reply to the promise. However, I never see the promise return to my code.
It also appears that the create_answer_task starts while gstreamer is creating a bunch of elements in response to set-remote-description. My inference is that gstreamer needs to process the offer and set up those elements before it can correctly create an answer. Is this the case?

I am able to get the answer created if my code waits a bit (e.g. 200ms) between the set-remote-description and the create-answer. The answer is returned and sent back to the client, ice negotiation happens, media flows, etc.

I’m using gstreamer 1.16.0 on OSX. I’m also using the java bindings via gst1-java-core 1.1.0.

The java bindings interrupt the promise passed into the set-remote-description call (signal emission) indicating that a callback isn’t needed. I tried replacing this logic and passing in an actual (non-interrupted) promise to set-remote-description to get notified when it is complete, and then do create-answer. However, that didn’t seem to work – the answer still wasn’t returned. Perhaps the completion promise is called back before gstreamer has actually fully processed the offer.

My code that encountered these problems is running in a unit test that creates one pipeline for the client (sending) side of a webrtc session and another pipeine for the peer (receiver) side of a webrtc session. Both pipelines are running in the same process on the same machine. I cranked up logging to *:4,*webrtc*:7 and saw no errors, nor any informative warnings. I can share a log file of the failure if you’d like.

Question: How can I know after set-remote-description when I can call (emit) create-answer?

This problem also seems to afflict on-negotiation-needed and create-offer, but not as clearly as with set-remote-description and create-answer.

Thanks,

Stuart



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20191023/9f3b6719/attachment-0001.html>


More information about the gstreamer-devel mailing list