mediasoup 3.19.22 → 3.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node/lib/ActiveSpeakerObserver.js +34 -1
- package/node/lib/AudioLevelObserver.js +35 -2
- package/node/lib/Channel.d.ts.map +1 -1
- package/node/lib/Channel.js +37 -5
- package/node/lib/Consumer.js +39 -6
- package/node/lib/DataConsumer.d.ts.map +1 -1
- package/node/lib/DataConsumer.js +39 -5
- package/node/lib/DataConsumerTypes.d.ts +1 -0
- package/node/lib/DataConsumerTypes.d.ts.map +1 -1
- package/node/lib/DataProducer.js +37 -4
- package/node/lib/DirectTransport.js +37 -4
- package/node/lib/DirectTransportTypes.d.ts +7 -2
- package/node/lib/DirectTransportTypes.d.ts.map +1 -1
- package/node/lib/Logger.js +4 -1
- package/node/lib/PipeTransport.d.ts +3 -1
- package/node/lib/PipeTransport.d.ts.map +1 -1
- package/node/lib/PipeTransport.js +56 -5
- package/node/lib/PipeTransportTypes.d.ts +28 -8
- package/node/lib/PipeTransportTypes.d.ts.map +1 -1
- package/node/lib/PlainTransport.d.ts +3 -1
- package/node/lib/PlainTransport.d.ts.map +1 -1
- package/node/lib/PlainTransport.js +54 -3
- package/node/lib/PlainTransportTypes.d.ts +27 -7
- package/node/lib/PlainTransportTypes.d.ts.map +1 -1
- package/node/lib/Producer.js +40 -7
- package/node/lib/Router.d.ts +5 -5
- package/node/lib/Router.d.ts.map +1 -1
- package/node/lib/Router.js +81 -36
- package/node/lib/RouterTypes.d.ts +25 -3
- package/node/lib/RouterTypes.d.ts.map +1 -1
- package/node/lib/RtpObserver.js +36 -3
- package/node/lib/Transport.d.ts +3 -1
- package/node/lib/Transport.d.ts.map +1 -1
- package/node/lib/Transport.js +74 -22
- package/node/lib/TransportTypes.d.ts +2 -1
- package/node/lib/TransportTypes.d.ts.map +1 -1
- package/node/lib/WebRtcServer.js +36 -3
- package/node/lib/WebRtcTransport.d.ts +3 -1
- package/node/lib/WebRtcTransport.d.ts.map +1 -1
- package/node/lib/WebRtcTransport.js +55 -4
- package/node/lib/WebRtcTransportTypes.d.ts +27 -7
- package/node/lib/WebRtcTransportTypes.d.ts.map +1 -1
- package/node/lib/Worker.d.ts +1 -1
- package/node/lib/Worker.d.ts.map +1 -1
- package/node/lib/Worker.js +63 -31
- package/node/lib/WorkerTypes.d.ts +0 -4
- package/node/lib/WorkerTypes.d.ts.map +1 -1
- package/node/lib/enhancedEvents.d.ts +2 -2
- package/node/lib/enhancedEvents.d.ts.map +1 -1
- package/node/lib/enhancedEvents.js +0 -2
- package/node/lib/fbs/active-speaker-observer/active-speaker-observer-options.js +34 -1
- package/node/lib/fbs/active-speaker-observer/dominant-speaker-notification.js +34 -1
- package/node/lib/fbs/audio-level-observer/audio-level-observer-options.js +34 -1
- package/node/lib/fbs/audio-level-observer/volume.js +34 -1
- package/node/lib/fbs/audio-level-observer/volumes-notification.js +34 -1
- package/node/lib/fbs/common/string-string-array.js +34 -1
- package/node/lib/fbs/common/string-string.js +34 -1
- package/node/lib/fbs/common/string-uint8.js +34 -1
- package/node/lib/fbs/common/uint16-string.js +34 -1
- package/node/lib/fbs/common/uint32-string.js +34 -1
- package/node/lib/fbs/consumer/base-consumer-dump.js +34 -1
- package/node/lib/fbs/consumer/consumer-dump.js +34 -1
- package/node/lib/fbs/consumer/consumer-layers.js +34 -1
- package/node/lib/fbs/consumer/consumer-score.js +34 -1
- package/node/lib/fbs/consumer/dump-response.js +34 -1
- package/node/lib/fbs/consumer/enable-trace-event-request.js +34 -1
- package/node/lib/fbs/consumer/fir-trace-info.js +34 -1
- package/node/lib/fbs/consumer/get-stats-response.js +34 -1
- package/node/lib/fbs/consumer/key-frame-trace-info.js +34 -1
- package/node/lib/fbs/consumer/layers-change-notification.js +34 -1
- package/node/lib/fbs/consumer/pli-trace-info.js +34 -1
- package/node/lib/fbs/consumer/rtp-notification.js +34 -1
- package/node/lib/fbs/consumer/rtp-trace-info.js +34 -1
- package/node/lib/fbs/consumer/score-notification.js +34 -1
- package/node/lib/fbs/consumer/set-preferred-layers-request.js +34 -1
- package/node/lib/fbs/consumer/set-preferred-layers-response.js +34 -1
- package/node/lib/fbs/consumer/set-priority-request.js +34 -1
- package/node/lib/fbs/consumer/set-priority-response.js +34 -1
- package/node/lib/fbs/consumer/trace-notification.js +34 -1
- package/node/lib/fbs/data-consumer/add-subchannel-request.js +34 -1
- package/node/lib/fbs/data-consumer/add-subchannel-response.js +34 -1
- package/node/lib/fbs/data-consumer/buffered-amount-low-notification.js +34 -1
- package/node/lib/fbs/data-consumer/dump-response.d.ts +5 -2
- package/node/lib/fbs/data-consumer/dump-response.d.ts.map +1 -1
- package/node/lib/fbs/data-consumer/dump-response.js +60 -16
- package/node/lib/fbs/data-consumer/get-buffered-amount-response.js +34 -1
- package/node/lib/fbs/data-consumer/get-stats-response.js +34 -1
- package/node/lib/fbs/data-consumer/message-notification.js +34 -1
- package/node/lib/fbs/data-consumer/remove-subchannel-request.js +34 -1
- package/node/lib/fbs/data-consumer/remove-subchannel-response.js +34 -1
- package/node/lib/fbs/data-consumer/send-request.js +34 -1
- package/node/lib/fbs/data-consumer/set-buffered-amount-low-threshold-request.js +34 -1
- package/node/lib/fbs/data-consumer/set-subchannels-request.js +34 -1
- package/node/lib/fbs/data-consumer/set-subchannels-response.js +34 -1
- package/node/lib/fbs/data-consumer/type.d.ts +5 -0
- package/node/lib/fbs/data-consumer/type.d.ts.map +1 -0
- package/node/lib/fbs/data-consumer/type.js +10 -0
- package/node/lib/fbs/data-consumer.d.ts +1 -0
- package/node/lib/fbs/data-consumer.d.ts.map +1 -1
- package/node/lib/fbs/data-consumer.js +3 -1
- package/node/lib/fbs/data-producer/dump-response.js +34 -1
- package/node/lib/fbs/data-producer/get-stats-response.js +34 -1
- package/node/lib/fbs/data-producer/send-notification.js +34 -1
- package/node/lib/fbs/direct-transport/direct-transport-options.js +34 -1
- package/node/lib/fbs/direct-transport/dump-response.js +34 -1
- package/node/lib/fbs/direct-transport/get-stats-response.js +34 -1
- package/node/lib/fbs/direct-transport/rtcp-notification.js +34 -1
- package/node/lib/fbs/lib-uring/dump.js +34 -1
- package/node/lib/fbs/log/log.js +34 -1
- package/node/lib/fbs/message/message.js +34 -1
- package/node/lib/fbs/notification/body.d.ts +24 -22
- package/node/lib/fbs/notification/body.d.ts.map +1 -1
- package/node/lib/fbs/notification/body.js +24 -20
- package/node/lib/fbs/notification/event.d.ts +27 -26
- package/node/lib/fbs/notification/event.d.ts.map +1 -1
- package/node/lib/fbs/notification/event.js +27 -26
- package/node/lib/fbs/notification/notification.d.ts +3 -2
- package/node/lib/fbs/notification/notification.d.ts.map +1 -1
- package/node/lib/fbs/notification/notification.js +34 -1
- package/node/lib/fbs/pipe-transport/connect-request.js +34 -1
- package/node/lib/fbs/pipe-transport/connect-response.js +34 -1
- package/node/lib/fbs/pipe-transport/dump-response.js +34 -1
- package/node/lib/fbs/pipe-transport/get-stats-response.js +34 -1
- package/node/lib/fbs/pipe-transport/pipe-transport-options.js +34 -1
- package/node/lib/fbs/plain-transport/connect-request.js +34 -1
- package/node/lib/fbs/plain-transport/connect-response.js +34 -1
- package/node/lib/fbs/plain-transport/dump-response.js +34 -1
- package/node/lib/fbs/plain-transport/get-stats-response.js +34 -1
- package/node/lib/fbs/plain-transport/plain-transport-options.js +34 -1
- package/node/lib/fbs/plain-transport/rtcp-tuple-notification.js +34 -1
- package/node/lib/fbs/plain-transport/tuple-notification.js +34 -1
- package/node/lib/fbs/producer/dump-response.js +34 -1
- package/node/lib/fbs/producer/enable-trace-event-request.js +34 -1
- package/node/lib/fbs/producer/fir-trace-info.js +34 -1
- package/node/lib/fbs/producer/get-stats-response.js +34 -1
- package/node/lib/fbs/producer/key-frame-trace-info.js +34 -1
- package/node/lib/fbs/producer/pli-trace-info.js +34 -1
- package/node/lib/fbs/producer/rtp-trace-info.js +34 -1
- package/node/lib/fbs/producer/score-notification.js +34 -1
- package/node/lib/fbs/producer/score.js +34 -1
- package/node/lib/fbs/producer/send-notification.js +34 -1
- package/node/lib/fbs/producer/sr-trace-info.js +34 -1
- package/node/lib/fbs/producer/trace-notification.js +34 -1
- package/node/lib/fbs/producer/video-orientation-change-notification.js +34 -1
- package/node/lib/fbs/request/request.js +34 -1
- package/node/lib/fbs/response/response.js +34 -1
- package/node/lib/fbs/router/close-rtp-observer-request.js +34 -1
- package/node/lib/fbs/router/close-transport-request.js +34 -1
- package/node/lib/fbs/router/create-active-speaker-observer-request.js +34 -1
- package/node/lib/fbs/router/create-audio-level-observer-request.js +34 -1
- package/node/lib/fbs/router/create-direct-transport-request.js +34 -1
- package/node/lib/fbs/router/create-pipe-transport-request.js +34 -1
- package/node/lib/fbs/router/create-plain-transport-request.js +34 -1
- package/node/lib/fbs/router/create-web-rtc-transport-request.js +34 -1
- package/node/lib/fbs/router/dump-response.js +34 -1
- package/node/lib/fbs/rtp-observer/add-producer-request.js +34 -1
- package/node/lib/fbs/rtp-observer/remove-producer-request.js +34 -1
- package/node/lib/fbs/rtp-packet/dump.js +34 -1
- package/node/lib/fbs/rtp-parameters/boolean.js +34 -1
- package/node/lib/fbs/rtp-parameters/codec-mapping.js +34 -1
- package/node/lib/fbs/rtp-parameters/double.js +34 -1
- package/node/lib/fbs/rtp-parameters/encoding-mapping.js +34 -1
- package/node/lib/fbs/rtp-parameters/integer32-array.js +34 -1
- package/node/lib/fbs/rtp-parameters/integer32.js +34 -1
- package/node/lib/fbs/rtp-parameters/parameter.js +34 -1
- package/node/lib/fbs/rtp-parameters/rtcp-feedback.js +34 -1
- package/node/lib/fbs/rtp-parameters/rtcp-parameters.js +34 -1
- package/node/lib/fbs/rtp-parameters/rtp-codec-parameters.js +34 -1
- package/node/lib/fbs/rtp-parameters/rtp-encoding-parameters.js +34 -1
- package/node/lib/fbs/rtp-parameters/rtp-header-extension-parameters.js +34 -1
- package/node/lib/fbs/rtp-parameters/rtp-mapping.js +34 -1
- package/node/lib/fbs/rtp-parameters/rtp-parameters.js +34 -1
- package/node/lib/fbs/rtp-parameters/rtx.js +34 -1
- package/node/lib/fbs/rtp-parameters/string.js +34 -1
- package/node/lib/fbs/rtp-stream/base-stats.js +34 -1
- package/node/lib/fbs/rtp-stream/bitrate-by-layer.js +34 -1
- package/node/lib/fbs/rtp-stream/dump.js +34 -1
- package/node/lib/fbs/rtp-stream/params.js +34 -1
- package/node/lib/fbs/rtp-stream/recv-stats.js +34 -1
- package/node/lib/fbs/rtp-stream/send-stats.js +34 -1
- package/node/lib/fbs/rtp-stream/stats.js +34 -1
- package/node/lib/fbs/rtx-stream/params.js +34 -1
- package/node/lib/fbs/rtx-stream/rtx-dump.js +34 -1
- package/node/lib/fbs/sctp-association/sctp-negotiated-capabilities.d.ts +24 -0
- package/node/lib/fbs/sctp-association/sctp-negotiated-capabilities.d.ts.map +1 -0
- package/node/lib/fbs/sctp-association/sctp-negotiated-capabilities.js +102 -0
- package/node/lib/fbs/sctp-association.d.ts +1 -0
- package/node/lib/fbs/sctp-association.d.ts.map +1 -1
- package/node/lib/fbs/sctp-association.js +4 -1
- package/node/lib/fbs/sctp-parameters/num-sctp-streams.js +34 -1
- package/node/lib/fbs/sctp-parameters/sctp-parameters.d.ts +14 -14
- package/node/lib/fbs/sctp-parameters/sctp-parameters.d.ts.map +1 -1
- package/node/lib/fbs/sctp-parameters/sctp-parameters.js +73 -40
- package/node/lib/fbs/sctp-parameters/sctp-stream-parameters.js +34 -1
- package/node/lib/fbs/sctp-parameters.d.ts +0 -1
- package/node/lib/fbs/sctp-parameters.d.ts.map +1 -1
- package/node/lib/fbs/sctp-parameters.js +1 -4
- package/node/lib/fbs/srtp-parameters/srtp-parameters.js +34 -1
- package/node/lib/fbs/transport/bwe-trace-info.js +34 -1
- package/node/lib/fbs/transport/close-consumer-request.js +34 -1
- package/node/lib/fbs/transport/close-data-consumer-request.js +34 -1
- package/node/lib/fbs/transport/close-data-producer-request.js +34 -1
- package/node/lib/fbs/transport/close-producer-request.js +34 -1
- package/node/lib/fbs/transport/consume-data-request.d.ts +1 -1
- package/node/lib/fbs/transport/consume-data-request.js +35 -2
- package/node/lib/fbs/transport/consume-request.js +34 -1
- package/node/lib/fbs/transport/consume-response.js +34 -1
- package/node/lib/fbs/transport/dump.d.ts +7 -4
- package/node/lib/fbs/transport/dump.d.ts.map +1 -1
- package/node/lib/fbs/transport/dump.js +66 -22
- package/node/lib/fbs/transport/enable-trace-event-request.js +34 -1
- package/node/lib/fbs/transport/listen-info.js +34 -1
- package/node/lib/fbs/transport/options.d.ts +14 -14
- package/node/lib/fbs/transport/options.d.ts.map +1 -1
- package/node/lib/fbs/transport/options.js +92 -51
- package/node/lib/fbs/transport/port-range.js +34 -1
- package/node/lib/fbs/transport/produce-data-request.js +34 -1
- package/node/lib/fbs/transport/produce-request.js +34 -1
- package/node/lib/fbs/transport/produce-response.js +34 -1
- package/node/lib/fbs/transport/recv-rtp-header-extensions.js +34 -1
- package/node/lib/fbs/transport/restart-ice-response.js +34 -1
- package/node/lib/fbs/transport/rtp-listener.js +34 -1
- package/node/lib/fbs/transport/sctp-listener.js +34 -1
- package/node/lib/fbs/transport/sctp-negotiated-capabilities-notification.d.ts +22 -0
- package/node/lib/fbs/transport/sctp-negotiated-capabilities-notification.d.ts.map +1 -0
- package/node/lib/fbs/transport/sctp-negotiated-capabilities-notification.js +93 -0
- package/node/lib/fbs/transport/sctp-state-change-notification.js +34 -1
- package/node/lib/fbs/transport/send-rtcp-notification.js +34 -1
- package/node/lib/fbs/transport/set-max-incoming-bitrate-request.js +34 -1
- package/node/lib/fbs/transport/set-max-outgoing-bitrate-request.js +34 -1
- package/node/lib/fbs/transport/set-min-outgoing-bitrate-request.js +34 -1
- package/node/lib/fbs/transport/socket-flags.js +34 -1
- package/node/lib/fbs/transport/stats.js +34 -1
- package/node/lib/fbs/transport/trace-notification.js +34 -1
- package/node/lib/fbs/transport/tuple.js +34 -1
- package/node/lib/fbs/transport.d.ts +1 -0
- package/node/lib/fbs/transport.d.ts.map +1 -1
- package/node/lib/fbs/transport.js +5 -2
- package/node/lib/fbs/web-rtc-server/dump-response.js +34 -1
- package/node/lib/fbs/web-rtc-server/ice-user-name-fragment.js +34 -1
- package/node/lib/fbs/web-rtc-server/ip-port.js +34 -1
- package/node/lib/fbs/web-rtc-server/tuple-hash.js +34 -1
- package/node/lib/fbs/web-rtc-transport/connect-request.js +34 -1
- package/node/lib/fbs/web-rtc-transport/connect-response.js +34 -1
- package/node/lib/fbs/web-rtc-transport/dtls-parameters.js +34 -1
- package/node/lib/fbs/web-rtc-transport/dtls-state-change-notification.js +34 -1
- package/node/lib/fbs/web-rtc-transport/dump-response.js +34 -1
- package/node/lib/fbs/web-rtc-transport/fingerprint.js +34 -1
- package/node/lib/fbs/web-rtc-transport/get-stats-response.js +34 -1
- package/node/lib/fbs/web-rtc-transport/ice-candidate.js +34 -1
- package/node/lib/fbs/web-rtc-transport/ice-parameters.js +34 -1
- package/node/lib/fbs/web-rtc-transport/ice-selected-tuple-change-notification.js +34 -1
- package/node/lib/fbs/web-rtc-transport/ice-state-change-notification.js +34 -1
- package/node/lib/fbs/web-rtc-transport/listen-individual.js +34 -1
- package/node/lib/fbs/web-rtc-transport/listen-server.js +34 -1
- package/node/lib/fbs/web-rtc-transport/web-rtc-transport-options.js +34 -1
- package/node/lib/fbs/worker/channel-message-handlers.js +34 -1
- package/node/lib/fbs/worker/close-router-request.js +34 -1
- package/node/lib/fbs/worker/close-web-rtc-server-request.js +34 -1
- package/node/lib/fbs/worker/create-router-request.js +34 -1
- package/node/lib/fbs/worker/create-web-rtc-server-request.js +34 -1
- package/node/lib/fbs/worker/dump-response.js +34 -1
- package/node/lib/fbs/worker/resource-usage-response.js +34 -1
- package/node/lib/fbs/worker/update-settings-request.js +34 -1
- package/node/lib/index.d.ts +1 -1
- package/node/lib/index.d.ts.map +1 -1
- package/node/lib/index.js +37 -5
- package/node/lib/ortc.js +36 -3
- package/node/lib/rtpParametersFbsUtils.js +34 -1
- package/node/lib/rtpStreamStatsFbsUtils.js +35 -2
- package/node/lib/sctpParametersFbsUtils.d.ts +2 -2
- package/node/lib/sctpParametersFbsUtils.d.ts.map +1 -1
- package/node/lib/sctpParametersFbsUtils.js +44 -7
- package/node/lib/sctpParametersTypes.d.ts +10 -46
- package/node/lib/sctpParametersTypes.d.ts.map +1 -1
- package/node/lib/srtpParametersFbsUtils.js +34 -1
- package/node/lib/test/test-ActiveSpeakerObserver.js +35 -2
- package/node/lib/test/test-AudioLevelObserver.js +35 -2
- package/node/lib/test/test-Consumer.js +37 -4
- package/node/lib/test/test-DataConsumer.js +35 -2
- package/node/lib/test/test-DataProducer.js +35 -2
- package/node/lib/test/test-DirectTransport.js +36 -8
- package/node/lib/test/test-PipeTransport.js +35 -2
- package/node/lib/test/test-PlainTransport.js +45 -12
- package/node/lib/test/test-Producer.js +37 -4
- package/node/lib/test/test-Router.js +35 -2
- package/node/lib/test/test-WebRtcServer.js +34 -1
- package/node/lib/test/test-WebRtcTransport.js +51 -22
- package/node/lib/test/test-Worker.js +37 -4
- package/node/lib/test/test-mediasoup.js +36 -3
- package/node/lib/test/test-multiopus.js +35 -2
- package/node/lib/test/test-ortc.js +34 -1
- package/node/lib/test/test-werift-sctp.js +39 -5
- package/npm-scripts.mjs +2 -2
- package/package.json +11 -11
- package/worker/deps/libwebrtc/LICENSE +5 -0
- package/worker/deps/libwebrtc/README.md +3 -3
- package/worker/deps/libwebrtc/libwebrtc/mediasoup_helpers.h +13 -10
- package/worker/fbs/dataConsumer.fbs +7 -2
- package/worker/fbs/dataProducer.fbs +1 -0
- package/worker/fbs/notification.fbs +2 -0
- package/worker/fbs/sctpAssociation.fbs +4 -0
- package/worker/fbs/sctpParameters.fbs +5 -12
- package/worker/fbs/transport.fbs +12 -8
- package/worker/fuzzer/src/RTC/FuzzerDtlsTransport.cpp +5 -1
- package/worker/fuzzer/src/RTC/FuzzerRateCalculator.cpp +2 -2
- package/worker/fuzzer/src/RTC/FuzzerSeqManager.cpp +1 -1
- package/worker/fuzzer/src/RTC/FuzzerTrendCalculator.cpp +5 -5
- package/worker/fuzzer/src/RTC/ICE/FuzzerStunPacket.cpp +9 -6
- package/worker/fuzzer/src/RTC/RTP/FuzzerRetransmissionBuffer.cpp +1 -1
- package/worker/fuzzer/src/RTC/RTP/FuzzerRtpStreamSend.cpp +6 -2
- package/worker/fuzzer/src/RTC/SCTP/association/FuzzerStateCookie.cpp +1 -1
- package/worker/fuzzer/src/RTC/SCTP/packet/FuzzerPacket.cpp +5 -2
- package/worker/fuzzer/src/fuzzer.cpp +3 -10
- package/worker/include/Channel/ChannelRequest.hpp +1 -1
- package/worker/include/DepLibUV.hpp +1 -1
- package/worker/include/DepLibUring.hpp +3 -3
- package/worker/include/Logger.hpp +4 -4
- package/worker/include/MediaSoupErrors.hpp +1 -1
- package/worker/include/RTC/ActiveSpeakerObserver.hpp +6 -4
- package/worker/include/RTC/AudioLevelObserver.hpp +2 -2
- package/worker/include/RTC/Consumer.hpp +1 -1
- package/worker/include/RTC/DataConsumer.hpp +11 -15
- package/worker/include/RTC/DataProducer.hpp +4 -7
- package/worker/include/RTC/DirectTransport.hpp +3 -5
- package/worker/include/RTC/DtlsTransport.hpp +7 -7
- package/worker/include/RTC/ICE/IceServer.hpp +2 -2
- package/worker/include/RTC/ICE/StunPacket.hpp +1 -1
- package/worker/include/RTC/KeyFrameRequestManager.hpp +1 -1
- package/worker/include/RTC/NackGenerator.hpp +3 -2
- package/worker/include/RTC/PipeTransport.hpp +3 -5
- package/worker/include/RTC/PlainTransport.hpp +3 -5
- package/worker/include/RTC/PortManager.hpp +1 -1
- package/worker/include/RTC/Producer.hpp +1 -1
- package/worker/include/RTC/RTCP/FeedbackPs.hpp +1 -1
- package/worker/include/RTC/RTCP/FeedbackRtp.hpp +1 -1
- package/worker/include/RTC/RTCP/FeedbackRtpNack.hpp +1 -1
- package/worker/include/RTC/RTCP/ReceiverReport.hpp +1 -1
- package/worker/include/RTC/RTP/Packet.hpp +2 -2
- package/worker/include/RTC/RTP/RtpStream.hpp +11 -12
- package/worker/include/RTC/RTP/RtpStreamRecv.hpp +3 -2
- package/worker/include/RTC/RTP/RtxStream.hpp +3 -1
- package/worker/include/RTC/RTP/SharedPacket.hpp +1 -1
- package/worker/include/RTC/RateCalculator.hpp +5 -2
- package/worker/include/RTC/Router.hpp +5 -6
- package/worker/include/RTC/RtpObserver.hpp +1 -1
- package/worker/include/RTC/SCTP/association/Association.hpp +46 -15
- package/worker/include/RTC/SCTP/association/AssociationListenerDeferrer.hpp +14 -6
- package/worker/include/RTC/SCTP/association/HeartbeatHandler.hpp +12 -11
- package/worker/include/RTC/SCTP/association/PacketSender.hpp +3 -3
- package/worker/include/RTC/SCTP/association/StateCookie.hpp +1 -1
- package/worker/include/RTC/SCTP/association/StreamResetHandler.hpp +26 -26
- package/worker/include/RTC/SCTP/association/TransmissionControlBlock.hpp +58 -48
- package/worker/include/RTC/SCTP/association/{TCBContext.hpp → TransmissionControlBlockContextInterface.hpp} +11 -6
- package/worker/include/RTC/SCTP/packet/Chunk.hpp +3 -3
- package/worker/include/RTC/SCTP/packet/TLV.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/UserData.hpp +39 -31
- package/worker/include/RTC/SCTP/packet/chunks/AnyDataChunk.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/chunks/AnyForwardTsnChunk.hpp +9 -9
- package/worker/include/RTC/SCTP/packet/chunks/AnyInitChunk.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/chunks/DataChunk.hpp +4 -2
- package/worker/include/RTC/SCTP/packet/chunks/ForwardTsnChunk.hpp +3 -3
- package/worker/include/RTC/SCTP/packet/chunks/IDataChunk.hpp +4 -2
- package/worker/include/RTC/SCTP/packet/chunks/IForwardTsnChunk.hpp +3 -3
- package/worker/include/RTC/SCTP/packet/chunks/InitAckChunk.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/chunks/InitChunk.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/chunks/SackChunk.hpp +10 -3
- package/worker/include/RTC/SCTP/packet/chunks/ShutdownChunk.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/errorCauses/InvalidStreamIdentifierErrorCause.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/errorCauses/MissingMandatoryParameterErrorCause.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/errorCauses/NoUserDataErrorCause.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/errorCauses/StaleCookieErrorCause.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/AddIncomingStreamsRequestParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/AddOutgoingStreamsRequestParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/CookiePreservativeParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/IncomingSsnResetRequestParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/OutgoingSsnResetRequestParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/ReconfigurationResponseParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/SsnTsnResetRequestParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/SupportedAddressTypesParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/SupportedExtensionsParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/ZeroChecksumAcceptableParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/public/AssociationInterface.hpp +22 -2
- package/worker/include/RTC/SCTP/public/{AssociationListener.hpp → AssociationListenerInterface.hpp} +5 -5
- package/worker/include/RTC/SCTP/public/Message.hpp +26 -10
- package/worker/include/RTC/SCTP/public/SctpOptions.hpp +29 -21
- package/worker/include/RTC/SCTP/public/SctpTypes.hpp +21 -0
- package/worker/include/RTC/SCTP/rx/DataTracker.hpp +277 -0
- package/worker/include/RTC/SCTP/rx/InterleavedReassemblyStreams.hpp +116 -0
- package/worker/include/RTC/SCTP/rx/ReassemblyQueue.hpp +202 -0
- package/worker/include/RTC/SCTP/rx/ReassemblyStreamsInterface.hpp +83 -0
- package/worker/include/RTC/SCTP/rx/TraditionalReassemblyStreams.hpp +183 -0
- package/worker/include/RTC/SCTP/tx/OutstandingData.hpp +48 -57
- package/worker/include/RTC/SCTP/tx/RetransmissionErrorCounter.hpp +3 -3
- package/worker/include/RTC/SCTP/tx/RetransmissionQueue.hpp +36 -43
- package/worker/include/RTC/SCTP/tx/RetransmissionTimeout.hpp +6 -6
- package/worker/include/RTC/SCTP/tx/RoundRobinSendQueue.hpp +356 -0
- package/worker/include/RTC/SCTP/tx/SendQueueInterface.hpp +180 -0
- package/worker/include/RTC/SCTP/tx/StreamScheduler.hpp +235 -0
- package/worker/include/RTC/SenderBandwidthEstimator.hpp +5 -1
- package/worker/include/RTC/Serializable.hpp +3 -3
- package/worker/include/RTC/TcpServer.hpp +2 -2
- package/worker/include/RTC/Transport.hpp +59 -80
- package/worker/include/RTC/TransportCongestionControlClient.hpp +2 -2
- package/worker/include/RTC/TransportCongestionControlServer.hpp +2 -2
- package/worker/include/RTC/TransportTuple.hpp +1 -1
- package/worker/include/RTC/UdpSocket.hpp +1 -1
- package/worker/include/RTC/WebRtcServer.hpp +1 -1
- package/worker/include/RTC/WebRtcTransport.hpp +3 -5
- package/worker/include/Settings.hpp +2 -3
- package/worker/include/Shared.hpp +31 -7
- package/worker/include/SharedInterface.hpp +37 -4
- package/worker/include/Utils/UnwrappedSequenceNumber.hpp +270 -0
- package/worker/include/Utils.hpp +4 -4
- package/worker/include/Worker.hpp +4 -4
- package/worker/include/common.hpp +12 -12
- package/worker/include/handles/BackoffTimerHandle.hpp +8 -9
- package/worker/include/handles/BackoffTimerHandleInterface.hpp +10 -3
- package/worker/include/handles/TimerHandle.hpp +0 -7
- package/worker/meson.build +33 -34
- package/worker/mocks/include/MockShared.hpp +56 -9
- package/worker/mocks/include/RTC/SCTP/association/MockAssociationListener.hpp +308 -0
- package/worker/mocks/include/RTC/SCTP/association/MockTransmissionControlBlockContext.hpp +183 -0
- package/worker/mocks/include/RTC/SCTP/tx/MockSendQueue.hpp +262 -0
- package/worker/mocks/include/handles/MockBackoffTimerHandle.hpp +153 -0
- package/worker/mocks/include/handles/MockTimerHandle.hpp +74 -0
- package/worker/mocks/include/mockTypes.hpp +15 -0
- package/worker/mocks/src/MockShared.cpp +30 -10
- package/worker/mocks/src/RTC/SCTP/association/MockTransmissionControlBlockContext.cpp +39 -0
- package/worker/mocks/src/handles/MockBackoffTimerHandle.cpp +127 -0
- package/worker/scripts/clang-scripts.mjs +1 -0
- package/worker/scripts/package-lock.json +6 -7
- package/worker/src/Channel/ChannelSocket.cpp +2 -3
- package/worker/src/DepLibUV.cpp +1 -1
- package/worker/src/DepLibUring.cpp +3 -1
- package/worker/src/Logger.cpp +1 -1
- package/worker/src/MediaSoupErrors.cpp +2 -0
- package/worker/src/RTC/ActiveSpeakerObserver.cpp +7 -7
- package/worker/src/RTC/Consumer.cpp +5 -6
- package/worker/src/RTC/DataConsumer.cpp +54 -64
- package/worker/src/RTC/DataProducer.cpp +13 -8
- package/worker/src/RTC/DirectTransport.cpp +7 -6
- package/worker/src/RTC/ICE/IceServer.cpp +2 -2
- package/worker/src/RTC/ICE/StunPacket.cpp +1 -1
- package/worker/src/RTC/NackGenerator.cpp +3 -3
- package/worker/src/RTC/PipeConsumer.cpp +1 -1
- package/worker/src/RTC/PipeTransport.cpp +6 -19
- package/worker/src/RTC/PlainTransport.cpp +6 -19
- package/worker/src/RTC/Producer.cpp +10 -11
- package/worker/src/RTC/RTCP/FeedbackPsAfb.cpp +1 -1
- package/worker/src/RTC/RTCP/FeedbackRtpTransport.cpp +1 -1
- package/worker/src/RTC/RTCP/XR.cpp +1 -1
- package/worker/src/RTC/RTP/Packet.cpp +3 -1
- package/worker/src/RTC/RTP/ProbationGenerator.cpp +4 -4
- package/worker/src/RTC/RTP/RetransmissionBuffer.cpp +1 -1
- package/worker/src/RTC/RTP/RtpStream.cpp +9 -9
- package/worker/src/RTC/RTP/RtpStreamRecv.cpp +11 -10
- package/worker/src/RTC/RTP/RtpStreamSend.cpp +7 -7
- package/worker/src/RTC/RTP/RtxStream.cpp +7 -7
- package/worker/src/RTC/RTP/SharedPacket.cpp +3 -3
- package/worker/src/RTC/RateCalculator.cpp +1 -2
- package/worker/src/RTC/Router.cpp +58 -35
- package/worker/src/RTC/RtpDictionaries/RtpCodecMimeType.cpp +1 -1
- package/worker/src/RTC/SCTP/LICENSE +44 -0
- package/worker/src/RTC/SCTP/association/Association.cpp +348 -322
- package/worker/src/RTC/SCTP/association/AssociationListenerDeferrer.cpp +46 -13
- package/worker/src/RTC/SCTP/association/HeartbeatHandler.cpp +26 -28
- package/worker/src/RTC/SCTP/association/PacketSender.cpp +8 -8
- package/worker/src/RTC/SCTP/association/StreamResetHandler.cpp +71 -56
- package/worker/src/RTC/SCTP/association/TransmissionControlBlock.cpp +176 -66
- package/worker/src/RTC/SCTP/packet/Chunk.cpp +5 -1
- package/worker/src/RTC/SCTP/packet/Packet.cpp +8 -1
- package/worker/src/RTC/SCTP/packet/chunks/DataChunk.cpp +17 -0
- package/worker/src/RTC/SCTP/packet/chunks/ForwardTsnChunk.cpp +4 -4
- package/worker/src/RTC/SCTP/packet/chunks/IDataChunk.cpp +25 -0
- package/worker/src/RTC/SCTP/packet/chunks/IForwardTsnChunk.cpp +10 -7
- package/worker/src/RTC/SCTP/packet/chunks/SackChunk.cpp +21 -4
- package/worker/src/RTC/SCTP/packet/chunks/ShutdownCompleteChunk.cpp +1 -1
- package/worker/src/RTC/SCTP/packet/errorCauses/NoUserDataErrorCause.cpp +1 -1
- package/worker/src/RTC/SCTP/packet/errorCauses/ProtocolViolationErrorCause.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/errorCauses/UserInitiatedAbortErrorCause.cpp +1 -1
- package/worker/src/RTC/SCTP/public/Message.cpp +8 -0
- package/worker/src/RTC/SCTP/public/SctpOptions.cpp +90 -0
- package/worker/src/RTC/SCTP/rx/DataTracker.cpp +471 -0
- package/worker/src/RTC/SCTP/rx/InterleavedReassemblyStreams.cpp +327 -0
- package/worker/src/RTC/SCTP/rx/ReassemblyQueue.cpp +288 -0
- package/worker/src/RTC/SCTP/rx/TraditionalReassemblyStreams.cpp +453 -0
- package/worker/src/RTC/SCTP/tx/OutstandingData.cpp +81 -74
- package/worker/src/RTC/SCTP/tx/RetransmissionQueue.cpp +85 -98
- package/worker/src/RTC/SCTP/tx/RetransmissionTimeout.cpp +1 -1
- package/worker/src/RTC/SCTP/tx/RoundRobinSendQueue.cpp +752 -0
- package/worker/src/RTC/SCTP/tx/StreamScheduler.cpp +257 -0
- package/worker/src/RTC/SenderBandwidthEstimator.cpp +7 -5
- package/worker/src/RTC/SimpleConsumer.cpp +3 -4
- package/worker/src/RTC/SimulcastConsumer.cpp +5 -6
- package/worker/src/RTC/SrtpSession.cpp +1 -1
- package/worker/src/RTC/SvcConsumer.cpp +5 -6
- package/worker/src/RTC/TcpConnection.cpp +1 -1
- package/worker/src/RTC/Transport.cpp +475 -551
- package/worker/src/RTC/TransportCongestionControlClient.cpp +5 -6
- package/worker/src/RTC/TransportCongestionControlServer.cpp +1 -2
- package/worker/src/RTC/WebRtcServer.cpp +1 -1
- package/worker/src/RTC/WebRtcTransport.cpp +5 -13
- package/worker/src/Settings.cpp +9 -28
- package/worker/src/Shared.cpp +3 -3
- package/worker/src/Utils/Crypto.cpp +1 -1
- package/worker/src/Utils/String.cpp +1 -1
- package/worker/src/Worker.cpp +10 -26
- package/worker/src/handles/BackoffTimerHandle.cpp +24 -6
- package/worker/src/handles/UdpSocketHandle.cpp +1 -1
- package/worker/src/lib.cpp +5 -17
- package/worker/subprojects/catch2.wrap +6 -6
- package/worker/test/include/RTC/ICE/iceCommon.hpp +7 -7
- package/worker/test/include/RTC/RTP/rtpCommon.hpp +6 -6
- package/worker/test/include/RTC/SCTP/sctpCommon.hpp +10 -10
- package/worker/test/include/catch2Macros.hpp +31 -0
- package/worker/test/src/RTC/ICE/TestStunPacket.cpp +3 -3
- package/worker/test/src/RTC/ICE/iceCommon.cpp +2 -2
- package/worker/test/src/RTC/RTP/Codecs/TestVP8.cpp +1 -1
- package/worker/test/src/RTC/RTP/Codecs/TestVP9.cpp +1 -1
- package/worker/test/src/RTC/RTP/TestPacket.cpp +3 -3
- package/worker/test/src/RTC/RTP/TestRtpStreamRecv.cpp +6 -6
- package/worker/test/src/RTC/RTP/TestRtpStreamSend.cpp +6 -2
- package/worker/test/src/RTC/RTP/TestSharedPacket.cpp +1 -1
- package/worker/test/src/RTC/RTP/rtpCommon.cpp +2 -2
- package/worker/test/src/RTC/SCTP/association/TestHeartbeatHandler.cpp +292 -0
- package/worker/test/src/RTC/SCTP/association/TestNegotiatedCapabilities.cpp +1 -1
- package/worker/test/src/RTC/SCTP/association/TestStateCookie.cpp +1 -1
- package/worker/test/src/RTC/SCTP/association/TestTransmissionControlBlock.cpp +99 -0
- package/worker/test/src/RTC/SCTP/packet/TestChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/TestPacket.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestAbortAssociationChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestCookieAckChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestCookieEchoChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestDataChunk.cpp +77 -7
- package/worker/test/src/RTC/SCTP/packet/chunks/TestForwardTsnChunk.cpp +35 -26
- package/worker/test/src/RTC/SCTP/packet/chunks/TestHeartbeatAckChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestHeartbeatRequestChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestIDataChunk.cpp +77 -7
- package/worker/test/src/RTC/SCTP/packet/chunks/TestIForwardTsnChunk.cpp +59 -27
- package/worker/test/src/RTC/SCTP/packet/chunks/TestInitAckChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestInitChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestOperationErrorChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestReConfigChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestSackChunk.cpp +73 -35
- package/worker/test/src/RTC/SCTP/packet/chunks/TestShutdownAckChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestShutdownChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestShutdownCompleteChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestUnknownChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestCookieReceivedWhileShuttingDownErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestInvalidMandatoryParameterErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestInvalidStreamIdentifierErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestMissingMandatoryParameterErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestNoUserDataErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestOutOfResourceErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestProtocolViolationErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestRestartOfAnAssociationWithNewAddressesErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestStaleCookieErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnknownErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnrecognizedChunkTypeErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnrecognizedParametersErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnresolvableAddressErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUserInitiatedAbortErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestAddIncomingStreamsRequestParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestAddOutgoingStreamsRequestParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestCookiePreservativeParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestForwardTsnSupportedParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestHeartbeatInfoParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestIPv4AddressParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestIPv6AddressParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestIncomingSsnResetRequestParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestOutgoingSsnResetRequestParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestReconfigurationResponseParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestSsnTsnResetRequestParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestStateCookieParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestSupportedAddressTypesParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestSupportedExtensionsParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestUnknownParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestUnrecognizedParameterParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestZeroChecksumAcceptableParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/rx/TestDataTracker.cpp +1117 -0
- package/worker/test/src/RTC/SCTP/rx/TestInterleavedReassemblyStreams.cpp +565 -0
- package/worker/test/src/RTC/SCTP/rx/TestReassemblyQueue.cpp +557 -0
- package/worker/test/src/RTC/SCTP/rx/TestTraditionalReassemblyStreams.cpp +555 -0
- package/worker/test/src/RTC/SCTP/sctpCommon.cpp +2 -2
- package/worker/test/src/RTC/SCTP/tx/TestOutstandingData.cpp +475 -423
- package/worker/test/src/RTC/SCTP/tx/TestRetransmissionErrorCounter.cpp +4 -0
- package/worker/test/src/RTC/SCTP/tx/TestRetransmissionQueue.cpp +2218 -0
- package/worker/test/src/RTC/SCTP/tx/TestRoundRobinSendQueue.cpp +1130 -0
- package/worker/test/src/RTC/SCTP/tx/TestStreamScheduler.cpp +721 -0
- package/worker/test/src/RTC/TestKeyFrameRequestManager.cpp +9 -27
- package/worker/test/src/RTC/TestNackGenerator.cpp +7 -8
- package/worker/test/src/RTC/TestRateCalculator.cpp +6 -7
- package/worker/test/src/RTC/TestSimpleConsumer.cpp +7 -3
- package/worker/test/src/RTC/TestTransportCongestionControlServer.cpp +8 -3
- package/worker/test/src/{RTC/SCTP/common → Utils}/TestUnwrappedSequenceNumber.cpp +2 -2
- package/worker/test/src/testHelpers.cpp +1 -1
- package/worker/test/src/tests.cpp +0 -12
- package/node/lib/fbs/consumer/degrade-request.d.ts +0 -30
- package/node/lib/fbs/consumer/degrade-request.d.ts.map +0 -1
- package/node/lib/fbs/consumer/degrade-request.js +0 -91
- package/node/lib/fbs/consumer/enable-delay-and-loss-request.d.ts +0 -24
- package/node/lib/fbs/consumer/enable-delay-and-loss-request.d.ts.map +0 -1
- package/node/lib/fbs/consumer/enable-delay-and-loss-request.js +0 -69
- package/node/lib/fbs/producer/degrade-request.d.ts +0 -30
- package/node/lib/fbs/producer/degrade-request.d.ts.map +0 -1
- package/node/lib/fbs/producer/degrade-request.js +0 -91
- package/node/lib/fbs/worker/close-notification.d.ts +0 -18
- package/node/lib/fbs/worker/close-notification.d.ts.map +0 -1
- package/node/lib/fbs/worker/close-notification.js +0 -45
- package/node/lib/fbs/worker/close-request.d.ts +0 -18
- package/node/lib/fbs/worker/close-request.d.ts.map +0 -1
- package/node/lib/fbs/worker/close-request.js +0 -45
- package/node/lib/fbs/worker/close-worker-notification.d.ts +0 -18
- package/node/lib/fbs/worker/close-worker-notification.d.ts.map +0 -1
- package/node/lib/fbs/worker/close-worker-notification.js +0 -45
- package/worker/include/DepUsrSCTP.hpp +0 -49
- package/worker/include/RTC/SCTP/TODO_SCTP.md +0 -55
- package/worker/include/RTC/SCTP/common/UnwrappedSequenceNumber.hpp +0 -274
- package/worker/include/RTC/SctpAssociation.hpp +0 -147
- package/worker/src/DepUsrSCTP.cpp +0 -283
- package/worker/src/RTC/SctpAssociation.cpp +0 -1175
- package/worker/subprojects/usrsctp.wrap +0 -8
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
#define MS_RTC_SCTP_RETRANSMISSION_QUEUE_HPP
|
|
3
3
|
|
|
4
4
|
#include "common.hpp"
|
|
5
|
-
#include "
|
|
5
|
+
#include "handles/BackoffTimerHandleInterface.hpp"
|
|
6
6
|
#include "RTC/SCTP/packet/Packet.hpp"
|
|
7
7
|
#include "RTC/SCTP/packet/UserData.hpp"
|
|
8
8
|
#include "RTC/SCTP/packet/chunks/ForwardTsnChunk.hpp"
|
|
9
9
|
#include "RTC/SCTP/packet/chunks/IForwardTsnChunk.hpp"
|
|
10
10
|
#include "RTC/SCTP/packet/chunks/SackChunk.hpp"
|
|
11
|
-
#include "RTC/SCTP/public/
|
|
11
|
+
#include "RTC/SCTP/public/AssociationListenerInterface.hpp"
|
|
12
12
|
#include "RTC/SCTP/public/SctpOptions.hpp"
|
|
13
13
|
#include "RTC/SCTP/tx/OutstandingData.hpp"
|
|
14
|
-
#include "
|
|
14
|
+
#include "RTC/SCTP/tx/SendQueueInterface.hpp"
|
|
15
15
|
#include <vector>
|
|
16
16
|
|
|
17
17
|
namespace RTC
|
|
@@ -41,9 +41,6 @@ namespace RTC
|
|
|
41
41
|
virtual void OnRetransmissionQueueClearRetransmissionCounter() = 0;
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
public:
|
|
45
|
-
using UnwrappedTsn = UnwrappedSequenceNumber<uint32_t>;
|
|
46
|
-
|
|
47
44
|
private:
|
|
48
45
|
enum class CongestionAlgorithmPhase : uint8_t
|
|
49
46
|
{
|
|
@@ -57,21 +54,19 @@ namespace RTC
|
|
|
57
54
|
* `localInitialTsn` as the first TSN to use for sent fragments. It will
|
|
58
55
|
* poll data from `sendQueue`. When SACKs are received, it will estimate
|
|
59
56
|
* the RTT and call `listener->OnRetransmissionQueueNewRttMs()`. When an
|
|
60
|
-
* outstanding
|
|
57
|
+
* outstanding chunk has been acked, it will call
|
|
61
58
|
* `listener->OnRetransmissionQueueClearRetransmissionCounter() and will
|
|
62
59
|
* also use `t3RtxTimer`, which is the SCTP retransmission timer to manage
|
|
63
60
|
* retransmissions.
|
|
64
61
|
*/
|
|
65
62
|
RetransmissionQueue(
|
|
66
63
|
Listener* listener,
|
|
67
|
-
|
|
64
|
+
AssociationListenerInterface& associationListener,
|
|
68
65
|
uint32_t localInitialTsn,
|
|
69
66
|
uint32_t remoteAdvertisedReceiverWindowCredit,
|
|
70
|
-
|
|
71
|
-
// SendQueue& sendQueue,
|
|
67
|
+
SendQueueInterface& sendQueue,
|
|
72
68
|
BackoffTimerHandleInterface* t3RtxTimer,
|
|
73
69
|
const SctpOptions& sctpOptions,
|
|
74
|
-
// TODO: SCTP: I don't like these defaults (true and false), let's be explicit.
|
|
75
70
|
bool supportsPartialReliability,
|
|
76
71
|
bool useMessageInterleaving);
|
|
77
72
|
|
|
@@ -109,6 +104,19 @@ namespace RTC
|
|
|
109
104
|
std::vector<std::pair<uint32_t /*tsn*/, UserData>> GetChunksToSend(
|
|
110
105
|
uint64_t nowMs, size_t maxLength);
|
|
111
106
|
|
|
107
|
+
#ifdef MS_TEST
|
|
108
|
+
/**
|
|
109
|
+
* Returns the internal state of all queued Chunks.
|
|
110
|
+
*
|
|
111
|
+
* @remarks
|
|
112
|
+
* - Used in tests.
|
|
113
|
+
*/
|
|
114
|
+
std::vector<std::pair<uint32_t /*tsn*/, OutstandingData::State>> GetChunkStatesForTesting() const
|
|
115
|
+
{
|
|
116
|
+
return this->outstandingData.GetChunkStatesForTesting();
|
|
117
|
+
}
|
|
118
|
+
#endif
|
|
119
|
+
|
|
112
120
|
/**
|
|
113
121
|
* Returns the next TSN that will be allocated for sent DATA Chunks.
|
|
114
122
|
*/
|
|
@@ -119,7 +127,7 @@ namespace RTC
|
|
|
119
127
|
|
|
120
128
|
uint32_t GetLastAssignedTsn() const
|
|
121
129
|
{
|
|
122
|
-
return UnwrappedTsn::AddTo(this->outstandingData.GetNextTsn(), -1).Wrap();
|
|
130
|
+
return Types::UnwrappedTsn::AddTo(this->outstandingData.GetNextTsn(), -1).Wrap();
|
|
123
131
|
}
|
|
124
132
|
|
|
125
133
|
/**
|
|
@@ -181,24 +189,24 @@ namespace RTC
|
|
|
181
189
|
bool ShouldSendForwardTsn(uint64_t nowMs);
|
|
182
190
|
|
|
183
191
|
/**
|
|
184
|
-
*
|
|
192
|
+
* Adds a FORWARD-TSN Chunk to the given Packet and returns it.
|
|
185
193
|
*/
|
|
186
|
-
|
|
194
|
+
const ForwardTsnChunk* AddForwardTsn(Packet* packet) const
|
|
187
195
|
{
|
|
188
|
-
this->outstandingData.
|
|
196
|
+
return this->outstandingData.AddForwardTsn(packet);
|
|
189
197
|
}
|
|
190
198
|
|
|
191
199
|
/**
|
|
192
|
-
*
|
|
200
|
+
* Adds an I-FORWARD-TSN Chunk to the given Packet and returns it.
|
|
193
201
|
*/
|
|
194
|
-
|
|
202
|
+
const IForwardTsnChunk* AddIForwardTsn(Packet* packet) const
|
|
195
203
|
{
|
|
196
|
-
this->outstandingData.
|
|
204
|
+
return this->outstandingData.AddIForwardTsn(packet);
|
|
197
205
|
}
|
|
198
206
|
|
|
199
207
|
/**
|
|
200
|
-
* @see
|
|
201
|
-
* to stream resetting.
|
|
208
|
+
* @see SendQueueInterface for a longer description of these methods
|
|
209
|
+
* related to stream resetting.
|
|
202
210
|
*/
|
|
203
211
|
void PrepareResetStream(uint16_t streamId);
|
|
204
212
|
bool HasStreamsReadyToBeReset() const;
|
|
@@ -206,19 +214,6 @@ namespace RTC
|
|
|
206
214
|
void CommitResetStreams();
|
|
207
215
|
void RollbackResetStreams();
|
|
208
216
|
|
|
209
|
-
#ifdef MS_TEST
|
|
210
|
-
/**
|
|
211
|
-
* Returns the internal state of all queued Chunks.
|
|
212
|
-
*
|
|
213
|
-
* @remarks
|
|
214
|
-
* - This is only used in tests.
|
|
215
|
-
*/
|
|
216
|
-
std::vector<std::pair<uint32_t /*tsn*/, OutstandingData::State>> GetChunkStatesForTesting() const
|
|
217
|
-
{
|
|
218
|
-
return this->outstandingData.GetChunkStatesForTesting();
|
|
219
|
-
}
|
|
220
|
-
#endif
|
|
221
|
-
|
|
222
217
|
private:
|
|
223
218
|
/**
|
|
224
219
|
* Returns how large a chunk will be, serialized, carrying the data.
|
|
@@ -245,13 +240,13 @@ namespace RTC
|
|
|
245
240
|
* When a SACK Chunk is received, this method will be called which may
|
|
246
241
|
* call into the `RetransmissionTimeout` to update the RTO.
|
|
247
242
|
*/
|
|
248
|
-
void UpdateRttMs(uint64_t nowMs, UnwrappedTsn cumulativeTsnAck);
|
|
243
|
+
void UpdateRttMs(uint64_t nowMs, Types::UnwrappedTsn cumulativeTsnAck);
|
|
249
244
|
|
|
250
245
|
/**
|
|
251
246
|
* If the congestion control is in "fast recovery mode", this may be
|
|
252
247
|
* exited now.
|
|
253
248
|
*/
|
|
254
|
-
void MayExitFastRecovery(UnwrappedTsn cumulativeTsnAck);
|
|
249
|
+
void MayExitFastRecovery(Types::UnwrappedTsn cumulativeTsnAck);
|
|
255
250
|
|
|
256
251
|
/**
|
|
257
252
|
* If Chunks have been ACKed, stop the retransmission timer.
|
|
@@ -260,7 +255,7 @@ namespace RTC
|
|
|
260
255
|
* - This method is NOT defined in dcsctp! See bug report:
|
|
261
256
|
* https://issues.webrtc.org/issues/505751236
|
|
262
257
|
*/
|
|
263
|
-
void StopT3RtxTimerOnIncreasedCumulativeTsnAck(UnwrappedTsn cumulativeTsnAck);
|
|
258
|
+
void StopT3RtxTimerOnIncreasedCumulativeTsnAck(Types::UnwrappedTsn cumulativeTsnAck);
|
|
264
259
|
|
|
265
260
|
/**
|
|
266
261
|
* Update the congestion control algorithm given as the cumulative ack TSN
|
|
@@ -272,7 +267,7 @@ namespace RTC
|
|
|
272
267
|
* Update the congestion control algorithm, given as packet loss has been
|
|
273
268
|
* detected, as reported in an incoming SACK Chunk.
|
|
274
269
|
*/
|
|
275
|
-
void HandlePacketLoss(UnwrappedTsn highestTsnAcked);
|
|
270
|
+
void HandlePacketLoss(Types::UnwrappedTsn highestTsnAcked);
|
|
276
271
|
|
|
277
272
|
/**
|
|
278
273
|
* Update the view of the receiver window size.
|
|
@@ -296,7 +291,7 @@ namespace RTC
|
|
|
296
291
|
|
|
297
292
|
private:
|
|
298
293
|
Listener* listener;
|
|
299
|
-
|
|
294
|
+
AssociationListenerInterface& associationListener;
|
|
300
295
|
const SctpOptions sctpOptions;
|
|
301
296
|
// If the peer supports RFC3758 "SCTP Partial Reliability Extension".
|
|
302
297
|
bool supportsPartialReliability;
|
|
@@ -305,7 +300,7 @@ namespace RTC
|
|
|
305
300
|
// The retransmission timer.
|
|
306
301
|
BackoffTimerHandleInterface* t3RtxTimer;
|
|
307
302
|
// Unwraps TSNs.
|
|
308
|
-
UnwrappedTsn::Unwrapper tsnUnwrapper;
|
|
303
|
+
Types::UnwrappedTsn::Unwrapper tsnUnwrapper;
|
|
309
304
|
// Congestion Window. Number of bytes that may be in-flight (sent, not
|
|
310
305
|
// acked).
|
|
311
306
|
size_t cwnd;
|
|
@@ -320,15 +315,13 @@ namespace RTC
|
|
|
320
315
|
uint64_t rtxBytesCount{ 0 };
|
|
321
316
|
// If set, fast recovery is enabled until this TSN has been cumulative
|
|
322
317
|
// acked.
|
|
323
|
-
std::optional<UnwrappedTsn> fastRecoveryExitTsn{ std::nullopt };
|
|
318
|
+
std::optional<Types::UnwrappedTsn> fastRecoveryExitTsn{ std::nullopt };
|
|
324
319
|
// The send queue.
|
|
325
|
-
|
|
326
|
-
// SendQueue& sendQueue;
|
|
320
|
+
SendQueueInterface& sendQueue;
|
|
327
321
|
// All the outstanding data Chunks that are in-flight and that have not
|
|
328
322
|
// been cumulative acked. Note that it also contains chunks that have been
|
|
329
323
|
// acked in gap-ack-blocks.
|
|
330
324
|
OutstandingData outstandingData;
|
|
331
|
-
// TODO: SCTP.
|
|
332
325
|
};
|
|
333
326
|
} // namespace SCTP
|
|
334
327
|
} // namespace RTC
|
|
@@ -52,13 +52,13 @@ namespace RTC
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
private:
|
|
55
|
-
uint64_t minRtoMs
|
|
56
|
-
uint64_t maxRtoMs
|
|
57
|
-
uint64_t maxRttMs
|
|
58
|
-
uint64_t minRttVarianceMs
|
|
59
|
-
double srttMs
|
|
55
|
+
uint64_t minRtoMs;
|
|
56
|
+
uint64_t maxRtoMs;
|
|
57
|
+
uint64_t maxRttMs;
|
|
58
|
+
uint64_t minRttVarianceMs;
|
|
59
|
+
double srttMs;
|
|
60
|
+
double rtoMs;
|
|
60
61
|
double rttVarMs{ 0 };
|
|
61
|
-
double rtoMs{ 0 };
|
|
62
62
|
bool firstMeasurement{ false };
|
|
63
63
|
};
|
|
64
64
|
} // namespace SCTP
|
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
#ifndef MS_RTC_SCTP_ROUND_ROBIN_SEND_QUEUE_HPP
|
|
2
|
+
#define MS_RTC_SCTP_ROUND_ROBIN_SEND_QUEUE_HPP
|
|
3
|
+
|
|
4
|
+
#include "common.hpp"
|
|
5
|
+
#include "RTC/SCTP/public/AssociationListenerInterface.hpp"
|
|
6
|
+
#include "RTC/SCTP/public/Message.hpp"
|
|
7
|
+
#include "RTC/SCTP/public/SctpOptions.hpp"
|
|
8
|
+
#include "RTC/SCTP/tx/SendQueueInterface.hpp"
|
|
9
|
+
#include "RTC/SCTP/tx/StreamScheduler.hpp"
|
|
10
|
+
#include <deque>
|
|
11
|
+
#include <map>
|
|
12
|
+
#include <vector>
|
|
13
|
+
|
|
14
|
+
namespace RTC
|
|
15
|
+
{
|
|
16
|
+
namespace SCTP
|
|
17
|
+
{
|
|
18
|
+
/**
|
|
19
|
+
* The Round Robin send queue holds all messages that the client wants to
|
|
20
|
+
* send, but that haven't yet been split into chunks and fully sent on the
|
|
21
|
+
* wire.
|
|
22
|
+
*
|
|
23
|
+
* As defined in https://datatracker.ietf.org/doc/html/rfc8260#section-3.2,
|
|
24
|
+
* it will cycle to send messages from different streams. It will send all
|
|
25
|
+
* fragments from one message before continuing with a different message on
|
|
26
|
+
* possibly a different stream, until support for message interleaving has
|
|
27
|
+
* been implemented.
|
|
28
|
+
*
|
|
29
|
+
* As messages can be (requested to be) sent before the connection is
|
|
30
|
+
* properly established, this send queue is always present - even for closed
|
|
31
|
+
* connections.
|
|
32
|
+
*
|
|
33
|
+
* The send queue may trigger callbacks. `OnAssociationStreamBufferedAmountLow()`
|
|
34
|
+
* and `OnAssociationTotalBufferedAmountLow()` will be triggered as defined in
|
|
35
|
+
* their documentation. `OnAssociationLifecycleMessageExpired()` with
|
|
36
|
+
* `maybeDelivered=false` and `OnAssociationLifecycleMessageEnd()` will be
|
|
37
|
+
* triggered when messages have been expired, abandoned or discarded from the
|
|
38
|
+
* send queue. If a message is fully produced, meaning that the last fragment
|
|
39
|
+
* has been produced, the responsibility to send lifecycle events is then
|
|
40
|
+
* transferred to the retransmission queue, which is the one asking to
|
|
41
|
+
* produce the message.
|
|
42
|
+
*/
|
|
43
|
+
class RoundRobinSendQueue : public SendQueueInterface
|
|
44
|
+
{
|
|
45
|
+
private:
|
|
46
|
+
struct MessageAttributes
|
|
47
|
+
{
|
|
48
|
+
bool isUnordered;
|
|
49
|
+
uint16_t maxRetransmissions;
|
|
50
|
+
uint64_t expiresAtMs;
|
|
51
|
+
std::optional<uint64_t> lifecycleId;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
private:
|
|
55
|
+
/**
|
|
56
|
+
* Represents a value and a "low threshold" that when the value reaches or
|
|
57
|
+
* goes under the "low threshold", will trigger `onThresholdReached()`
|
|
58
|
+
* callback.
|
|
59
|
+
*/
|
|
60
|
+
class ThresholdWatcher
|
|
61
|
+
{
|
|
62
|
+
public:
|
|
63
|
+
explicit ThresholdWatcher(std::function<void()> onThresholdReached)
|
|
64
|
+
: onThresholdReached(std::move(onThresholdReached))
|
|
65
|
+
{
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Increases the value.
|
|
70
|
+
*/
|
|
71
|
+
void Increase(size_t bytes)
|
|
72
|
+
{
|
|
73
|
+
this->value += bytes;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Decreases the value and triggers `onThresholdReached()` if it's at
|
|
78
|
+
* or below `this->lowThreshold`.
|
|
79
|
+
*/
|
|
80
|
+
void Decrease(size_t bytes);
|
|
81
|
+
|
|
82
|
+
size_t GetValue() const
|
|
83
|
+
{
|
|
84
|
+
return this->value;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
size_t GetLowThreshold() const
|
|
88
|
+
{
|
|
89
|
+
return this->lowThreshold;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
void SetLowThreshold(size_t lowThreshold);
|
|
93
|
+
|
|
94
|
+
private:
|
|
95
|
+
const std::function<void()> onThresholdReached;
|
|
96
|
+
size_t value{ 0 };
|
|
97
|
+
size_t lowThreshold{ 0 };
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
private:
|
|
101
|
+
/**
|
|
102
|
+
* Per-stream information.
|
|
103
|
+
*/
|
|
104
|
+
class OutgoingStream : public StreamScheduler::StreamProducer
|
|
105
|
+
{
|
|
106
|
+
public:
|
|
107
|
+
OutgoingStream(
|
|
108
|
+
RoundRobinSendQueue* parent,
|
|
109
|
+
StreamScheduler* scheduler,
|
|
110
|
+
uint16_t streamId,
|
|
111
|
+
uint16_t priority,
|
|
112
|
+
std::function<void()> onBufferedAmountLow)
|
|
113
|
+
: parent(*parent),
|
|
114
|
+
schedulerStream(scheduler->CreateStream(this, streamId, priority)),
|
|
115
|
+
bufferedAmountThresholdWatcher(std::move(onBufferedAmountLow))
|
|
116
|
+
{
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
uint16_t GetStreamId() const
|
|
120
|
+
{
|
|
121
|
+
return this->schedulerStream->GetStreamId();
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Enqueues a message to this stream.
|
|
126
|
+
*/
|
|
127
|
+
void AddMessage(Message message, MessageAttributes attributes);
|
|
128
|
+
|
|
129
|
+
// Implementing `StreamScheduler::StreamProducer`.
|
|
130
|
+
|
|
131
|
+
std::optional<SendQueueInterface::DataToSend> Produce(uint64_t nowMs, size_t maxLength) override;
|
|
132
|
+
|
|
133
|
+
size_t GetBytesToSendInNextMessage() const override;
|
|
134
|
+
|
|
135
|
+
const ThresholdWatcher& GetBufferedAmount() const
|
|
136
|
+
{
|
|
137
|
+
return bufferedAmountThresholdWatcher;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
ThresholdWatcher& GetBufferedAmount()
|
|
141
|
+
{
|
|
142
|
+
return bufferedAmountThresholdWatcher;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Discards a partially sent message, see `SendQueue::Discard()`.
|
|
147
|
+
*/
|
|
148
|
+
bool Discard(uint32_t outgoingMessageId);
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Pauses this stream, which is used before resetting it.
|
|
152
|
+
*/
|
|
153
|
+
void Pause();
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Resumes a paused stream.
|
|
157
|
+
*/
|
|
158
|
+
void Resume();
|
|
159
|
+
|
|
160
|
+
bool IsReadyToBeReset() const
|
|
161
|
+
{
|
|
162
|
+
return this->pauseState == PauseState::PAUSED;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
bool IsResetting() const
|
|
166
|
+
{
|
|
167
|
+
return this->pauseState == PauseState::RESETTING;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
void SetAsResetting();
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Resets this stream, meaning MIDs and SSNs are set to zero.
|
|
174
|
+
*/
|
|
175
|
+
void Reset();
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Indicates if this stream has a partially sent message in it.
|
|
179
|
+
*/
|
|
180
|
+
bool HasPartiallySentMessage() const;
|
|
181
|
+
|
|
182
|
+
uint16_t GetPriority() const
|
|
183
|
+
{
|
|
184
|
+
return this->schedulerStream->GetPriority();
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
void SetPriority(uint16_t priority)
|
|
188
|
+
{
|
|
189
|
+
this->schedulerStream->SetPriority(priority);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
private:
|
|
193
|
+
/**
|
|
194
|
+
* Streams are paused before they can be reset. To reset a stream, the
|
|
195
|
+
* socket sends an outgoing stream reset command with the TSN of the last
|
|
196
|
+
* fragment of the last message, so that receivers and senders can agree
|
|
197
|
+
* on when it stopped. And if the send queue is in the middle of sending
|
|
198
|
+
* a message, and without fragments not yet sent and without TSNs
|
|
199
|
+
* allocated to them, it will keep sending data until that message has
|
|
200
|
+
* ended.
|
|
201
|
+
*/
|
|
202
|
+
enum class PauseState : uint8_t
|
|
203
|
+
{
|
|
204
|
+
/**
|
|
205
|
+
* The stream is not paused, and not scheduled to be reset.
|
|
206
|
+
*/
|
|
207
|
+
NOT_PAUSED,
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* The stream has requested to be reset/paused but is still producing
|
|
211
|
+
* fragments of a message that hasn't ended yet. When it does, it will
|
|
212
|
+
* transition to the `PAUSED` state.
|
|
213
|
+
*/
|
|
214
|
+
PENDING,
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* The stream is fully paused and can be reset.
|
|
218
|
+
*/
|
|
219
|
+
PAUSED,
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* The stream has been added to an outgoing stream reset request and a
|
|
223
|
+
* response from the peer hasn't been received yet.
|
|
224
|
+
*/
|
|
225
|
+
RESETTING,
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
// An enqueued message and metadata.
|
|
229
|
+
struct Item
|
|
230
|
+
{
|
|
231
|
+
explicit Item(uint32_t outgoingMessageId, Message msg, MessageAttributes attributes)
|
|
232
|
+
: outgoingMessageId(outgoingMessageId),
|
|
233
|
+
message(std::move(msg)),
|
|
234
|
+
attributes(attributes),
|
|
235
|
+
remainingLength(message.GetPayloadLength())
|
|
236
|
+
{
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
uint32_t outgoingMessageId;
|
|
240
|
+
Message message;
|
|
241
|
+
MessageAttributes attributes;
|
|
242
|
+
// The remaining payload (offset and length) to be sent, when it has
|
|
243
|
+
// been fragmented.
|
|
244
|
+
size_t remainingOffset{ 0 };
|
|
245
|
+
size_t remainingLength;
|
|
246
|
+
// If set, an allocated Message ID and SSN. Will be allocated when the
|
|
247
|
+
// first fragment is sent.
|
|
248
|
+
std::optional<uint32_t> mid{ std::nullopt };
|
|
249
|
+
std::optional<uint16_t> ssn{ std::nullopt };
|
|
250
|
+
// The current Fragment Sequence Number, incremented for each fragment.
|
|
251
|
+
uint32_t currentFsn{ 0 };
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
void HandleMessageExpired(OutgoingStream::Item& item);
|
|
255
|
+
|
|
256
|
+
void AssertIsConsistent() const;
|
|
257
|
+
|
|
258
|
+
private:
|
|
259
|
+
RoundRobinSendQueue& parent;
|
|
260
|
+
const std::unique_ptr<StreamScheduler::Stream> schedulerStream;
|
|
261
|
+
// The current amount of buffered data.
|
|
262
|
+
ThresholdWatcher bufferedAmountThresholdWatcher;
|
|
263
|
+
PauseState pauseState = PauseState::NOT_PAUSED;
|
|
264
|
+
// MIDs are different for unordered and ordered messages sent on a
|
|
265
|
+
// stream.
|
|
266
|
+
uint32_t nextUnorderedMid{ 0 };
|
|
267
|
+
uint32_t nextOrderedMid{ 0 };
|
|
268
|
+
uint16_t nextSsn{ 0 };
|
|
269
|
+
// Enqueued messages, and metadata.
|
|
270
|
+
std::deque<Item> items;
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
public:
|
|
274
|
+
RoundRobinSendQueue(
|
|
275
|
+
AssociationListenerInterface& associationListener,
|
|
276
|
+
size_t mtu,
|
|
277
|
+
uint16_t defaultPriority,
|
|
278
|
+
size_t totalBufferedAmountLowThreshold);
|
|
279
|
+
|
|
280
|
+
~RoundRobinSendQueue() override;
|
|
281
|
+
|
|
282
|
+
public:
|
|
283
|
+
/**
|
|
284
|
+
* Indicates if the buffer is empty.
|
|
285
|
+
*/
|
|
286
|
+
bool IsEmpty() const
|
|
287
|
+
{
|
|
288
|
+
return GetTotalBufferedAmount() == 0;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Adds the message to be sent using the `sendMessageOptions` provided.
|
|
293
|
+
* The current time should be in `nowMs`. Note that it's the responsibility
|
|
294
|
+
* of the caller to ensure that the buffer is not full (by calling
|
|
295
|
+
* `IsFull()`) before adding messages to it.
|
|
296
|
+
*/
|
|
297
|
+
void AddMessage(
|
|
298
|
+
uint64_t nowMs, Message message, const SendMessageOptions& sendMessageOptions = {});
|
|
299
|
+
|
|
300
|
+
uint16_t GetStreamPriority(uint16_t streamId) const;
|
|
301
|
+
|
|
302
|
+
void SetStreamPriority(uint16_t streamId, uint16_t priority);
|
|
303
|
+
|
|
304
|
+
// Methods implementing `SendQueueInterface`.
|
|
305
|
+
public:
|
|
306
|
+
void EnableMessageInterleaving(bool enabled) override
|
|
307
|
+
{
|
|
308
|
+
this->scheduler.EnableMessageInterleaving(enabled);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
std::optional<SendQueueInterface::DataToSend> Produce(uint64_t nowMs, size_t maxLength) override;
|
|
312
|
+
|
|
313
|
+
bool Discard(uint16_t streamId, uint32_t outgoingMessageId) override;
|
|
314
|
+
|
|
315
|
+
void PrepareResetStream(uint16_t streamId) override;
|
|
316
|
+
|
|
317
|
+
bool HasStreamsReadyToBeReset() const override;
|
|
318
|
+
|
|
319
|
+
std::vector<uint16_t> GetStreamsReadyToBeReset() override;
|
|
320
|
+
|
|
321
|
+
void CommitResetStreams() override;
|
|
322
|
+
|
|
323
|
+
void RollbackResetStreams() override;
|
|
324
|
+
|
|
325
|
+
void Reset() override;
|
|
326
|
+
|
|
327
|
+
size_t GetStreamBufferedAmount(uint16_t streamId) const override;
|
|
328
|
+
|
|
329
|
+
size_t GetTotalBufferedAmount() const override
|
|
330
|
+
{
|
|
331
|
+
return this->totalBufferedAmountThresholdWatcher.GetValue();
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
size_t GetStreamBufferedAmountLowThreshold(uint16_t streamId) const override;
|
|
335
|
+
|
|
336
|
+
void SetStreamBufferedAmountLowThreshold(uint16_t streamId, size_t bytes) override;
|
|
337
|
+
|
|
338
|
+
private:
|
|
339
|
+
OutgoingStream& GetOrCreateStreamInfo(uint16_t streamId);
|
|
340
|
+
|
|
341
|
+
void AssertIsConsistent() const;
|
|
342
|
+
|
|
343
|
+
private:
|
|
344
|
+
AssociationListenerInterface& associationListener;
|
|
345
|
+
const uint16_t defaultPriority;
|
|
346
|
+
StreamScheduler scheduler;
|
|
347
|
+
// The total amount of buffer data, for all streams.
|
|
348
|
+
ThresholdWatcher totalBufferedAmountThresholdWatcher;
|
|
349
|
+
uint32_t currentOutgoingMessageId{ 0 };
|
|
350
|
+
// All streams, and messages added to those.
|
|
351
|
+
std::map<uint16_t, OutgoingStream> streams;
|
|
352
|
+
};
|
|
353
|
+
} // namespace SCTP
|
|
354
|
+
} // namespace RTC
|
|
355
|
+
|
|
356
|
+
#endif
|