versatica / mediasoup

Cutting Edge WebRTC Video Conferencing
https://mediasoup.org
ISC License
6.27k stars 1.13k forks source link

Add optional sctpStreamId to SCTP-based data consumers #1378

Open threema-lenny opened 7 months ago

threema-lenny commented 7 months ago

Second try (after #1111). This makes it possible to use a specific SCTP stream ID / data channel ID for forwarding data.

Could you give me feedback on whether this looks good for the Node API? Then I'll see if I can add the change to the Rust API, too.

TODO

jmillan commented 6 months ago

@threema-lenny, how are you taking benefit of choosing the steam ID for a DataConsumer? Can you share a use case?

threema-lenny commented 6 months ago

@threema-lenny, how are you taking benefit of choosing the steam ID for a DataConsumer? Can you share a use case?

Sure.

We're using OOB negotiated data channel IDs (using pc.createDataChannel('foo', {negotiated: true, id: 0})). This simplifies client code by making it possible to have a single bidirectional RTCDataChannel at creation of the peer connection without having to listen to an ondatachannel event and having to map data channels there (although I'm not even sure if the mediasoup SFU implements the data channel establishment protocol, haven't checked) nor is it necessary to signal it in another way because the ID is already known beforehand.

In our case, data is relayed via the SFU using this fixed SCTP stream ID which is why we set the corresponding SCTP stream ID for both producer and consumer.

ibc commented 6 months ago

I get the point of this feature but need some time to review it.

ibc commented 4 months ago

@threema-lenny are you working on this PR?

threema-lenny commented 4 months ago

@ibc Not right now but I'll definitely need to come back to getting this done.