How to use webrtcbin DataChannel

Matthew Waters ystreet00 at gmail.com
Sun Jun 7 01:05:17 UTC 2020


What version of GStreamer are you using? You may need the latest master
for fixes in some specific cases.

There is an example of data channels within
https://github.com/centricular/gstwebrtc-demos/blob/master/sendrecv/gst/webrtc-sendrecv.c#L303. 
Search for channel.  There is also data channel usage in the unit tests:
https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/blob/master/tests/check/elements/webrtcbin.c.

Offers will only be produced if you call the 'create-offer' signal. 
That can be in response to the 'negotiation-needed' signal but that is
not required.

You don't need to set webtcbin to READY to renegotiate the SDP (within
the supported renegotiation scenarios).

Cheers
-Matt

On 7/6/20 3:31 am, Soebirk, Thorsten Nordholm wrote:
>
> Hi,
>
>  
>
> I am struggling to figure out how to use DataChannels in WebRTC using
> webrtcbin (using version 1.16.2), and I can’t find any example code to
> illustrate this. My application initiates the WebRTC connection, i.e.
> sends the offer. It also sends and receives both audio and video
> streams. Everything works fine except for DataChannels.
>
>  
>
> Here’s what I’ve tried so far:
>
>  
>
> 1. If I send the create-data-channel signal before sending the offer
> while webrtcbin is in state ready, no offer is ever produced. Also, no
> error message is given.
>
>  
>
> 2. If I wait until audio and video have started streaming and then set
> state back to ready, signal create-data-channel, and set state to play
> again, this seems to work in that I get a DataChannel instance back.
> But when I subsequently try to send data using this DataChannel, I get
> a “not open” error.
>
>  
>
> 3. Signaling create-data-channel when webrtcbin is not in ready state
> just gives an error.
>
>  
>
>  
>
> I wonder if I am missing something simple or perhaps doing things in
> the wrong order. Any help greatly appreciated. A simple working
> example would be awesome.
>
>  
>
> Best regards,
>
> Thorsten
>
>  
>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20200607/efe5250d/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20200607/efe5250d/attachment.sig>


More information about the gstreamer-devel mailing list