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
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
// #define MS_LOG_DEV_LEVEL 3
|
|
3
3
|
|
|
4
4
|
#include "RTC/Producer.hpp"
|
|
5
|
-
#include "DepLibUV.hpp"
|
|
6
5
|
#include "Logger.hpp"
|
|
7
6
|
#include "MediaSoupErrors.hpp"
|
|
8
|
-
#include "Utils.hpp"
|
|
9
7
|
#include "RTC/Consts.hpp"
|
|
10
8
|
#include "RTC/RTCP/Feedback.hpp"
|
|
11
9
|
#include "RTC/RTCP/XrReceiverReferenceTime.hpp"
|
|
12
10
|
#include "RTC/RTP/Codecs/Tools.hpp"
|
|
11
|
+
#include "Utils.hpp"
|
|
13
12
|
#ifdef MS_RTC_LOGGER_RTP
|
|
14
13
|
#include "RTC/RtcLogger.hpp"
|
|
15
14
|
#endif
|
|
@@ -21,13 +20,13 @@ namespace RTC
|
|
|
21
20
|
/* Static */
|
|
22
21
|
|
|
23
22
|
static constexpr size_t ProducerSendBufferSize{ 65536 };
|
|
24
|
-
thread_local uint8_t ProducerSendBuffer[ProducerSendBufferSize];
|
|
23
|
+
static thread_local uint8_t ProducerSendBuffer[ProducerSendBufferSize];
|
|
25
24
|
static constexpr unsigned int SendNackDelay{ 10u }; // In ms.
|
|
26
25
|
|
|
27
26
|
/* Instance methods. */
|
|
28
27
|
|
|
29
28
|
Producer::Producer(
|
|
30
|
-
|
|
29
|
+
SharedInterface* shared,
|
|
31
30
|
const std::string& id,
|
|
32
31
|
RTC::Producer::Listener* listener,
|
|
33
32
|
const FBS::Transport::ProduceRequest* data)
|
|
@@ -209,11 +208,12 @@ namespace RTC
|
|
|
209
208
|
{
|
|
210
209
|
auto keyFrameRequestDelay = data->keyFrameRequestDelay();
|
|
211
210
|
|
|
212
|
-
this->keyFrameRequestManager =
|
|
211
|
+
this->keyFrameRequestManager =
|
|
212
|
+
new RTC::KeyFrameRequestManager(this, this->shared, keyFrameRequestDelay);
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
// NOTE: This may throw.
|
|
216
|
-
this->shared->
|
|
216
|
+
this->shared->GetChannelMessageRegistrator()->RegisterHandler(
|
|
217
217
|
this->id,
|
|
218
218
|
/*channelRequestHandler*/ this,
|
|
219
219
|
/*channelNotificationHandler*/ this);
|
|
@@ -223,7 +223,7 @@ namespace RTC
|
|
|
223
223
|
{
|
|
224
224
|
MS_TRACE();
|
|
225
225
|
|
|
226
|
-
this->shared->
|
|
226
|
+
this->shared->GetChannelMessageRegistrator()->UnregisterHandler(this->id);
|
|
227
227
|
|
|
228
228
|
// Delete all streams.
|
|
229
229
|
for (auto& kv : this->mapSsrcRtpStream)
|
|
@@ -1131,7 +1131,8 @@ namespace RTC
|
|
|
1131
1131
|
this->type == RtpParameters::Type::SIMULCAST && this->rtpMapping.encodings.size() > 1;
|
|
1132
1132
|
|
|
1133
1133
|
// Create a RtpStreamRecv for receiving a media stream.
|
|
1134
|
-
auto* rtpStream =
|
|
1134
|
+
auto* rtpStream =
|
|
1135
|
+
new RTC::RTP::RtpStreamRecv(this, this->shared, params, SendNackDelay, useRtpInactivityCheck);
|
|
1135
1136
|
|
|
1136
1137
|
// Insert into the maps.
|
|
1137
1138
|
this->mapSsrcRtpStream[ssrc] = rtpStream;
|
|
@@ -1194,8 +1195,8 @@ namespace RTC
|
|
|
1194
1195
|
|
|
1195
1196
|
// Mangle RTP header extensions.
|
|
1196
1197
|
{
|
|
1197
|
-
thread_local uint8_t buffer[4096];
|
|
1198
|
-
thread_local std::vector<RTC::RTP::Packet::Extension> extensions;
|
|
1198
|
+
static thread_local uint8_t buffer[4096];
|
|
1199
|
+
static thread_local std::vector<RTC::RTP::Packet::Extension> extensions;
|
|
1199
1200
|
|
|
1200
1201
|
// This happens just once.
|
|
1201
1202
|
if (extensions.capacity() != 24)
|
|
@@ -1433,12 +1434,12 @@ namespace RTC
|
|
|
1433
1434
|
this->videoOrientation.rotation = rotation;
|
|
1434
1435
|
|
|
1435
1436
|
auto notification = FBS::Producer::CreateVideoOrientationChangeNotification(
|
|
1436
|
-
this->shared->
|
|
1437
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(),
|
|
1437
1438
|
this->videoOrientation.camera,
|
|
1438
1439
|
this->videoOrientation.flip,
|
|
1439
1440
|
this->videoOrientation.rotation);
|
|
1440
1441
|
|
|
1441
|
-
this->shared->
|
|
1442
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
1442
1443
|
this->id,
|
|
1443
1444
|
FBS::Notification::Event::PRODUCER_VIDEO_ORIENTATION_CHANGE,
|
|
1444
1445
|
FBS::Notification::Body::Producer_VideoOrientationChangeNotification,
|
|
@@ -1463,7 +1464,7 @@ namespace RTC
|
|
|
1463
1464
|
|
|
1464
1465
|
scores.emplace_back(
|
|
1465
1466
|
FBS::Producer::CreateScoreDirect(
|
|
1466
|
-
this->shared->
|
|
1467
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(),
|
|
1467
1468
|
rtpStream->GetEncodingIdx(),
|
|
1468
1469
|
rtpStream->GetSsrc(),
|
|
1469
1470
|
!rtpStream->GetRid().empty() ? rtpStream->GetRid().c_str() : nullptr,
|
|
@@ -1471,9 +1472,9 @@ namespace RTC
|
|
|
1471
1472
|
}
|
|
1472
1473
|
|
|
1473
1474
|
auto notification = FBS::Producer::CreateScoreNotificationDirect(
|
|
1474
|
-
this->shared->
|
|
1475
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(), &scores);
|
|
1475
1476
|
|
|
1476
|
-
this->shared->
|
|
1477
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
1477
1478
|
this->id,
|
|
1478
1479
|
FBS::Notification::Event::PRODUCER_SCORE,
|
|
1479
1480
|
FBS::Notification::Body::Producer_ScoreNotification,
|
|
@@ -1486,14 +1487,14 @@ namespace RTC
|
|
|
1486
1487
|
|
|
1487
1488
|
if (this->traceEventTypes.keyframe && packet->IsKeyFrame())
|
|
1488
1489
|
{
|
|
1489
|
-
auto rtpPacketDump = packet->FillBuffer(this->shared->
|
|
1490
|
-
auto traceInfo
|
|
1491
|
-
this->shared->
|
|
1490
|
+
auto rtpPacketDump = packet->FillBuffer(this->shared->GetChannelNotifier()->GetBufferBuilder());
|
|
1491
|
+
auto traceInfo = FBS::Producer::CreateKeyFrameTraceInfo(
|
|
1492
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(), rtpPacketDump, isRtx);
|
|
1492
1493
|
|
|
1493
1494
|
auto notification = FBS::Producer::CreateTraceNotification(
|
|
1494
|
-
this->shared->
|
|
1495
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(),
|
|
1495
1496
|
FBS::Producer::TraceEventType::KEYFRAME,
|
|
1496
|
-
|
|
1497
|
+
this->shared->GetTimeMs(),
|
|
1497
1498
|
FBS::Common::TraceDirection::DIRECTION_IN,
|
|
1498
1499
|
FBS::Producer::TraceInfo::KeyFrameTraceInfo,
|
|
1499
1500
|
traceInfo.Union());
|
|
@@ -1502,14 +1503,14 @@ namespace RTC
|
|
|
1502
1503
|
}
|
|
1503
1504
|
else if (this->traceEventTypes.rtp)
|
|
1504
1505
|
{
|
|
1505
|
-
auto rtpPacketDump = packet->FillBuffer(this->shared->
|
|
1506
|
-
auto traceInfo
|
|
1507
|
-
this->shared->
|
|
1506
|
+
auto rtpPacketDump = packet->FillBuffer(this->shared->GetChannelNotifier()->GetBufferBuilder());
|
|
1507
|
+
auto traceInfo = FBS::Producer::CreateRtpTraceInfo(
|
|
1508
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(), rtpPacketDump, isRtx);
|
|
1508
1509
|
|
|
1509
1510
|
auto notification = FBS::Producer::CreateTraceNotification(
|
|
1510
|
-
this->shared->
|
|
1511
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(),
|
|
1511
1512
|
FBS::Producer::TraceEventType::RTP,
|
|
1512
|
-
|
|
1513
|
+
this->shared->GetTimeMs(),
|
|
1513
1514
|
FBS::Common::TraceDirection::DIRECTION_IN,
|
|
1514
1515
|
FBS::Producer::TraceInfo::RtpTraceInfo,
|
|
1515
1516
|
traceInfo.Union());
|
|
@@ -1527,13 +1528,13 @@ namespace RTC
|
|
|
1527
1528
|
return;
|
|
1528
1529
|
}
|
|
1529
1530
|
|
|
1530
|
-
auto traceInfo =
|
|
1531
|
-
|
|
1531
|
+
auto traceInfo = FBS::Producer::CreatePliTraceInfo(
|
|
1532
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(), ssrc);
|
|
1532
1533
|
|
|
1533
1534
|
auto notification = FBS::Producer::CreateTraceNotification(
|
|
1534
|
-
this->shared->
|
|
1535
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(),
|
|
1535
1536
|
FBS::Producer::TraceEventType::PLI,
|
|
1536
|
-
|
|
1537
|
+
this->shared->GetTimeMs(),
|
|
1537
1538
|
FBS::Common::TraceDirection::DIRECTION_OUT,
|
|
1538
1539
|
FBS::Producer::TraceInfo::PliTraceInfo,
|
|
1539
1540
|
traceInfo.Union());
|
|
@@ -1550,13 +1551,13 @@ namespace RTC
|
|
|
1550
1551
|
return;
|
|
1551
1552
|
}
|
|
1552
1553
|
|
|
1553
|
-
auto traceInfo =
|
|
1554
|
-
|
|
1554
|
+
auto traceInfo = FBS::Producer::CreateFirTraceInfo(
|
|
1555
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(), ssrc);
|
|
1555
1556
|
|
|
1556
1557
|
auto notification = FBS::Producer::CreateTraceNotification(
|
|
1557
|
-
this->shared->
|
|
1558
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(),
|
|
1558
1559
|
FBS::Producer::TraceEventType::FIR,
|
|
1559
|
-
|
|
1560
|
+
this->shared->GetTimeMs(),
|
|
1560
1561
|
FBS::Common::TraceDirection::DIRECTION_OUT,
|
|
1561
1562
|
FBS::Producer::TraceInfo::FirTraceInfo,
|
|
1562
1563
|
traceInfo.Union());
|
|
@@ -1574,9 +1575,9 @@ namespace RTC
|
|
|
1574
1575
|
}
|
|
1575
1576
|
|
|
1576
1577
|
auto notification = FBS::Producer::CreateTraceNotification(
|
|
1577
|
-
this->shared->
|
|
1578
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(),
|
|
1578
1579
|
FBS::Producer::TraceEventType::NACK,
|
|
1579
|
-
|
|
1580
|
+
this->shared->GetTimeMs(),
|
|
1580
1581
|
FBS::Common::TraceDirection::DIRECTION_OUT);
|
|
1581
1582
|
|
|
1582
1583
|
EmitTraceEvent(notification);
|
|
@@ -1592,7 +1593,7 @@ namespace RTC
|
|
|
1592
1593
|
}
|
|
1593
1594
|
|
|
1594
1595
|
auto traceInfo = FBS::Producer::CreateSrTraceInfo(
|
|
1595
|
-
this->shared->
|
|
1596
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(),
|
|
1596
1597
|
report->GetSsrc(),
|
|
1597
1598
|
report->GetNtpSec(),
|
|
1598
1599
|
report->GetNtpFrac(),
|
|
@@ -1601,9 +1602,9 @@ namespace RTC
|
|
|
1601
1602
|
report->GetOctetCount());
|
|
1602
1603
|
|
|
1603
1604
|
auto notification = FBS::Producer::CreateTraceNotification(
|
|
1604
|
-
this->shared->
|
|
1605
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(),
|
|
1605
1606
|
FBS::Producer::TraceEventType::SR,
|
|
1606
|
-
|
|
1607
|
+
this->shared->GetTimeMs(),
|
|
1607
1608
|
FBS::Common::TraceDirection::DIRECTION_IN,
|
|
1608
1609
|
FBS::Producer::TraceInfo::SrTraceInfo,
|
|
1609
1610
|
traceInfo.Union());
|
|
@@ -1616,7 +1617,7 @@ namespace RTC
|
|
|
1616
1617
|
{
|
|
1617
1618
|
MS_TRACE();
|
|
1618
1619
|
|
|
1619
|
-
this->shared->
|
|
1620
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
1620
1621
|
this->id,
|
|
1621
1622
|
FBS::Notification::Event::PRODUCER_TRACE,
|
|
1622
1623
|
FBS::Notification::Body::Producer_TraceNotification,
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
#include "RTC/RTP/Packet.hpp"
|
|
5
5
|
#ifdef MS_RTC_LOGGER_RTP
|
|
6
|
-
#include "DepLibUV.hpp"
|
|
7
6
|
#endif
|
|
7
|
+
#include "DepLibUV.hpp"
|
|
8
8
|
#include "Logger.hpp"
|
|
9
9
|
#include "MediaSoupErrors.hpp"
|
|
10
10
|
#include "RTC/Consts.hpp"
|
|
@@ -136,6 +136,8 @@ namespace RTC
|
|
|
136
136
|
|
|
137
137
|
#ifdef MS_RTC_LOGGER_RTP
|
|
138
138
|
// Initialize logger.
|
|
139
|
+
// NOTE: Here we use DepLibUV directly since `this->logger` doesn't
|
|
140
|
+
// have any purpose during tests.
|
|
139
141
|
this->logger.timestamp = DepLibUV::GetTimeMs();
|
|
140
142
|
this->logger.recvRtpTimestamp = GetTimestamp();
|
|
141
143
|
this->logger.recvSeqNumber = GetSequenceNumber();
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
#include "RTC/RTP/ProbationGenerator.hpp"
|
|
5
5
|
#include "Logger.hpp"
|
|
6
|
-
#include "Utils.hpp"
|
|
7
6
|
#include "RTC/RtpDictionaries.hpp"
|
|
7
|
+
#include "Utils.hpp"
|
|
8
8
|
#include <cstring> // std::memcpy(), std::memset()
|
|
9
9
|
#include <vector>
|
|
10
10
|
|
|
@@ -14,9 +14,9 @@ namespace RTC
|
|
|
14
14
|
{
|
|
15
15
|
/* Static. */
|
|
16
16
|
|
|
17
|
-
thread_local uint8_t ProbationPacketBuffer[ProbationGenerator::ProbationPacketMaxLength];
|
|
17
|
+
static thread_local uint8_t ProbationPacketBuffer[ProbationGenerator::ProbationPacketMaxLength];
|
|
18
18
|
static constexpr size_t ProbationPacketExtensionsBufferLength{ 200 };
|
|
19
|
-
alignas(4) thread_local uint8_t
|
|
19
|
+
alignas(4) static thread_local uint8_t
|
|
20
20
|
ProbationPacketExtensionsBuffer[ProbationPacketExtensionsBufferLength];
|
|
21
21
|
// 8 bytes, same as RTC::Consts::MidRtpExtensionMaxLength.
|
|
22
22
|
static const std::string MidValue{ "probator" };
|
|
@@ -28,7 +28,7 @@ namespace RTC
|
|
|
28
28
|
MS_TRACE();
|
|
29
29
|
|
|
30
30
|
// Trick to only fill the padding with zeroes once.
|
|
31
|
-
thread_local bool mustInitializePayload{ true };
|
|
31
|
+
static thread_local bool mustInitializePayload{ true };
|
|
32
32
|
|
|
33
33
|
if (mustInitializePayload)
|
|
34
34
|
{
|
|
@@ -19,8 +19,15 @@ namespace RTC
|
|
|
19
19
|
/* Instance methods. */
|
|
20
20
|
|
|
21
21
|
RtpStream::RtpStream(
|
|
22
|
-
RTP::RtpStream::Listener* listener,
|
|
23
|
-
|
|
22
|
+
RTP::RtpStream::Listener* listener,
|
|
23
|
+
SharedInterface* shared,
|
|
24
|
+
RTP::RtpStream::Params& params,
|
|
25
|
+
uint8_t initialScore)
|
|
26
|
+
: listener(listener),
|
|
27
|
+
shared(shared),
|
|
28
|
+
params(params),
|
|
29
|
+
score(initialScore),
|
|
30
|
+
activeSinceMs(this->shared->GetTimeMs())
|
|
24
31
|
{
|
|
25
32
|
MS_TRACE();
|
|
26
33
|
}
|
|
@@ -57,7 +64,7 @@ namespace RTC
|
|
|
57
64
|
{
|
|
58
65
|
MS_TRACE();
|
|
59
66
|
|
|
60
|
-
const uint64_t nowMs =
|
|
67
|
+
const uint64_t nowMs = this->shared->GetTimeMs();
|
|
61
68
|
const auto mediaKind = this->params.mimeType.type == RTC::RtpCodecMimeType::Type::AUDIO
|
|
62
69
|
? FBS::RtpParameters::MediaKind::AUDIO
|
|
63
70
|
: FBS::RtpParameters::MediaKind::VIDEO;
|
|
@@ -116,7 +123,7 @@ namespace RTC
|
|
|
116
123
|
// Tell the RtpCodecMimeType to update its string based on current type and subtype.
|
|
117
124
|
params.mimeType.UpdateMimeType();
|
|
118
125
|
|
|
119
|
-
this->rtxStream = new RTP::RtxStream(params);
|
|
126
|
+
this->rtxStream = new RTP::RtxStream(this->shared, params);
|
|
120
127
|
}
|
|
121
128
|
|
|
122
129
|
bool RtpStream::ReceiveStreamPacket(const RTP::Packet* packet)
|
|
@@ -133,7 +140,7 @@ namespace RTC
|
|
|
133
140
|
this->started = true;
|
|
134
141
|
this->maxSeq = seq - 1;
|
|
135
142
|
this->maxPacketTs = packet->GetTimestamp();
|
|
136
|
-
this->maxPacketMs =
|
|
143
|
+
this->maxPacketMs = this->shared->GetTimeMs();
|
|
137
144
|
}
|
|
138
145
|
|
|
139
146
|
// If not a valid packet ignore it.
|
|
@@ -152,7 +159,7 @@ namespace RTC
|
|
|
152
159
|
if (Utils::Number::IsHigherThan<uint32_t>(packet->GetTimestamp(), this->maxPacketTs))
|
|
153
160
|
{
|
|
154
161
|
this->maxPacketTs = packet->GetTimestamp();
|
|
155
|
-
this->maxPacketMs =
|
|
162
|
+
this->maxPacketMs = this->shared->GetTimeMs();
|
|
156
163
|
}
|
|
157
164
|
|
|
158
165
|
return true;
|
|
@@ -173,7 +180,7 @@ namespace RTC
|
|
|
173
180
|
// If previous score was 0 (and new one is not 0) then update activeSinceMs.
|
|
174
181
|
if (previousScore == 0u)
|
|
175
182
|
{
|
|
176
|
-
this->activeSinceMs =
|
|
183
|
+
this->activeSinceMs = this->shared->GetTimeMs();
|
|
177
184
|
}
|
|
178
185
|
|
|
179
186
|
// Notify the listener.
|
|
@@ -220,7 +227,7 @@ namespace RTC
|
|
|
220
227
|
packet->GetTimestamp());
|
|
221
228
|
|
|
222
229
|
this->maxPacketTs = packet->GetTimestamp();
|
|
223
|
-
this->maxPacketMs =
|
|
230
|
+
this->maxPacketMs = this->shared->GetTimeMs();
|
|
224
231
|
}
|
|
225
232
|
}
|
|
226
233
|
// Too old packet received (older than the allowed misorder).
|
|
@@ -242,7 +249,7 @@ namespace RTC
|
|
|
242
249
|
InitSeq(seq);
|
|
243
250
|
|
|
244
251
|
this->maxPacketTs = packet->GetTimestamp();
|
|
245
|
-
this->maxPacketMs =
|
|
252
|
+
this->maxPacketMs = this->shared->GetTimeMs();
|
|
246
253
|
|
|
247
254
|
// Notify the subclass about it.
|
|
248
255
|
UserOnSequenceNumberReset();
|
|
@@ -329,7 +336,7 @@ namespace RTC
|
|
|
329
336
|
// If previous score was 0 (and new one is not 0) then update activeSinceMs.
|
|
330
337
|
if (previousScore == 0u)
|
|
331
338
|
{
|
|
332
|
-
this->activeSinceMs =
|
|
339
|
+
this->activeSinceMs = this->shared->GetTimeMs();
|
|
333
340
|
}
|
|
334
341
|
|
|
335
342
|
this->listener->OnRtpStreamScore(this, this->score, previousScore);
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
#include "RTC/RTP/RtpStreamRecv.hpp"
|
|
5
5
|
#include "Logger.hpp"
|
|
6
|
-
#include "Utils.hpp"
|
|
7
6
|
#include "RTC/RTP/Codecs/Tools.hpp"
|
|
7
|
+
#include "Utils.hpp"
|
|
8
8
|
|
|
9
9
|
namespace RTC
|
|
10
10
|
{
|
|
@@ -18,7 +18,7 @@ namespace RTC
|
|
|
18
18
|
/* TransmissionCounter methods. */
|
|
19
19
|
|
|
20
20
|
RtpStreamRecv::TransmissionCounter::TransmissionCounter(
|
|
21
|
-
uint8_t spatialLayers, uint8_t temporalLayers, size_t windowSize)
|
|
21
|
+
SharedInterface* shared, uint8_t spatialLayers, uint8_t temporalLayers, size_t windowSize)
|
|
22
22
|
{
|
|
23
23
|
MS_TRACE();
|
|
24
24
|
|
|
@@ -29,7 +29,7 @@ namespace RTC
|
|
|
29
29
|
{
|
|
30
30
|
for (uint8_t tIdx{ 0u }; tIdx < temporalLayers; ++tIdx)
|
|
31
31
|
{
|
|
32
|
-
spatialLayerCounter.emplace_back(/*ignorePaddingOnlyPackets*/ true, windowSize);
|
|
32
|
+
spatialLayerCounter.emplace_back(shared, /*ignorePaddingOnlyPackets*/ true, windowSize);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -183,21 +183,22 @@ namespace RTC
|
|
|
183
183
|
|
|
184
184
|
RtpStreamRecv::RtpStreamRecv(
|
|
185
185
|
RTP::RtpStreamRecv::Listener* listener,
|
|
186
|
+
SharedInterface* shared,
|
|
186
187
|
RTP::RtpStream::Params& params,
|
|
187
188
|
uint32_t sendNackDelayMs,
|
|
188
189
|
bool useRtpInactivityCheck)
|
|
189
|
-
: RTP::RtpStream::RtpStream(listener, params, 10),
|
|
190
|
+
: RTP::RtpStream::RtpStream(listener, shared, params, 10),
|
|
190
191
|
sendNackDelayMs(sendNackDelayMs),
|
|
191
192
|
useRtpInactivityCheck(useRtpInactivityCheck),
|
|
192
193
|
transmissionCounter(
|
|
193
|
-
params.spatialLayers, params.temporalLayers, this->params.useDtx ? 6000 : 2500),
|
|
194
|
-
mediaTransmissionCounter(/*ignorePaddingOnlyPackets*/ true)
|
|
194
|
+
shared, params.spatialLayers, params.temporalLayers, this->params.useDtx ? 6000 : 2500),
|
|
195
|
+
mediaTransmissionCounter(shared, /*ignorePaddingOnlyPackets*/ true)
|
|
195
196
|
{
|
|
196
197
|
MS_TRACE();
|
|
197
198
|
|
|
198
199
|
if (this->params.useNack)
|
|
199
200
|
{
|
|
200
|
-
this->nackGenerator.reset(new RTC::NackGenerator(this, this->sendNackDelayMs));
|
|
201
|
+
this->nackGenerator.reset(new RTC::NackGenerator(this, this->shared, this->sendNackDelayMs));
|
|
201
202
|
}
|
|
202
203
|
|
|
203
204
|
this->inactive = false;
|
|
@@ -206,7 +207,7 @@ namespace RTC
|
|
|
206
207
|
{
|
|
207
208
|
// Run the RTP inactivity periodic timer (use a different timeout if DTX is
|
|
208
209
|
// enabled).
|
|
209
|
-
this->inactivityCheckPeriodicTimer =
|
|
210
|
+
this->inactivityCheckPeriodicTimer = this->shared->CreateTimer(this);
|
|
210
211
|
|
|
211
212
|
this->inactivityCheckPeriodicTimer->Start(
|
|
212
213
|
this->params.useDtx ? InactivityCheckIntervalWithDtx : InactivityCheckInterval);
|
|
@@ -227,7 +228,7 @@ namespace RTC
|
|
|
227
228
|
{
|
|
228
229
|
MS_TRACE();
|
|
229
230
|
|
|
230
|
-
const uint64_t nowMs =
|
|
231
|
+
const uint64_t nowMs = this->shared->GetTimeMs();
|
|
231
232
|
|
|
232
233
|
auto baseStats = RTP::RtpStream::FillBufferStats(builder);
|
|
233
234
|
|
|
@@ -530,7 +531,7 @@ namespace RTC
|
|
|
530
531
|
if (this->lastSrReceived != 0)
|
|
531
532
|
{
|
|
532
533
|
// Get delay in milliseconds.
|
|
533
|
-
auto delayMs = static_cast<uint32_t>(
|
|
534
|
+
auto delayMs = static_cast<uint32_t>(this->shared->GetTimeMs() - this->lastSrReceived);
|
|
534
535
|
// Express delay in units of 1/65536 seconds.
|
|
535
536
|
uint32_t dlsr = (delayMs / 1000) << 16;
|
|
536
537
|
|
|
@@ -564,7 +565,7 @@ namespace RTC
|
|
|
564
565
|
{
|
|
565
566
|
MS_TRACE();
|
|
566
567
|
|
|
567
|
-
this->lastSrReceived =
|
|
568
|
+
this->lastSrReceived = this->shared->GetTimeMs();
|
|
568
569
|
this->lastSrTimestamp = report->GetNtpSec() << 16;
|
|
569
570
|
this->lastSrTimestamp += report->GetNtpFrac() >> 16;
|
|
570
571
|
|
|
@@ -598,7 +599,7 @@ namespace RTC
|
|
|
598
599
|
/* Calculate RTT. */
|
|
599
600
|
|
|
600
601
|
// Get the NTP representation of the current timestamp.
|
|
601
|
-
const uint64_t nowMs =
|
|
602
|
+
const uint64_t nowMs = this->shared->GetTimeMs();
|
|
602
603
|
auto ntp = Utils::Time::TimeMs2Ntp(nowMs);
|
|
603
604
|
|
|
604
605
|
// Get the compact NTP representation of the current timestamp.
|
|
@@ -712,7 +713,8 @@ namespace RTC
|
|
|
712
713
|
}
|
|
713
714
|
|
|
714
715
|
// NOTE: Based on https://github.com/versatica/mediasoup/issues/1018.
|
|
715
|
-
auto transit =
|
|
716
|
+
auto transit =
|
|
717
|
+
static_cast<int>((this->shared->GetTimeMs() * GetClockRate() / 1000) - rtpTimestamp);
|
|
716
718
|
int d = transit - this->transit;
|
|
717
719
|
|
|
718
720
|
// First transit calculation, save and return.
|
|
@@ -858,7 +860,7 @@ namespace RTC
|
|
|
858
860
|
// Nothing to do.
|
|
859
861
|
}
|
|
860
862
|
|
|
861
|
-
inline void RtpStreamRecv::OnTimer(
|
|
863
|
+
inline void RtpStreamRecv::OnTimer(TimerHandleInterface* timer)
|
|
862
864
|
{
|
|
863
865
|
MS_TRACE();
|
|
864
866
|
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
#include "DepLibUring.hpp"
|
|
7
7
|
#endif
|
|
8
8
|
#include "Logger.hpp"
|
|
9
|
-
#include "Utils.hpp"
|
|
10
9
|
#include "RTC/Consts.hpp"
|
|
11
10
|
#include "RTC/RtpDictionaries.hpp"
|
|
11
|
+
#include "Utils.hpp"
|
|
12
12
|
#include <vector>
|
|
13
13
|
|
|
14
14
|
namespace RTC
|
|
@@ -21,7 +21,7 @@ namespace RTC
|
|
|
21
21
|
static constexpr size_t RetransmissionBufferMaxItems{ 2500u };
|
|
22
22
|
// 17: 16 bit mask + the initial sequence number.
|
|
23
23
|
static constexpr size_t MaxRequestedPackets{ 17u };
|
|
24
|
-
thread_local std::vector<RTP::RetransmissionBuffer::Item*> RetransmissionContainer(
|
|
24
|
+
static thread_local std::vector<RTP::RetransmissionBuffer::Item*> RetransmissionContainer(
|
|
25
25
|
MaxRequestedPackets + 1);
|
|
26
26
|
static constexpr uint32_t DefaultRtt{ 100u };
|
|
27
27
|
|
|
@@ -33,10 +33,13 @@ namespace RTC
|
|
|
33
33
|
/* Instance methods. */
|
|
34
34
|
|
|
35
35
|
RtpStreamSend::RtpStreamSend(
|
|
36
|
-
RTP::RtpStreamSend::Listener* listener,
|
|
37
|
-
|
|
36
|
+
RTP::RtpStreamSend::Listener* listener,
|
|
37
|
+
SharedInterface* shared,
|
|
38
|
+
RTP::RtpStream::Params& params,
|
|
39
|
+
std::string& mid)
|
|
40
|
+
: RTP::RtpStream::RtpStream(listener, shared, params, 10),
|
|
38
41
|
mid(mid),
|
|
39
|
-
transmissionCounter(/*ignorePaddingOnlyPackets*/ true)
|
|
42
|
+
transmissionCounter(shared, /*ignorePaddingOnlyPackets*/ true)
|
|
40
43
|
{
|
|
41
44
|
MS_TRACE();
|
|
42
45
|
|
|
@@ -80,7 +83,7 @@ namespace RTC
|
|
|
80
83
|
{
|
|
81
84
|
MS_TRACE();
|
|
82
85
|
|
|
83
|
-
const uint64_t nowMs =
|
|
86
|
+
const uint64_t nowMs = this->shared->GetTimeMs();
|
|
84
87
|
|
|
85
88
|
auto baseStats = RTP::RtpStream::FillBufferStats(builder);
|
|
86
89
|
auto stats = FBS::RtpStream::CreateSendStats(
|
|
@@ -299,7 +302,7 @@ namespace RTC
|
|
|
299
302
|
/* Calculate RTT. */
|
|
300
303
|
|
|
301
304
|
// Get the NTP representation of the current timestamp.
|
|
302
|
-
const uint64_t nowMs =
|
|
305
|
+
const uint64_t nowMs = this->shared->GetTimeMs();
|
|
303
306
|
auto ntp = Utils::Time::TimeMs2Ntp(nowMs);
|
|
304
307
|
|
|
305
308
|
// Get the compact NTP representation of the current timestamp.
|
|
@@ -339,7 +342,7 @@ namespace RTC
|
|
|
339
342
|
{
|
|
340
343
|
MS_TRACE();
|
|
341
344
|
|
|
342
|
-
this->lastRrReceivedMs =
|
|
345
|
+
this->lastRrReceivedMs = this->shared->GetTimeMs();
|
|
343
346
|
this->lastRrTimestamp = report->GetNtpSec() << 16;
|
|
344
347
|
this->lastRrTimestamp += report->GetNtpFrac() >> 16;
|
|
345
348
|
}
|
|
@@ -482,7 +485,7 @@ namespace RTC
|
|
|
482
485
|
}
|
|
483
486
|
|
|
484
487
|
// Look for each requested packet.
|
|
485
|
-
const uint64_t nowMs =
|
|
488
|
+
const uint64_t nowMs = this->shared->GetTimeMs();
|
|
486
489
|
const uint16_t rtt = (this->rtt > 0.0f ? this->rtt : DefaultRtt);
|
|
487
490
|
uint16_t currentSeq = seq;
|
|
488
491
|
bool requested{ true };
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// #define MS_LOG_DEV_LEVEL 3
|
|
3
3
|
|
|
4
4
|
#include "RTC/RTP/RtxStream.hpp"
|
|
5
|
-
#include "DepLibUV.hpp"
|
|
6
5
|
#include "Logger.hpp"
|
|
7
6
|
#include "Utils.hpp"
|
|
8
7
|
|
|
@@ -18,7 +17,8 @@ namespace RTC
|
|
|
18
17
|
|
|
19
18
|
/* Instance methods. */
|
|
20
19
|
|
|
21
|
-
RtxStream::RtxStream(RTP::RtxStream::Params& params)
|
|
20
|
+
RtxStream::RtxStream(SharedInterface* shared, RTP::RtxStream::Params& params)
|
|
21
|
+
: shared(shared), params(params)
|
|
22
22
|
{
|
|
23
23
|
MS_TRACE();
|
|
24
24
|
|
|
@@ -57,7 +57,7 @@ namespace RTC
|
|
|
57
57
|
this->started = true;
|
|
58
58
|
this->maxSeq = seq - 1;
|
|
59
59
|
this->maxPacketTs = packet->GetTimestamp();
|
|
60
|
-
this->maxPacketMs =
|
|
60
|
+
this->maxPacketMs = this->shared->GetTimeMs();
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
// If not a valid packet ignore it.
|
|
@@ -76,7 +76,7 @@ namespace RTC
|
|
|
76
76
|
if (Utils::Number::IsHigherThan<uint32_t>(packet->GetTimestamp(), this->maxPacketTs))
|
|
77
77
|
{
|
|
78
78
|
this->maxPacketTs = packet->GetTimestamp();
|
|
79
|
-
this->maxPacketMs =
|
|
79
|
+
this->maxPacketMs = this->shared->GetTimeMs();
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
// Increase packet count.
|
|
@@ -141,7 +141,7 @@ namespace RTC
|
|
|
141
141
|
if (this->lastSrReceived != 0)
|
|
142
142
|
{
|
|
143
143
|
// Get delay in milliseconds.
|
|
144
|
-
const uint32_t delayMs =
|
|
144
|
+
const uint32_t delayMs = this->shared->GetTimeMs() - this->lastSrReceived;
|
|
145
145
|
// Express delay in units of 1/65536 seconds.
|
|
146
146
|
uint32_t dlsr = (delayMs / 1000) << 16;
|
|
147
147
|
|
|
@@ -163,7 +163,7 @@ namespace RTC
|
|
|
163
163
|
{
|
|
164
164
|
MS_TRACE();
|
|
165
165
|
|
|
166
|
-
this->lastSrReceived =
|
|
166
|
+
this->lastSrReceived = this->shared->GetTimeMs();
|
|
167
167
|
this->lastSrTimestamp = report->GetNtpSec() << 16;
|
|
168
168
|
this->lastSrTimestamp += report->GetNtpFrac() >> 16;
|
|
169
169
|
}
|
|
@@ -209,7 +209,7 @@ namespace RTC
|
|
|
209
209
|
InitSeq(seq);
|
|
210
210
|
|
|
211
211
|
this->maxPacketTs = packet->GetTimestamp();
|
|
212
|
-
this->maxPacketMs =
|
|
212
|
+
this->maxPacketMs = this->shared->GetTimeMs();
|
|
213
213
|
}
|
|
214
214
|
else
|
|
215
215
|
{
|