New releases
- mediasoup Node 3.2.0
- mediasoup Rust crate 0.22.0
- mediasoup-sys Rust crate 0.12.0
- mediasoup-types Rust crate 0.4.0
mediasoup now comes with a built-in SCTP stack that replaces usrsctp dependency. The new SCTP stack is heavily inspired by the dcsctp module of libwebrtc; however, many parts have been implemented from scratch, including packet parsing, factories, and other components.
The final PR completing the SCTP stack is this one: New built-in SCTP stack by ibc · Pull Request #1806 · versatica/mediasoup · GitHub, although there were many others before it (just look for “SCTP part XX” in mediasoup gitHub
).
In mediasoup Rust this is specially critical since the previous SCTP stack (based on usrsctp C dependency) was not thread safe so any Rust application that uses SCTP/DataChannels and runs many mediasoup workers (AKA native threads in mediasoup Rust) should update ASAP.
Breaking Changes
Due to requirements (and new possibilities) of the new SCTP stack, the public API of mediasoup Node and Rust has changed a bit. Here the list of changes:
In mediasoup Node (TypeScript):
- Remove
useBuiltInSctpStackoption inWorkerSettngs. - Remove
SctpCapabilitiestype. No longer needed. WebRtcTransport,PlainTransport,PipeTransport: AddsctpNegotiatedCapabilities()getter.WebRtcTransport,PlainTransport,PipeTransportoptions: RemovenumSctpStreamsandmaxSctpMessageSize, and addmaxSendMessageSize,maxReceiveMessageSize,sctpPerStreamSendQueueLimitandsctpMaxReceiverWindowBufferSize.DirectTransportoptions: RemovemaxMessageSize, and addmaxSendMessageSizeandmaxReceiveMessageSize.- Change
SctpParameterstype from{ port, OS, MIS, maxMessageSize }to{ port, maxSendMessageSize, maxReceiveMessageSize, sendBufferSize, perStreamSendQueueLimit, maxReceiverWindowBufferSize, isDataChannel}.
In mediasoup Rust:
WebRtcTransport,PlainTransport,PipeTransport: Addsctp_negotiated_capabilities()getter.WebRtcTransport,PlainTransport,PipeTransportoptions: Removenum_sctp_streamsandmax_sctp_message_size, and addmax_send_message_size,max_receive_message_size,sctp_per_stream_send_queue_limitandsctp_max_receiver_window_buffer_size.DirectTransportoptions: Removemax_message_size, and addmax_send_message_sizeandmax_receive_message_size.- Change
SctpParameterstype from{ port, OS, MIS, maxMessageSize }to{ port, max_send_message_size, max_receive_message_size, send_buffer_size, per_stream_send_queue_limit,max_receiver_window_buffer_size, is_data_channel}.
How to adapt your mediasoup application?
As a reference, you can check this PR that updates the mediasoup-demo project to work with mediasoup Node 3.20.0.
For now, no changes are required in mediasoup-client, however they will be done in future releases (see ticket).