<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Garamond;
panose-1:2 2 4 4 3 3 1 1 8 3;}
@font-face
{font-family:"Times New Roman \(Body CS\)";
panose-1:2 11 6 4 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Garamond",serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-family:"Garamond",serif">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Garamond",serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Garamond",serif">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Garamond",serif">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?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Garamond",serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Garamond",serif">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Garamond",serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Garamond",serif">I’m using gstreamer 1.16.0 on OSX. I’m also using the java bindings via gst1-java-core 1.1.0.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Garamond",serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Garamond",serif">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Garamond",serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Garamond",serif">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 *<b>:4,</b>*webrtc*:7 and saw no errors, nor any informative warnings. I can share a log file of the failure if you’d like.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Garamond",serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Garamond",serif">Question: How can I know after set-remote-description when I can call (emit) create-answer?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Garamond",serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Garamond",serif">This problem also seems to afflict on-negotiation-needed and create-offer, but not as clearly as with set-remote-description and create-answer.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Garamond",serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Garamond",serif">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Garamond",serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Garamond",serif">Stuart<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Garamond",serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Garamond",serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Garamond",serif"><o:p> </o:p></span></p>
</div>
</body>
</html>