WebRtcBin: add peer to conference

Bizarre Days daysbizarre at gmail.com
Thu Apr 2 10:28:13 UTC 2020


Using the java API of gstreamer, I'm trying to create a 1:N audio group.
All participants connects with browser using WebRTC.

The first step, that *is working ok*, is when the presenter joins the
conference. When it joins, the following pipeline is created (equivalent
java code):

audiotestsrc wave=ticks ! queue ! opusenc ! rtpopuspay ! queue ! capsfilter
caps=application/x-rtp,media=audio,encoding-name=OPUS,payload=96 !
webrtcbin name=presenter

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:

(... webrtcbin) ! rtpopusdepay ! opusdec ! tee name=audioTee ! audioconvert
! wavenc ! filesink location=/tmp/cd.wav

In this way, a "tee" element is inserted and the presenter voice is
recorded in file "cd.wav".

Till this point, everything seems ok.



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" :

String branchDesc = "queue ! opusenc ! rtpopuspay ! capsfilter
caps=application/x-rtp,media=audio,encoding-name=OPUS,payload=96";
Bin branch = Gst.parseBinFromDescription(branchDesc, true);

pipeline.addMany( branch, webRTCBin );

branch.link( this.webRTCBin );
pipeline.getElementByName( "audioTee" ).link( branch );

bindWebRtcBin(); # this method binds callbacks "ON_NEGOTIATION_NEED",
"ON_ICE_CANDIDATE", "PAD_ADDED"

branch.syncStateWithParent();
webRTCBin.syncStateWithParent();

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:

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
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
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
0:00:25.319920489 [336m 6521 [00m 0x7f7ab4113c30 [33;01mLOG     [00m [00m
        webrtcbin
gstwebrtcbin.c:1102:_check_if_negotiation_is_needed:<webRtcBin2> [00m *no
negotiation possible until caps have been received on all sink pads*
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
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

it says that "*no negotiation possible until caps have been received on all
sink pads",  *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".

Any suggestion?

Thanks a lot.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20200402/b2066ab0/attachment-0001.htm>


More information about the gstreamer-devel mailing list