mediasoup 3.19.21 → 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 +2 -1
- package/node/lib/Worker.d.ts.map +1 -1
- package/node/lib/Worker.js +71 -25
- 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 +13 -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 +13 -3
- 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 +14 -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/ChannelMessageRegistrator.hpp +39 -0
- package/worker/include/Channel/ChannelMessageRegistratorInterface.hpp +32 -0
- package/worker/include/Channel/ChannelRequest.hpp +1 -1
- package/worker/include/Channel/ChannelSocket.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 +11 -9
- package/worker/include/RTC/AudioLevelObserver.hpp +7 -7
- package/worker/include/RTC/Consumer.hpp +3 -3
- package/worker/include/RTC/DataConsumer.hpp +13 -17
- package/worker/include/RTC/DataProducer.hpp +6 -9
- package/worker/include/RTC/DirectTransport.hpp +4 -6
- package/worker/include/RTC/DtlsTransport.hpp +13 -11
- package/worker/include/RTC/ICE/IceServer.hpp +8 -5
- package/worker/include/RTC/ICE/StunPacket.hpp +1 -1
- package/worker/include/RTC/KeyFrameRequestManager.hpp +15 -12
- package/worker/include/RTC/NackGenerator.hpp +8 -6
- package/worker/include/RTC/PipeConsumer.hpp +1 -2
- package/worker/include/RTC/PipeTransport.hpp +4 -6
- package/worker/include/RTC/PlainTransport.hpp +4 -6
- package/worker/include/RTC/PortManager.hpp +1 -1
- package/worker/include/RTC/Producer.hpp +3 -3
- 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 +17 -12
- package/worker/include/RTC/RTP/RtpStreamRecv.hpp +8 -6
- package/worker/include/RTC/RTP/RtpStreamSend.hpp +4 -1
- 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 +7 -8
- package/worker/include/RTC/RtpObserver.hpp +3 -3
- package/worker/include/RTC/SCTP/association/Association.hpp +53 -19
- package/worker/include/RTC/SCTP/association/AssociationListenerDeferrer.hpp +14 -6
- package/worker/include/RTC/SCTP/association/HeartbeatHandler.hpp +18 -14
- 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 +49 -35
- package/worker/include/RTC/SCTP/association/TransmissionControlBlock.hpp +114 -31
- package/worker/include/RTC/SCTP/association/{TCBContext.hpp → TransmissionControlBlockContextInterface.hpp} +14 -8
- 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 +61 -17
- 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 +28 -19
- 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 +595 -0
- package/worker/include/RTC/SCTP/tx/RetransmissionErrorCounter.hpp +3 -3
- package/worker/include/RTC/SCTP/tx/RetransmissionQueue.hpp +329 -0
- package/worker/include/RTC/SCTP/tx/RetransmissionTimeout.hpp +11 -10
- 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 +11 -3
- package/worker/include/RTC/SimpleConsumer.hpp +1 -2
- package/worker/include/RTC/SimulcastConsumer.hpp +1 -2
- package/worker/include/RTC/SvcConsumer.hpp +1 -2
- package/worker/include/RTC/TcpServer.hpp +2 -2
- package/worker/include/RTC/Transport.hpp +65 -86
- package/worker/include/RTC/TransportCongestionControlClient.hpp +8 -5
- package/worker/include/RTC/TransportCongestionControlServer.hpp +8 -5
- package/worker/include/RTC/TransportTuple.hpp +1 -1
- package/worker/include/RTC/UdpSocket.hpp +1 -1
- package/worker/include/RTC/WebRtcServer.hpp +3 -3
- package/worker/include/RTC/WebRtcTransport.hpp +5 -7
- package/worker/include/Settings.hpp +2 -3
- package/worker/include/Shared.hpp +64 -0
- package/worker/include/SharedInterface.hpp +77 -0
- package/worker/include/Utils/UnwrappedSequenceNumber.hpp +270 -0
- package/worker/include/Utils.hpp +10 -4
- package/worker/include/Worker.hpp +6 -6
- package/worker/include/common.hpp +12 -12
- package/worker/include/handles/BackoffTimerHandle.hpp +28 -67
- package/worker/include/handles/BackoffTimerHandleInterface.hpp +123 -0
- package/worker/include/handles/TimerHandle.hpp +29 -20
- package/worker/include/handles/TimerHandleInterface.hpp +43 -0
- package/worker/meson.build +45 -29
- package/worker/meson_options.txt +2 -1
- package/worker/mocks/include/Channel/MockChannelMessageRegistrator.hpp +45 -0
- package/worker/mocks/include/MockShared.hpp +90 -0
- 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/Channel/MockChannelMessageRegistrator.cpp +128 -0
- package/worker/mocks/src/MockShared.cpp +46 -0
- 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 +5 -1
- package/worker/scripts/package-lock.json +6 -7
- package/worker/src/Channel/ChannelMessageRegistrator.cpp +125 -0
- package/worker/src/Channel/ChannelSocket.cpp +3 -4
- 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 +14 -14
- package/worker/src/RTC/AudioLevelObserver.cpp +12 -10
- package/worker/src/RTC/Consumer.cpp +28 -26
- package/worker/src/RTC/DataConsumer.cpp +61 -71
- package/worker/src/RTC/DataProducer.cpp +16 -11
- package/worker/src/RTC/DirectTransport.cpp +21 -20
- package/worker/src/RTC/DtlsTransport.cpp +4 -4
- package/worker/src/RTC/ICE/IceServer.cpp +6 -5
- package/worker/src/RTC/ICE/StunPacket.cpp +1 -1
- package/worker/src/RTC/KeyFrameRequestManager.cpp +15 -15
- package/worker/src/RTC/NackGenerator.cpp +6 -6
- package/worker/src/RTC/PipeConsumer.cpp +6 -5
- package/worker/src/RTC/PipeTransport.cpp +9 -22
- package/worker/src/RTC/PlainTransport.cpp +16 -28
- package/worker/src/RTC/Producer.cpp +40 -39
- package/worker/src/RTC/RTCP/FeedbackPsAfb.cpp +1 -1
- package/worker/src/RTC/RTCP/FeedbackPsRpsi.cpp +1 -2
- 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 +17 -10
- package/worker/src/RTC/RTP/RtpStreamRecv.cpp +16 -14
- package/worker/src/RTC/RTP/RtpStreamSend.cpp +12 -9
- 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 +61 -38
- package/worker/src/RTC/RtpDictionaries/RtpCodecMimeType.cpp +1 -1
- package/worker/src/RTC/RtpObserver.cpp +2 -1
- package/worker/src/RTC/SCTP/LICENSE +44 -0
- package/worker/src/RTC/SCTP/association/Association.cpp +417 -411
- package/worker/src/RTC/SCTP/association/AssociationListenerDeferrer.cpp +46 -13
- package/worker/src/RTC/SCTP/association/HeartbeatHandler.cpp +47 -43
- package/worker/src/RTC/SCTP/association/PacketSender.cpp +8 -8
- package/worker/src/RTC/SCTP/association/StreamResetHandler.cpp +113 -101
- package/worker/src/RTC/SCTP/association/TransmissionControlBlock.cpp +291 -62
- 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 +912 -0
- package/worker/src/RTC/SCTP/tx/RetransmissionQueue.cpp +786 -0
- package/worker/src/RTC/SCTP/tx/RetransmissionTimeout.cpp +2 -2
- 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 +11 -11
- package/worker/src/RTC/SimulcastConsumer.cpp +16 -16
- package/worker/src/RTC/SrtpSession.cpp +1 -1
- package/worker/src/RTC/SvcConsumer.cpp +16 -16
- package/worker/src/RTC/TcpConnection.cpp +1 -1
- package/worker/src/RTC/Transport.cpp +497 -563
- package/worker/src/RTC/TransportCongestionControlClient.cpp +9 -8
- package/worker/src/RTC/TransportCongestionControlServer.cpp +5 -5
- package/worker/src/RTC/WebRtcServer.cpp +5 -4
- package/worker/src/RTC/WebRtcTransport.cpp +44 -39
- package/worker/src/Settings.cpp +9 -28
- package/worker/src/Shared.cpp +35 -0
- package/worker/src/Utils/Crypto.cpp +1 -1
- package/worker/src/Utils/String.cpp +1 -1
- package/worker/src/Worker.cpp +19 -48
- package/worker/src/handles/BackoffTimerHandle.cpp +34 -21
- package/worker/src/handles/TimerHandle.cpp +5 -4
- package/worker/src/handles/UdpSocketHandle.cpp +1 -1
- package/worker/src/lib.cpp +17 -16
- package/worker/subprojects/catch2.wrap +6 -6
- package/worker/tasks.py +1 -1
- package/worker/test/include/RTC/ICE/iceCommon.hpp +8 -7
- package/worker/test/include/RTC/RTP/rtpCommon.hpp +7 -6
- package/worker/test/include/RTC/SCTP/sctpCommon.hpp +16 -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 +16 -9
- package/worker/test/src/RTC/RTP/TestRtpStreamSend.cpp +38 -23
- 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 +1248 -0
- 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/TestRetransmissionTimeout.cpp +33 -33
- 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 +20 -30
- package/worker/test/src/RTC/TestNackGenerator.cpp +11 -8
- package/worker/test/src/RTC/TestRateCalculator.cpp +6 -7
- package/worker/test/src/RTC/TestSimpleConsumer.cpp +11 -11
- package/worker/test/src/RTC/TestTransportCongestionControlServer.cpp +15 -3
- package/worker/test/src/Utils/TestByte.cpp +98 -0
- 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/ChannelMessageRegistrator.hpp +0 -30
- package/worker/include/DepUsrSCTP.hpp +0 -48
- package/worker/include/RTC/SCTP/TODO_SCTP.md +0 -43
- package/worker/include/RTC/SCTP/common/UnwrappedSequenceNumber.hpp +0 -274
- package/worker/include/RTC/SctpAssociation.hpp +0 -147
- package/worker/include/RTC/Shared.hpp +0 -23
- package/worker/src/ChannelMessageRegistrator.cpp +0 -119
- package/worker/src/DepUsrSCTP.cpp +0 -277
- package/worker/src/RTC/SctpAssociation.cpp +0 -1175
- package/worker/src/RTC/Shared.cpp +0 -23
- package/worker/subprojects/usrsctp.wrap +0 -8
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
#define MS_CLASS "RTC::SCTP::StreamScheduler"
|
|
2
|
+
// #define MS_LOG_DEV_LEVEL 3
|
|
3
|
+
|
|
4
|
+
#include "RTC/SCTP/tx/StreamScheduler.hpp"
|
|
5
|
+
#include "Logger.hpp"
|
|
6
|
+
#include <ranges>
|
|
7
|
+
|
|
8
|
+
namespace RTC
|
|
9
|
+
{
|
|
10
|
+
namespace SCTP
|
|
11
|
+
{
|
|
12
|
+
/* Instance methods. */
|
|
13
|
+
|
|
14
|
+
std::optional<SendQueueInterface::DataToSend> StreamScheduler::Produce(uint64_t nowMs, size_t maxLength)
|
|
15
|
+
{
|
|
16
|
+
MS_TRACE();
|
|
17
|
+
|
|
18
|
+
// For non-interleaved streams, avoid rescheduling while still sending a
|
|
19
|
+
// message as it needs to be sent in full. For interleaved messaging,
|
|
20
|
+
// reschedule for every I-DATA chunk sent.
|
|
21
|
+
const bool rescheduling = this->enableMessageInterleaving || !this->currentlySendingAMessage;
|
|
22
|
+
|
|
23
|
+
MS_DEBUG_DEV("producing data, rescheduling");
|
|
24
|
+
|
|
25
|
+
MS_ASSERT(
|
|
26
|
+
rescheduling || this->currentStream,
|
|
27
|
+
"it must be rescheduling or there should be current stream");
|
|
28
|
+
|
|
29
|
+
std::optional<SendQueueInterface::DataToSend> dataToSend;
|
|
30
|
+
|
|
31
|
+
while (!dataToSend.has_value() && !this->activeStreams.empty())
|
|
32
|
+
{
|
|
33
|
+
if (rescheduling)
|
|
34
|
+
{
|
|
35
|
+
const auto it = this->activeStreams.begin();
|
|
36
|
+
|
|
37
|
+
this->currentStream = *it;
|
|
38
|
+
|
|
39
|
+
MS_DEBUG_DEV("rescheduling to streamId %" PRIu16, this->currentStream->GetStreamId());
|
|
40
|
+
|
|
41
|
+
this->activeStreams.erase(it);
|
|
42
|
+
this->currentStream->ForceMarkInactive();
|
|
43
|
+
}
|
|
44
|
+
else
|
|
45
|
+
{
|
|
46
|
+
MS_DEBUG_DEV(
|
|
47
|
+
"producing from previous streamId %" PRIu16, this->currentStream->GetStreamId());
|
|
48
|
+
|
|
49
|
+
MS_ASSERT(
|
|
50
|
+
std::ranges::any_of(
|
|
51
|
+
this->activeStreams,
|
|
52
|
+
[this](const auto* stream)
|
|
53
|
+
{
|
|
54
|
+
return stream == this->currentStream;
|
|
55
|
+
}),
|
|
56
|
+
"current stream should be in active streams");
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
dataToSend = this->currentStream->Produce(nowMs, maxLength);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (!dataToSend.has_value())
|
|
63
|
+
{
|
|
64
|
+
MS_DEBUG_DEV("there is no stream with data, cannot produce any data");
|
|
65
|
+
|
|
66
|
+
AssertIsConsistent();
|
|
67
|
+
|
|
68
|
+
return std::nullopt;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
MS_ASSERT(
|
|
72
|
+
dataToSend->data.GetStreamId() == this->currentStream->GetStreamId(),
|
|
73
|
+
"no matching stream id");
|
|
74
|
+
|
|
75
|
+
MS_DEBUG_DEV(
|
|
76
|
+
"producing data [type:%s, beginning:%s, end:%s, streamId:%" PRIu16 ", ppid:%" PRIu32
|
|
77
|
+
", length:%zu]",
|
|
78
|
+
dataToSend->data.IsUnordered() ? "unordered" : "ordered",
|
|
79
|
+
dataToSend->data.IsBeginning() ? "yes" : "no",
|
|
80
|
+
dataToSend->data.IsEnd() ? "yes" : "no",
|
|
81
|
+
dataToSend->data.GetStreamId(),
|
|
82
|
+
dataToSend->data.GetPayloadProtocolId(),
|
|
83
|
+
dataToSend->data.GetPayloadLength());
|
|
84
|
+
|
|
85
|
+
this->currentlySendingAMessage = !dataToSend->data.IsEnd();
|
|
86
|
+
this->virtualTime = this->currentStream->GetCurrentTime();
|
|
87
|
+
|
|
88
|
+
// One side-effect of rescheduling is that the new stream will not be
|
|
89
|
+
// present in `this->activeStreams`.
|
|
90
|
+
const size_t bytesToSendNext = this->currentStream->GetBytesToSendInNextMessage();
|
|
91
|
+
|
|
92
|
+
if (rescheduling && bytesToSendNext > 0)
|
|
93
|
+
{
|
|
94
|
+
this->currentStream->MakeActive(bytesToSendNext);
|
|
95
|
+
}
|
|
96
|
+
else if (!rescheduling && bytesToSendNext == 0)
|
|
97
|
+
{
|
|
98
|
+
this->currentStream->MakeInactive();
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
AssertIsConsistent();
|
|
102
|
+
|
|
103
|
+
return dataToSend;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
std::set<uint16_t> StreamScheduler::GetActiveStreamsForTesting() const
|
|
107
|
+
{
|
|
108
|
+
MS_TRACE();
|
|
109
|
+
|
|
110
|
+
std::set<uint16_t> streamIds;
|
|
111
|
+
|
|
112
|
+
for (const auto& stream : this->activeStreams)
|
|
113
|
+
{
|
|
114
|
+
streamIds.insert(stream->GetStreamId());
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return streamIds;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
void StreamScheduler::AssertIsConsistent() const
|
|
121
|
+
{
|
|
122
|
+
MS_TRACE();
|
|
123
|
+
|
|
124
|
+
for (const Stream* stream : this->activeStreams)
|
|
125
|
+
{
|
|
126
|
+
if (stream->GetNextFinishTime() == 0)
|
|
127
|
+
{
|
|
128
|
+
MS_ASSERT(
|
|
129
|
+
stream->GetNextFinishTime() > 0,
|
|
130
|
+
"stream %" PRIu16 " is active but has no next-finish-time",
|
|
131
|
+
stream->GetStreamId());
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
void StreamScheduler::Stream::SetPriority(uint16_t priority)
|
|
137
|
+
{
|
|
138
|
+
MS_TRACE();
|
|
139
|
+
|
|
140
|
+
this->priority = priority;
|
|
141
|
+
this->inverseWeight = 1.0 / std::max(static_cast<double>(priority), 1e-6);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
void StreamScheduler::Stream::MayMakeActive()
|
|
145
|
+
{
|
|
146
|
+
MS_TRACE();
|
|
147
|
+
|
|
148
|
+
MS_ASSERT(this->nextFinishTime == 0, "next-finish-time must be 0");
|
|
149
|
+
|
|
150
|
+
const size_t bytesToSendNext = GetBytesToSendInNextMessage();
|
|
151
|
+
|
|
152
|
+
if (bytesToSendNext == 0)
|
|
153
|
+
{
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
MakeActive(bytesToSendNext);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
void StreamScheduler::Stream::MakeActive(size_t bytesToSendNext)
|
|
161
|
+
{
|
|
162
|
+
MS_TRACE();
|
|
163
|
+
|
|
164
|
+
this->currentVirtualTime = this->parent.virtualTime;
|
|
165
|
+
|
|
166
|
+
MS_ASSERT(bytesToSendNext > 0, "bytesToSendNext must be higher than 0");
|
|
167
|
+
|
|
168
|
+
const double nextFinishTime =
|
|
169
|
+
CalculateFinishTime(std::min(bytesToSendNext, this->parent.maxPayloadBytes));
|
|
170
|
+
|
|
171
|
+
MS_ASSERT(nextFinishTime > 0, "nextFinishTime must be higher than 0");
|
|
172
|
+
|
|
173
|
+
MS_DEBUG_DEV(
|
|
174
|
+
"making streamId %" PRIu16 " active, expiring at %f", GetStreamId(), nextFinishTime);
|
|
175
|
+
|
|
176
|
+
MS_ASSERT(this->nextFinishTime == 0, "this->nextFinishTime must be 0");
|
|
177
|
+
|
|
178
|
+
this->nextFinishTime = nextFinishTime;
|
|
179
|
+
|
|
180
|
+
MS_ASSERT(
|
|
181
|
+
!std::ranges::any_of(
|
|
182
|
+
this->parent.activeStreams,
|
|
183
|
+
[this](const auto* stream)
|
|
184
|
+
{
|
|
185
|
+
return stream == this;
|
|
186
|
+
}),
|
|
187
|
+
"this stream must not be in active streams");
|
|
188
|
+
|
|
189
|
+
this->parent.activeStreams.emplace(this);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
void StreamScheduler::Stream::ForceMarkInactive()
|
|
193
|
+
{
|
|
194
|
+
MS_TRACE();
|
|
195
|
+
|
|
196
|
+
MS_DEBUG_DEV("making streamId %" PRIu16 " inactive", GetStreamId());
|
|
197
|
+
|
|
198
|
+
MS_ASSERT(this->nextFinishTime != 0, "this->nextFinishTime must be different than 0");
|
|
199
|
+
|
|
200
|
+
this->nextFinishTime = 0;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
void StreamScheduler::Stream::MakeInactive()
|
|
204
|
+
{
|
|
205
|
+
MS_TRACE();
|
|
206
|
+
|
|
207
|
+
ForceMarkInactive();
|
|
208
|
+
|
|
209
|
+
std::erase_if(
|
|
210
|
+
this->parent.activeStreams,
|
|
211
|
+
[this](const auto* stream)
|
|
212
|
+
{
|
|
213
|
+
return stream == this;
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
double StreamScheduler::Stream::CalculateFinishTime(size_t bytesToSendNext) const
|
|
218
|
+
{
|
|
219
|
+
MS_TRACE();
|
|
220
|
+
|
|
221
|
+
if (this->parent.enableMessageInterleaving)
|
|
222
|
+
{
|
|
223
|
+
// Perform weighted fair queuing scheduling.
|
|
224
|
+
return this->currentVirtualTime +
|
|
225
|
+
(static_cast<double>(bytesToSendNext) * this->inverseWeight);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// Perform round-robin scheduling by letting the stream have its next
|
|
229
|
+
// virtual finish time in the future. It doesn't matter how far into the
|
|
230
|
+
// future, just any positive number so that any other stream that has the
|
|
231
|
+
// same virtual finish time as this stream gets to produce their data
|
|
232
|
+
// before revisiting this stream.
|
|
233
|
+
return this->currentVirtualTime + 1;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
std::optional<SendQueueInterface::DataToSend> StreamScheduler::Stream::Produce(
|
|
237
|
+
uint64_t nowMs, size_t maxLength)
|
|
238
|
+
{
|
|
239
|
+
MS_TRACE();
|
|
240
|
+
|
|
241
|
+
std::optional<SendQueueInterface::DataToSend> dataToSend =
|
|
242
|
+
this->producer.Produce(nowMs, maxLength);
|
|
243
|
+
|
|
244
|
+
if (dataToSend.has_value())
|
|
245
|
+
{
|
|
246
|
+
const double newCurrentVirtualTime = CalculateFinishTime(dataToSend->data.GetPayloadLength());
|
|
247
|
+
|
|
248
|
+
MS_DEBUG_DEV(
|
|
249
|
+
"virtual time changed [from:%f, to:%f]", this->currentVirtualTime, newCurrentVirtualTime);
|
|
250
|
+
|
|
251
|
+
this->currentVirtualTime = newCurrentVirtualTime;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
return dataToSend;
|
|
255
|
+
}
|
|
256
|
+
} // namespace SCTP
|
|
257
|
+
} // namespace RTC
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// #define MS_LOG_DEV_LEVEL 3
|
|
3
3
|
|
|
4
4
|
#include "RTC/SenderBandwidthEstimator.hpp"
|
|
5
|
-
#include "DepLibUV.hpp"
|
|
6
5
|
#include "Logger.hpp"
|
|
7
6
|
|
|
8
7
|
namespace RTC
|
|
@@ -16,8 +15,11 @@ namespace RTC
|
|
|
16
15
|
/* Instance methods. */
|
|
17
16
|
|
|
18
17
|
SenderBandwidthEstimator::SenderBandwidthEstimator(
|
|
19
|
-
RTC::SenderBandwidthEstimator::Listener* listener,
|
|
18
|
+
RTC::SenderBandwidthEstimator::Listener* listener,
|
|
19
|
+
SharedInterface* shared,
|
|
20
|
+
uint32_t initialAvailableBitrate)
|
|
20
21
|
: listener(listener),
|
|
22
|
+
shared(shared),
|
|
21
23
|
initialAvailableBitrate(initialAvailableBitrate),
|
|
22
24
|
rtt(DefaultRtt),
|
|
23
25
|
sendTransmission(1000u),
|
|
@@ -36,7 +38,7 @@ namespace RTC
|
|
|
36
38
|
MS_TRACE();
|
|
37
39
|
|
|
38
40
|
this->availableBitrate = this->initialAvailableBitrate;
|
|
39
|
-
this->lastAvailableBitrateEventAtMs =
|
|
41
|
+
this->lastAvailableBitrateEventAtMs = this->shared->GetTimeMs();
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
void SenderBandwidthEstimator::TransportDisconnected()
|
|
@@ -85,7 +87,7 @@ namespace RTC
|
|
|
85
87
|
{
|
|
86
88
|
MS_TRACE();
|
|
87
89
|
|
|
88
|
-
auto nowMs =
|
|
90
|
+
auto nowMs = this->shared->GetTimeMs();
|
|
89
91
|
const uint64_t elapsedMs = nowMs - this->cummulativeResult.GetStartedAtMs();
|
|
90
92
|
|
|
91
93
|
// Drop ongoing cummulative result if too old.
|
|
@@ -226,7 +228,7 @@ namespace RTC
|
|
|
226
228
|
{
|
|
227
229
|
MS_TRACE();
|
|
228
230
|
|
|
229
|
-
this->lastAvailableBitrateEventAtMs =
|
|
231
|
+
this->lastAvailableBitrateEventAtMs = this->shared->GetTimeMs();
|
|
230
232
|
}
|
|
231
233
|
|
|
232
234
|
void SenderBandwidthEstimator::CummulativeResult::AddPacket(
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
#define MS_CLASS "RTC::SimpleConsumer"
|
|
3
3
|
// #define MS_LOG_DEV_LEVEL 3
|
|
4
4
|
|
|
5
|
-
#include "DepLibUV.hpp"
|
|
6
5
|
#include "Logger.hpp"
|
|
7
6
|
#include "MediaSoupErrors.hpp"
|
|
8
|
-
#include "Utils.hpp"
|
|
9
7
|
#include "RTC/RTP/Codecs/Tools.hpp"
|
|
10
8
|
#include "RTC/SimpleConsumer.hpp"
|
|
9
|
+
#include "Utils.hpp"
|
|
11
10
|
#ifdef MS_RTC_LOGGER_RTP
|
|
12
11
|
#include "RTC/RtcLogger.hpp"
|
|
13
12
|
#endif
|
|
@@ -22,7 +21,7 @@ namespace RTC
|
|
|
22
21
|
/* Instance methods. */
|
|
23
22
|
|
|
24
23
|
SimpleConsumer::SimpleConsumer(
|
|
25
|
-
|
|
24
|
+
SharedInterface* shared,
|
|
26
25
|
const std::string& id,
|
|
27
26
|
const std::string& producerId,
|
|
28
27
|
RTC::Consumer::Listener* listener,
|
|
@@ -69,7 +68,7 @@ namespace RTC
|
|
|
69
68
|
}
|
|
70
69
|
|
|
71
70
|
// NOTE: This may throw.
|
|
72
|
-
this->shared->
|
|
71
|
+
this->shared->GetChannelMessageRegistrator()->RegisterHandler(
|
|
73
72
|
this->id,
|
|
74
73
|
/*channelRequestHandler*/ this,
|
|
75
74
|
/*channelNotificationHandler*/ nullptr);
|
|
@@ -79,7 +78,7 @@ namespace RTC
|
|
|
79
78
|
{
|
|
80
79
|
MS_TRACE();
|
|
81
80
|
|
|
82
|
-
this->shared->
|
|
81
|
+
this->shared->GetChannelMessageRegistrator()->UnregisterHandler(this->id);
|
|
83
82
|
|
|
84
83
|
delete this->rtpStream;
|
|
85
84
|
this->targetLayerRetransmissionBuffer.clear();
|
|
@@ -257,7 +256,7 @@ namespace RTC
|
|
|
257
256
|
|
|
258
257
|
// Video SimpleConsumer does not really play the BWE game when. However, let's
|
|
259
258
|
// be honest and try to be nice.
|
|
260
|
-
auto nowMs =
|
|
259
|
+
auto nowMs = this->shared->GetTimeMs();
|
|
261
260
|
auto desiredBitrate = this->producerRtpStream->GetBitrate(nowMs);
|
|
262
261
|
|
|
263
262
|
if (desiredBitrate < bitrate)
|
|
@@ -300,7 +299,7 @@ namespace RTC
|
|
|
300
299
|
return 0u;
|
|
301
300
|
}
|
|
302
301
|
|
|
303
|
-
auto nowMs =
|
|
302
|
+
auto nowMs = this->shared->GetTimeMs();
|
|
304
303
|
auto desiredBitrate = this->producerRtpStream->GetBitrate(nowMs);
|
|
305
304
|
|
|
306
305
|
// If consumer.rtpParameters.encodings[0].maxBitrate was given and it's
|
|
@@ -780,7 +779,8 @@ namespace RTC
|
|
|
780
779
|
}
|
|
781
780
|
}
|
|
782
781
|
|
|
783
|
-
this->rtpStream =
|
|
782
|
+
this->rtpStream =
|
|
783
|
+
new RTC::RTP::RtpStreamSend(this, this->shared, params, this->rtpParameters.mid);
|
|
784
784
|
this->rtpStreams.push_back(this->rtpStream);
|
|
785
785
|
|
|
786
786
|
// If the Consumer is paused, tell the RtpStreamSend.
|
|
@@ -848,12 +848,12 @@ namespace RTC
|
|
|
848
848
|
{
|
|
849
849
|
MS_TRACE();
|
|
850
850
|
|
|
851
|
-
auto scoreOffset = FillBufferScore(this->shared->
|
|
851
|
+
auto scoreOffset = FillBufferScore(this->shared->GetChannelNotifier()->GetBufferBuilder());
|
|
852
852
|
|
|
853
853
|
auto notificationOffset = FBS::Consumer::CreateScoreNotification(
|
|
854
|
-
this->shared->
|
|
854
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(), scoreOffset);
|
|
855
855
|
|
|
856
|
-
this->shared->
|
|
856
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
857
857
|
this->id,
|
|
858
858
|
FBS::Notification::Event::CONSUMER_SCORE,
|
|
859
859
|
FBS::Notification::Body::Consumer_ScoreNotification,
|
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
// #define MS_LOG_DEV_LEVEL 3
|
|
3
3
|
|
|
4
4
|
#include "RTC/SimulcastConsumer.hpp"
|
|
5
|
-
#include "DepLibUV.hpp"
|
|
6
5
|
#include "Logger.hpp"
|
|
7
6
|
#include "MediaSoupErrors.hpp"
|
|
8
|
-
#include "Utils.hpp"
|
|
9
7
|
#include "RTC/RTP/Codecs/Tools.hpp"
|
|
8
|
+
#include "Utils.hpp"
|
|
10
9
|
#ifdef MS_RTC_LOGGER_RTP
|
|
11
10
|
#include "RTC/RtcLogger.hpp"
|
|
12
11
|
#endif
|
|
@@ -25,7 +24,7 @@ namespace RTC
|
|
|
25
24
|
/* Instance methods. */
|
|
26
25
|
|
|
27
26
|
SimulcastConsumer::SimulcastConsumer(
|
|
28
|
-
|
|
27
|
+
SharedInterface* shared,
|
|
29
28
|
const std::string& id,
|
|
30
29
|
const std::string& producerId,
|
|
31
30
|
RTC::Consumer::Listener* listener,
|
|
@@ -126,7 +125,7 @@ namespace RTC
|
|
|
126
125
|
CreateRtpStream();
|
|
127
126
|
|
|
128
127
|
// NOTE: This may throw.
|
|
129
|
-
this->shared->
|
|
128
|
+
this->shared->GetChannelMessageRegistrator()->RegisterHandler(
|
|
130
129
|
this->id,
|
|
131
130
|
/*channelRequestHandler*/ this,
|
|
132
131
|
/*channelRequestHandler*/ nullptr);
|
|
@@ -136,7 +135,7 @@ namespace RTC
|
|
|
136
135
|
{
|
|
137
136
|
MS_TRACE();
|
|
138
137
|
|
|
139
|
-
this->shared->
|
|
138
|
+
this->shared->GetChannelMessageRegistrator()->UnregisterHandler(this->id);
|
|
140
139
|
|
|
141
140
|
delete this->rtpStream;
|
|
142
141
|
this->targetLayerRetransmissionBuffer.clear();
|
|
@@ -444,7 +443,7 @@ namespace RTC
|
|
|
444
443
|
uint32_t requiredBitrate{ 0u };
|
|
445
444
|
int16_t spatialLayer{ 0 };
|
|
446
445
|
int16_t temporalLayer{ 0 };
|
|
447
|
-
auto nowMs =
|
|
446
|
+
auto nowMs = this->shared->GetTimeMs();
|
|
448
447
|
|
|
449
448
|
for (size_t sIdx{ 0u }; sIdx < this->producerRtpStreams.size(); ++sIdx)
|
|
450
449
|
{
|
|
@@ -654,7 +653,7 @@ namespace RTC
|
|
|
654
653
|
this->currentSpatialLayer,
|
|
655
654
|
this->targetLayers.spatial);
|
|
656
655
|
|
|
657
|
-
this->lastBweDowngradeAtMs =
|
|
656
|
+
this->lastBweDowngradeAtMs = this->shared->GetTimeMs();
|
|
658
657
|
}
|
|
659
658
|
}
|
|
660
659
|
}
|
|
@@ -670,7 +669,7 @@ namespace RTC
|
|
|
670
669
|
return 0u;
|
|
671
670
|
}
|
|
672
671
|
|
|
673
|
-
auto nowMs =
|
|
672
|
+
auto nowMs = this->shared->GetTimeMs();
|
|
674
673
|
uint32_t desiredBitrate{ 0u };
|
|
675
674
|
|
|
676
675
|
// Let's iterate all streams of the Producer (from highest to lowest) and
|
|
@@ -1462,7 +1461,8 @@ namespace RTC
|
|
|
1462
1461
|
}
|
|
1463
1462
|
}
|
|
1464
1463
|
|
|
1465
|
-
this->rtpStream =
|
|
1464
|
+
this->rtpStream =
|
|
1465
|
+
new RTC::RTP::RtpStreamSend(this, this->shared, params, this->rtpParameters.mid);
|
|
1466
1466
|
this->rtpStreams.push_back(this->rtpStream);
|
|
1467
1467
|
|
|
1468
1468
|
// If the Consumer is paused, tell the RtpStreamSend.
|
|
@@ -1582,7 +1582,7 @@ namespace RTC
|
|
|
1582
1582
|
// Start with no layers.
|
|
1583
1583
|
newTargetLayers.Reset();
|
|
1584
1584
|
|
|
1585
|
-
auto nowMs =
|
|
1585
|
+
auto nowMs = this->shared->GetTimeMs();
|
|
1586
1586
|
|
|
1587
1587
|
for (size_t sIdx{ 0u }; sIdx < this->producerRtpStreams.size(); ++sIdx)
|
|
1588
1588
|
{
|
|
@@ -1773,12 +1773,12 @@ namespace RTC
|
|
|
1773
1773
|
{
|
|
1774
1774
|
MS_TRACE();
|
|
1775
1775
|
|
|
1776
|
-
auto scoreOffset = FillBufferScore(this->shared->
|
|
1776
|
+
auto scoreOffset = FillBufferScore(this->shared->GetChannelNotifier()->GetBufferBuilder());
|
|
1777
1777
|
|
|
1778
1778
|
auto notificationOffset = FBS::Consumer::CreateScoreNotification(
|
|
1779
|
-
this->shared->
|
|
1779
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(), scoreOffset);
|
|
1780
1780
|
|
|
1781
|
-
this->shared->
|
|
1781
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
1782
1782
|
this->id,
|
|
1783
1783
|
FBS::Notification::Event::CONSUMER_SCORE,
|
|
1784
1784
|
FBS::Notification::Body::Consumer_ScoreNotification,
|
|
@@ -1800,15 +1800,15 @@ namespace RTC
|
|
|
1800
1800
|
if (this->currentSpatialLayer >= 0)
|
|
1801
1801
|
{
|
|
1802
1802
|
layersOffset = FBS::Consumer::CreateConsumerLayers(
|
|
1803
|
-
this->shared->
|
|
1803
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(),
|
|
1804
1804
|
this->currentSpatialLayer,
|
|
1805
1805
|
this->encodingContext->GetCurrentTemporalLayer());
|
|
1806
1806
|
}
|
|
1807
1807
|
|
|
1808
1808
|
auto notificationOffset = FBS::Consumer::CreateLayersChangeNotification(
|
|
1809
|
-
this->shared->
|
|
1809
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(), layersOffset);
|
|
1810
1810
|
|
|
1811
|
-
this->shared->
|
|
1811
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
1812
1812
|
this->id,
|
|
1813
1813
|
FBS::Notification::Event::CONSUMER_LAYERS_CHANGE,
|
|
1814
1814
|
FBS::Notification::Body::Consumer_LayersChangeNotification,
|
|
@@ -15,7 +15,7 @@ namespace RTC
|
|
|
15
15
|
/* Static. */
|
|
16
16
|
|
|
17
17
|
static constexpr size_t EncryptBufferSize{ 65536 };
|
|
18
|
-
alignas(4) thread_local uint8_t EncryptBuffer[EncryptBufferSize];
|
|
18
|
+
alignas(4) static thread_local uint8_t EncryptBuffer[EncryptBufferSize];
|
|
19
19
|
|
|
20
20
|
/* Class methods. */
|
|
21
21
|
|
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
// #define MS_LOG_DEV_LEVEL 3
|
|
3
3
|
|
|
4
4
|
#include "RTC/SvcConsumer.hpp"
|
|
5
|
-
#include "DepLibUV.hpp"
|
|
6
5
|
#include "Logger.hpp"
|
|
7
6
|
#include "MediaSoupErrors.hpp"
|
|
8
|
-
#include "Utils.hpp"
|
|
9
7
|
#include "RTC/RTP/Codecs/Tools.hpp"
|
|
8
|
+
#include "Utils.hpp"
|
|
10
9
|
#ifdef MS_RTC_LOGGER_RTP
|
|
11
10
|
#include "RTC/RtcLogger.hpp"
|
|
12
11
|
#endif
|
|
@@ -23,7 +22,7 @@ namespace RTC
|
|
|
23
22
|
/* Instance methods. */
|
|
24
23
|
|
|
25
24
|
SvcConsumer::SvcConsumer(
|
|
26
|
-
|
|
25
|
+
SharedInterface* shared,
|
|
27
26
|
const std::string& id,
|
|
28
27
|
const std::string& producerId,
|
|
29
28
|
RTC::Consumer::Listener* listener,
|
|
@@ -107,7 +106,7 @@ namespace RTC
|
|
|
107
106
|
CreateRtpStream();
|
|
108
107
|
|
|
109
108
|
// NOTE: This may throw.
|
|
110
|
-
this->shared->
|
|
109
|
+
this->shared->GetChannelMessageRegistrator()->RegisterHandler(
|
|
111
110
|
this->id,
|
|
112
111
|
/*channelRequestHandler*/ this,
|
|
113
112
|
/*channelNotificationHandler*/ nullptr);
|
|
@@ -117,7 +116,7 @@ namespace RTC
|
|
|
117
116
|
{
|
|
118
117
|
MS_TRACE();
|
|
119
118
|
|
|
120
|
-
this->shared->
|
|
119
|
+
this->shared->GetChannelMessageRegistrator()->UnregisterHandler(this->id);
|
|
121
120
|
|
|
122
121
|
delete this->rtpStream;
|
|
123
122
|
this->targetLayerRetransmissionBuffer.clear();
|
|
@@ -388,7 +387,7 @@ namespace RTC
|
|
|
388
387
|
uint32_t requiredBitrate{ 0u };
|
|
389
388
|
int16_t spatialLayer{ 0 };
|
|
390
389
|
int16_t temporalLayer{ 0 };
|
|
391
|
-
auto nowMs =
|
|
390
|
+
auto nowMs = this->shared->GetTimeMs();
|
|
392
391
|
|
|
393
392
|
for (; spatialLayer < this->producerRtpStream->GetSpatialLayers(); ++spatialLayer)
|
|
394
393
|
{
|
|
@@ -544,7 +543,7 @@ namespace RTC
|
|
|
544
543
|
this->encodingContext->GetCurrentSpatialLayer(),
|
|
545
544
|
this->encodingContext->GetTargetSpatialLayer());
|
|
546
545
|
|
|
547
|
-
this->lastBweDowngradeAtMs =
|
|
546
|
+
this->lastBweDowngradeAtMs = this->shared->GetTimeMs();
|
|
548
547
|
}
|
|
549
548
|
}
|
|
550
549
|
}
|
|
@@ -560,7 +559,7 @@ namespace RTC
|
|
|
560
559
|
return 0u;
|
|
561
560
|
}
|
|
562
561
|
|
|
563
|
-
auto nowMs =
|
|
562
|
+
auto nowMs = this->shared->GetTimeMs();
|
|
564
563
|
uint32_t desiredBitrate{ 0u };
|
|
565
564
|
|
|
566
565
|
// When using K-SVC each spatial layer is independent of the others.
|
|
@@ -1090,7 +1089,8 @@ namespace RTC
|
|
|
1090
1089
|
}
|
|
1091
1090
|
}
|
|
1092
1091
|
|
|
1093
|
-
this->rtpStream =
|
|
1092
|
+
this->rtpStream =
|
|
1093
|
+
new RTC::RTP::RtpStreamSend(this, this->shared, params, this->rtpParameters.mid);
|
|
1094
1094
|
this->rtpStreams.push_back(this->rtpStream);
|
|
1095
1095
|
|
|
1096
1096
|
// If the Consumer is paused, tell the RtpStreamSend.
|
|
@@ -1155,7 +1155,7 @@ namespace RTC
|
|
|
1155
1155
|
// Start with no layers.
|
|
1156
1156
|
newTargetLayers.Reset();
|
|
1157
1157
|
|
|
1158
|
-
auto nowMs =
|
|
1158
|
+
auto nowMs = this->shared->GetTimeMs();
|
|
1159
1159
|
int16_t spatialLayer{ 0 };
|
|
1160
1160
|
|
|
1161
1161
|
if (!this->producerRtpStream)
|
|
@@ -1305,12 +1305,12 @@ namespace RTC
|
|
|
1305
1305
|
{
|
|
1306
1306
|
MS_TRACE();
|
|
1307
1307
|
|
|
1308
|
-
auto scoreOffset = FillBufferScore(this->shared->
|
|
1308
|
+
auto scoreOffset = FillBufferScore(this->shared->GetChannelNotifier()->GetBufferBuilder());
|
|
1309
1309
|
|
|
1310
1310
|
auto notificationOffset = FBS::Consumer::CreateScoreNotification(
|
|
1311
|
-
this->shared->
|
|
1311
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(), scoreOffset);
|
|
1312
1312
|
|
|
1313
|
-
this->shared->
|
|
1313
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
1314
1314
|
this->id,
|
|
1315
1315
|
FBS::Notification::Event::CONSUMER_SCORE,
|
|
1316
1316
|
FBS::Notification::Body::Consumer_ScoreNotification,
|
|
@@ -1332,15 +1332,15 @@ namespace RTC
|
|
|
1332
1332
|
if (this->encodingContext->GetCurrentSpatialLayer() >= 0)
|
|
1333
1333
|
{
|
|
1334
1334
|
layersOffset = FBS::Consumer::CreateConsumerLayers(
|
|
1335
|
-
this->shared->
|
|
1335
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(),
|
|
1336
1336
|
this->encodingContext->GetCurrentSpatialLayer(),
|
|
1337
1337
|
this->encodingContext->GetCurrentTemporalLayer());
|
|
1338
1338
|
}
|
|
1339
1339
|
|
|
1340
1340
|
auto notificationOffset = FBS::Consumer::CreateLayersChangeNotification(
|
|
1341
|
-
this->shared->
|
|
1341
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(), layersOffset);
|
|
1342
1342
|
|
|
1343
|
-
this->shared->
|
|
1343
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
1344
1344
|
this->id,
|
|
1345
1345
|
FBS::Notification::Event::CONSUMER_LAYERS_CHANGE,
|
|
1346
1346
|
FBS::Notification::Body::Consumer_LayersChangeNotification,
|
|
@@ -15,7 +15,7 @@ namespace RTC
|
|
|
15
15
|
// it to structs (e.g. RTP::Packet::FixedHeader) that require 4-byte alignment.
|
|
16
16
|
// Without this, accessing multi-byte fields would be undefined behavior on
|
|
17
17
|
// strict-alignment architectures.
|
|
18
|
-
alignas(4) thread_local uint8_t ReadBuffer[ReadBufferSize];
|
|
18
|
+
alignas(4) static thread_local uint8_t ReadBuffer[ReadBufferSize];
|
|
19
19
|
|
|
20
20
|
/* Instance methods. */
|
|
21
21
|
|