<div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Using the java API of gstreamer, I'm trying to create a 1:N audio group. All participants connects with browser using WebRTC.</div><div><br></div><div>The first step, that <b>is working ok</b>, is when the presenter joins the conference. When it joins, the following pipeline is created (equivalent java code):</div><div style="margin-left:40px"><br></div><div style="margin-left:40px"><span style="font-family:monospace">audiotestsrc wave=ticks ! queue ! opusenc ! rtpopuspay ! queue ! capsfilter caps=application/x-rtp,media=audio,encoding-name=OPUS,payload=96 ! webrtcbin name=presenter<br></span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace"><span style="font-family:arial,sans-serif">in this way, the presenter receives an offer and webrtc protocol establish the connection. When the audio pad from presenter is ready, PAD_ADDED callback is called, ant the following pipe is added:</span></span></div><div><span style="font-family:monospace"><span style="font-family:arial,sans-serif"><br></span></span></div><div><span style="font-family:monospace">(... webrtcbin) ! rtpopusdepay ! opusdec ! tee name=audioTee ! audioconvert ! wavenc ! filesink location=/tmp/cd.wav</span></div><div><span style="font-family:monospace"><span style="font-family:arial,sans-serif"><br></span></span></div><div><span style="font-family:monospace"><span style="font-family:arial,sans-serif">In this way, a "tee" element is inserted and the presenter voice is recorded in file "cd.wav".<br></span></span></div><div><span style="font-family:monospace"><span style="font-family:arial,sans-serif"><br></span></span></div><div><span style="font-family:monospace"><span style="font-family:arial,sans-serif">Till this point, everything seems ok.</span></span></div><div><span style="font-family:monospace"><span style="font-family:arial,sans-serif"><br></span></span></div><div><span style="font-family:monospace"><span style="font-family:arial,sans-serif"><br></span></span></div><div><span style="font-family:monospace"><span style="font-family:arial,sans-serif"><br></span></span></div><div><span style="font-family:monospace"><span style="font-family:arial,sans-serif">Now, and THIS IS THE PROBLEM, when an assistant joins the conference, the following java code is executed, with the objective of add "(... tee) ! queue ! opusenc ! rtpopuspay ! capsfilter caps=application/x-rtp,media=audio,encoding-name=OPUS,payload=96 ! webrtcbin name=assistant1" :</span></span></div><div><span style="font-family:monospace"><span style="font-family:arial,sans-serif"><br></span></span></div><div style="margin-left:40px"><span style="font-family:monospace">String branchDesc = "queue ! opusenc ! rtpopuspay ! capsfilter caps=application/x-rtp,media=audio,encoding-name=OPUS,payload=96";<br>Bin branch = Gst.parseBinFromDescription(branchDesc, true);<br><br>pipeline.addMany( branch, webRTCBin ); <br><br>branch.link( this.webRTCBin );<br>                        pipeline.getElementByName( "audioTee" ).link( branch ); <br></span>                       <span style="font-family:monospace"><br>                  bindWebRtcBin(); # this method binds callbacks "ON_NEGOTIATION_NEED", "ON_ICE_CANDIDATE", "PAD_ADDED"</span></div><div style="margin-left:40px"><span style="font-family:monospace"><br></span>                   </div><div><div style="margin-left:40px"><span style="font-family:monospace"><span style="font-family:arial,sans-serif"><span style="font-family:monospace">branch.syncStateWithParent();</span></span></span><br><span style="font-family:monospace"><span style="font-family:arial,sans-serif"><span style="font-family:monospace">                       webRTCBin.syncStateWithParent();</span></span></span><br></div><div style="margin-left:40px"><span style="font-family:monospace"><span style="font-family:arial,sans-serif"><span style="font-family:monospace"></span></span></span></div><span style="font-family:monospace"><span style="font-family:arial,sans-serif"><br></span></span></div><div><span style="font-family:monospace"><span style="font-family:arial,sans-serif">I've expected an offer sent to the new participant, but nothing is send (on_negotiation_need callback is not called). What I see in gstwebrtc trace is:</span></span></div><div><span style="font-family:monospace"><span style="font-family:arial,sans-serif"><br></span></span></div><div style="margin-left:40px"><span style="font-family:monospace">0:00:25.291067455  [336m 6521 [00m 0x7f7ab4113c30  [37mDEBUG   [00m  [00m           webrtcbin gstwebrtcbin.c:216:gst_webrtc_bin_pad_new:<'':sink_0> [00m new visible pad with direction sink<br></span></div><div style="margin-left:40px"><span style="font-family:monospace"><span style="font-family:arial,sans-serif"><span style="font-family:monospace">0:00:25.319735984  [336m 6521 [00m 0x7f7ab4113c30  [37mDEBUG   [00m  [00m           webrtcbin gstwebrtcbin.c:3731:gst_webrtc_bin_change_state: [00m changing state: NULL => READY<br>0:00:25.319904746  [336m 6521 [00m 0x7f7ab4113c30  [33;01mLOG     [00m  [00m           webrtcbin gstwebrtcbin.c:1096:_check_if_negotiation_is_needed:<webRtcBin2> [00m checking if negotiation is needed<br>0:00:25.319920489  [336m 6521 [00m 0x7f7ab4113c30  [33;01mLOG     [00m  [00m           webrtcbin gstwebrtcbin.c:1102:_check_if_negotiation_is_needed:<webRtcBin2> [00m <b>no negotiation possible until caps have been received on all sink pads</b><br>0:00:25.320556808  [336m 6521 [00m 0x7f7ab4113c30  [37mDEBUG   [00m  [00m           webrtcbin gstwebrtcbin.c:3731:gst_webrtc_bin_change_state: [00m changing state: READY => PAUSED<br>0:00:25.321282060  [336m 6521 [00m 0x7f7ab4113c30  [37mDEBUG   [00m  [00m           webrtcbin gstwebrtcbin.c:3731:gst_webrtc_bin_change_state: [00m changing state: PAUSED => PLAYING</span><br></span></span></div><div style="margin-left:40px"><span style="font-family:monospace"><span style="font-family:arial,sans-serif"><br></span></span></div><span style="font-family:monospace"><span style="font-family:arial,sans-serif">it says that "<b>no negotiation possible until caps have been received on all sink pads",  </b>but sink of webrtcbin for this participant has (should) be linked to "... ! tee ! queue ! opusenc ! rtpopuspay ! capsfilter caps=application/x-rtp,media=audio,encoding-name=OPUS,payload=96 ! webrtcbin".</span></span></div><div dir="ltr"><span style="font-family:monospace"><span style="font-family:arial,sans-serif"><br></span></span></div><div><span style="font-family:monospace"><span style="font-family:arial,sans-serif">Any suggestion?</span></span></div><div><span style="font-family:monospace"><span style="font-family:arial,sans-serif"><br></span></span></div><div><span style="font-family:monospace"><span style="font-family:arial,sans-serif">Thanks a lot.<br></span></span></div></div></div>