mediasoup 3.20.0 → 3.20.2
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/Consumer.d.ts.map +1 -1
- package/node/lib/Consumer.js +5 -4
- package/node/lib/DataConsumer.d.ts +2 -3
- package/node/lib/DataConsumer.d.ts.map +1 -1
- package/node/lib/DataConsumer.js +10 -7
- package/node/lib/DataConsumerTypes.d.ts +5 -4
- package/node/lib/DataConsumerTypes.d.ts.map +1 -1
- package/node/lib/DataProducer.d.ts.map +1 -1
- package/node/lib/DataProducer.js +2 -1
- package/node/lib/PipeTransport.d.ts.map +1 -1
- package/node/lib/PipeTransport.js +5 -4
- package/node/lib/PlainTransport.d.ts.map +1 -1
- package/node/lib/PlainTransport.js +6 -5
- package/node/lib/Producer.d.ts.map +1 -1
- package/node/lib/Producer.js +4 -3
- package/node/lib/Router.js +1 -1
- package/node/lib/WebRtcTransport.d.ts.map +1 -1
- package/node/lib/WebRtcTransport.js +6 -5
- package/node/lib/fbs/consumer/degrade-request.d.ts +30 -0
- package/node/lib/fbs/consumer/degrade-request.d.ts.map +1 -0
- package/node/lib/fbs/consumer/degrade-request.js +124 -0
- package/node/lib/fbs/consumer/enable-delay-and-loss-request.d.ts +24 -0
- package/node/lib/fbs/consumer/enable-delay-and-loss-request.d.ts.map +1 -0
- package/node/lib/fbs/consumer/enable-delay-and-loss-request.js +102 -0
- package/node/lib/fbs/data-consumer/send-response.d.ts +21 -0
- package/node/lib/fbs/data-consumer/send-response.d.ts.map +1 -0
- package/node/lib/fbs/data-consumer/send-response.js +91 -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 +4 -1
- package/node/lib/fbs/producer/degrade-request.d.ts +30 -0
- package/node/lib/fbs/producer/degrade-request.d.ts.map +1 -0
- package/node/lib/fbs/producer/degrade-request.js +124 -0
- package/node/lib/fbs/response/body.d.ts +7 -5
- package/node/lib/fbs/response/body.d.ts.map +1 -1
- package/node/lib/fbs/response/body.js +7 -3
- package/node/lib/fbs/response/response.d.ts +3 -2
- package/node/lib/fbs/response/response.d.ts.map +1 -1
- package/node/lib/fbs/sctp-parameters/num-sctp-streams.d.ts.map +1 -1
- package/node/lib/fbs/sctp-parameters/num-sctp-streams.js +5 -5
- package/node/lib/fbs/transport/sctp-negotiated-max-streams-notification.d.ts +24 -0
- package/node/lib/fbs/transport/sctp-negotiated-max-streams-notification.d.ts.map +1 -0
- package/node/lib/fbs/transport/sctp-negotiated-max-streams-notification.js +102 -0
- package/node/lib/fbs/transport/sctp-negotiated-options-notification.d.ts +24 -0
- package/node/lib/fbs/transport/sctp-negotiated-options-notification.d.ts.map +1 -0
- package/node/lib/fbs/transport/sctp-negotiated-options-notification.js +102 -0
- package/node/lib/fbs/worker/close-notification.d.ts +18 -0
- package/node/lib/fbs/worker/close-notification.d.ts.map +1 -0
- package/node/lib/fbs/worker/close-notification.js +78 -0
- package/node/lib/fbs/worker/close-request.d.ts +18 -0
- package/node/lib/fbs/worker/close-request.d.ts.map +1 -0
- package/node/lib/fbs/worker/close-request.js +78 -0
- package/node/lib/fbs/worker/close-worker-notification.d.ts +18 -0
- package/node/lib/fbs/worker/close-worker-notification.d.ts.map +1 -0
- package/node/lib/fbs/worker/close-worker-notification.js +78 -0
- package/node/lib/sctpParametersTypes.d.ts +23 -0
- package/node/lib/sctpParametersTypes.d.ts.map +1 -1
- package/node/lib/test/test-Consumer.js +194 -0
- package/node/lib/test/test-DataConsumer.js +6 -0
- package/node/lib/test/test-Router.js +11 -0
- package/node/lib/test/test-werift-sctp.js +7 -0
- package/npm-scripts.mjs +2 -2
- package/package.json +7 -6
- package/worker/Makefile +5 -1
- package/worker/deps/libwebrtc/meson.build +5 -1
- package/worker/fbs/dataConsumer.fbs +4 -0
- package/worker/fbs/response.fbs +1 -0
- package/worker/fuzzer/src/RTC/RTP/FuzzerPacket.cpp +2 -2
- package/worker/include/Channel/ChannelMessageRegistrator.hpp +4 -3
- package/worker/include/Channel/ChannelNotification.hpp +0 -4
- package/worker/include/Channel/ChannelRequest.hpp +3 -4
- package/worker/include/DepLibSRTP.hpp +2 -2
- package/worker/include/RTC/ActiveSpeakerObserver.hpp +2 -2
- package/worker/include/RTC/AudioLevelObserver.hpp +2 -2
- package/worker/include/RTC/Consumer.hpp +1 -1
- package/worker/include/RTC/DataConsumer.hpp +2 -2
- package/worker/include/RTC/DtlsTransport.hpp +4 -4
- package/worker/include/RTC/ICE/IceServer.hpp +2 -2
- package/worker/include/RTC/ICE/StunPacket.hpp +34 -34
- package/worker/include/RTC/KeyFrameRequestManager.hpp +3 -3
- package/worker/include/RTC/Parameters.hpp +2 -2
- package/worker/include/RTC/PipeConsumer.hpp +6 -5
- package/worker/include/RTC/PlainTransport.hpp +0 -1
- package/worker/include/RTC/PortManager.hpp +92 -12
- package/worker/include/RTC/Producer.hpp +7 -6
- package/worker/include/RTC/RTCP/Feedback.hpp +1 -2
- package/worker/include/RTC/RTCP/FeedbackRtpTransport.hpp +2 -2
- package/worker/include/RTC/RTCP/Packet.hpp +2 -2
- package/worker/include/RTC/RTCP/Sdes.hpp +1 -1
- package/worker/include/RTC/RTP/Codecs/DependencyDescriptor.hpp +2 -1
- package/worker/include/RTC/RTP/Packet.hpp +57 -57
- package/worker/include/RTC/RTP/ProbationGenerator.hpp +2 -2
- package/worker/include/RTC/RTP/SharedPacket.hpp +4 -4
- package/worker/include/RTC/Router.hpp +12 -11
- package/worker/include/RTC/RtcLogger.hpp +2 -2
- package/worker/include/RTC/RtpDictionaries.hpp +6 -6
- package/worker/include/RTC/RtpListener.hpp +4 -4
- package/worker/include/RTC/SCTP/association/Association.hpp +13 -13
- package/worker/include/RTC/SCTP/association/HeartbeatHandler.hpp +2 -2
- package/worker/include/RTC/SCTP/association/NegotiatedCapabilities.hpp +2 -2
- package/worker/include/RTC/SCTP/association/PacketSender.hpp +3 -3
- package/worker/include/RTC/SCTP/association/StateCookie.hpp +9 -9
- package/worker/include/RTC/SCTP/association/StreamResetHandler.hpp +4 -4
- package/worker/include/RTC/SCTP/association/TransmissionControlBlock.hpp +24 -24
- package/worker/include/RTC/SCTP/association/TransmissionControlBlockContextInterface.hpp +4 -4
- package/worker/include/RTC/SCTP/packet/Chunk.hpp +86 -86
- package/worker/include/RTC/SCTP/packet/ErrorCause.hpp +18 -18
- package/worker/include/RTC/SCTP/packet/Packet.hpp +33 -33
- package/worker/include/RTC/SCTP/packet/Parameter.hpp +24 -24
- package/worker/include/RTC/SCTP/packet/TLV.hpp +13 -13
- package/worker/include/RTC/SCTP/packet/UserData.hpp +4 -4
- package/worker/include/RTC/SCTP/packet/chunks/AbortAssociationChunk.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/chunks/AnyDataChunk.hpp +9 -9
- package/worker/include/RTC/SCTP/packet/chunks/AnyForwardTsnChunk.hpp +3 -3
- package/worker/include/RTC/SCTP/packet/chunks/CookieAckChunk.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/chunks/CookieEchoChunk.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/chunks/DataChunk.hpp +11 -11
- package/worker/include/RTC/SCTP/packet/chunks/ForwardTsnChunk.hpp +6 -6
- package/worker/include/RTC/SCTP/packet/chunks/HeartbeatAckChunk.hpp +6 -6
- package/worker/include/RTC/SCTP/packet/chunks/HeartbeatRequestChunk.hpp +6 -6
- package/worker/include/RTC/SCTP/packet/chunks/IDataChunk.hpp +6 -6
- package/worker/include/RTC/SCTP/packet/chunks/IForwardTsnChunk.hpp +7 -7
- package/worker/include/RTC/SCTP/packet/chunks/InitAckChunk.hpp +10 -10
- package/worker/include/RTC/SCTP/packet/chunks/InitChunk.hpp +8 -8
- package/worker/include/RTC/SCTP/packet/chunks/OperationErrorChunk.hpp +6 -6
- package/worker/include/RTC/SCTP/packet/chunks/ReConfigChunk.hpp +10 -10
- package/worker/include/RTC/SCTP/packet/chunks/SackChunk.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/chunks/ShutdownAckChunk.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/chunks/ShutdownChunk.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/chunks/ShutdownCompleteChunk.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/chunks/UnknownChunk.hpp +2 -2
- package/worker/include/RTC/SCTP/packet/errorCauses/CookieReceivedWhileShuttingDownErrorCause.hpp +4 -4
- package/worker/include/RTC/SCTP/packet/errorCauses/InvalidMandatoryParameterErrorCause.hpp +4 -4
- package/worker/include/RTC/SCTP/packet/errorCauses/InvalidStreamIdentifierErrorCause.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/errorCauses/MissingMandatoryParameterErrorCause.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/errorCauses/NoUserDataErrorCause.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/errorCauses/OutOfResourceErrorCause.hpp +4 -4
- package/worker/include/RTC/SCTP/packet/errorCauses/ProtocolViolationErrorCause.hpp +4 -4
- package/worker/include/RTC/SCTP/packet/errorCauses/RestartOfAnAssociationWithNewAddressesErrorCause.hpp +4 -4
- package/worker/include/RTC/SCTP/packet/errorCauses/StaleCookieErrorCause.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/errorCauses/UnknownErrorCause.hpp +2 -2
- package/worker/include/RTC/SCTP/packet/errorCauses/UnrecognizedChunkTypeErrorCause.hpp +4 -4
- package/worker/include/RTC/SCTP/packet/errorCauses/UnrecognizedParametersErrorCause.hpp +4 -4
- package/worker/include/RTC/SCTP/packet/errorCauses/UnresolvableAddressErrorCause.hpp +4 -4
- package/worker/include/RTC/SCTP/packet/errorCauses/UserInitiatedAbortErrorCause.hpp +4 -4
- package/worker/include/RTC/SCTP/packet/parameters/AddIncomingStreamsRequestParameter.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/parameters/AddOutgoingStreamsRequestParameter.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/parameters/CookiePreservativeParameter.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/parameters/ForwardTsnSupportedParameter.hpp +4 -4
- package/worker/include/RTC/SCTP/packet/parameters/HeartbeatInfoParameter.hpp +3 -3
- package/worker/include/RTC/SCTP/packet/parameters/IPv4AddressParameter.hpp +4 -4
- package/worker/include/RTC/SCTP/packet/parameters/IPv6AddressParameter.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/parameters/IncomingSsnResetRequestParameter.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/parameters/OutgoingSsnResetRequestParameter.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/parameters/ReconfigurationResponseParameter.hpp +7 -7
- package/worker/include/RTC/SCTP/packet/parameters/SsnTsnResetRequestParameter.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/parameters/StateCookieParameter.hpp +5 -5
- package/worker/include/RTC/SCTP/packet/parameters/SupportedAddressTypesParameter.hpp +4 -4
- package/worker/include/RTC/SCTP/packet/parameters/SupportedExtensionsParameter.hpp +4 -4
- package/worker/include/RTC/SCTP/packet/parameters/UnknownParameter.hpp +2 -2
- package/worker/include/RTC/SCTP/packet/parameters/UnrecognizedParameterParameter.hpp +4 -4
- package/worker/include/RTC/SCTP/packet/parameters/ZeroChecksumAcceptableParameter.hpp +7 -7
- package/worker/include/RTC/SCTP/public/AssociationInterface.hpp +7 -7
- package/worker/include/RTC/SCTP/public/AssociationListenerInterface.hpp +26 -26
- package/worker/include/RTC/SCTP/public/AssociationMetrics.hpp +7 -7
- package/worker/include/RTC/SCTP/public/Message.hpp +1 -1
- package/worker/include/RTC/SCTP/public/SctpOptions.hpp +4 -4
- package/worker/include/RTC/SCTP/public/SctpTypes.hpp +10 -10
- package/worker/include/RTC/SCTP/rx/DataTracker.hpp +1 -1
- package/worker/include/RTC/SCTP/rx/ReassemblyStreamsInterface.hpp +1 -1
- package/worker/include/RTC/SCTP/tx/OutstandingData.hpp +39 -39
- package/worker/include/RTC/SCTP/tx/RetransmissionErrorCounter.hpp +1 -1
- package/worker/include/RTC/SCTP/tx/RetransmissionQueue.hpp +14 -14
- package/worker/include/RTC/SCTP/tx/RoundRobinSendQueue.hpp +1 -1
- package/worker/include/RTC/SctpListener.hpp +2 -2
- package/worker/include/RTC/SimulcastConsumer.hpp +2 -1
- package/worker/include/RTC/TcpServer.hpp +3 -2
- package/worker/include/RTC/Transport.hpp +8 -8
- package/worker/include/RTC/UdpSocket.hpp +3 -2
- package/worker/include/RTC/WebRtcServer.hpp +4 -5
- package/worker/include/RTC/WebRtcTransport.hpp +2 -2
- package/worker/include/Settings.hpp +3 -3
- package/worker/include/Worker.hpp +3 -3
- package/worker/include/handles/TcpServerHandle.hpp +2 -2
- package/worker/meson.build +9 -4
- package/worker/mocks/include/Channel/MockChannelMessageRegistrator.hpp +4 -3
- package/worker/src/Channel/ChannelNotification.cpp +5 -4
- package/worker/src/Channel/ChannelRequest.cpp +9 -6
- package/worker/src/DepLibSRTP.cpp +1 -1
- package/worker/src/RTC/AudioLevelObserver.cpp +2 -2
- package/worker/src/RTC/DataConsumer.cpp +13 -3
- package/worker/src/RTC/DataProducer.cpp +1 -1
- package/worker/src/RTC/DtlsTransport.cpp +3 -3
- package/worker/src/RTC/ICE/IceServer.cpp +1 -1
- package/worker/src/RTC/ICE/StunPacket.cpp +77 -77
- package/worker/src/RTC/PipeTransport.cpp +5 -4
- package/worker/src/RTC/PlainTransport.cpp +9 -8
- package/worker/src/RTC/PortManager.cpp +174 -114
- package/worker/src/RTC/Producer.cpp +0 -1
- package/worker/src/RTC/RTCP/Feedback.cpp +6 -6
- package/worker/src/RTC/RTCP/FeedbackPs.cpp +1 -1
- package/worker/src/RTC/RTCP/FeedbackPsAfb.cpp +1 -1
- package/worker/src/RTC/RTCP/FeedbackPsPli.cpp +1 -1
- package/worker/src/RTC/RTCP/FeedbackPsRemb.cpp +2 -2
- package/worker/src/RTC/RTCP/FeedbackRtp.cpp +1 -1
- package/worker/src/RTC/RTCP/FeedbackRtpSrReq.cpp +1 -1
- package/worker/src/RTC/RTCP/FeedbackRtpTransport.cpp +2 -2
- package/worker/src/RTC/RTCP/Packet.cpp +2 -2
- package/worker/src/RTC/RTCP/Sdes.cpp +1 -1
- package/worker/src/RTC/RTP/Codecs/DependencyDescriptor.cpp +2 -1
- package/worker/src/RTC/RTP/Packet.cpp +68 -68
- package/worker/src/RTC/RTP/ProbationGenerator.cpp +3 -3
- package/worker/src/RTC/RTP/RtpStreamRecv.cpp +3 -3
- package/worker/src/RTC/RTP/RtxStream.cpp +2 -2
- package/worker/src/RTC/RTP/SharedPacket.cpp +4 -4
- package/worker/src/RTC/Router.cpp +5 -5
- package/worker/src/RTC/RtcLogger.cpp +1 -1
- package/worker/src/RTC/RtpDictionaries/RtpCodecMimeType.cpp +4 -4
- package/worker/src/RTC/RtpDictionaries/RtpParameters.cpp +2 -3
- package/worker/src/RTC/SCTP/association/Association.cpp +100 -97
- package/worker/src/RTC/SCTP/association/HeartbeatHandler.cpp +6 -6
- package/worker/src/RTC/SCTP/association/NegotiatedCapabilities.cpp +3 -3
- package/worker/src/RTC/SCTP/association/PacketSender.cpp +1 -1
- package/worker/src/RTC/SCTP/association/StreamResetHandler.cpp +2 -2
- package/worker/src/RTC/SCTP/association/TransmissionControlBlock.cpp +5 -5
- package/worker/src/RTC/SCTP/packet/Chunk.cpp +52 -52
- package/worker/src/RTC/SCTP/packet/ErrorCause.cpp +14 -14
- package/worker/src/RTC/SCTP/packet/Packet.cpp +17 -17
- package/worker/src/RTC/SCTP/packet/Parameter.cpp +17 -17
- package/worker/src/RTC/SCTP/packet/TLV.cpp +8 -8
- package/worker/src/RTC/SCTP/packet/chunks/AbortAssociationChunk.cpp +3 -3
- package/worker/src/RTC/SCTP/packet/chunks/CookieAckChunk.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/chunks/CookieEchoChunk.cpp +1 -1
- package/worker/src/RTC/SCTP/packet/chunks/DataChunk.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/chunks/ForwardTsnChunk.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/chunks/HeartbeatAckChunk.cpp +3 -3
- package/worker/src/RTC/SCTP/packet/chunks/HeartbeatRequestChunk.cpp +3 -3
- package/worker/src/RTC/SCTP/packet/chunks/IDataChunk.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/chunks/IForwardTsnChunk.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/chunks/InitAckChunk.cpp +4 -4
- package/worker/src/RTC/SCTP/packet/chunks/InitChunk.cpp +4 -4
- package/worker/src/RTC/SCTP/packet/chunks/OperationErrorChunk.cpp +3 -3
- package/worker/src/RTC/SCTP/packet/chunks/ReConfigChunk.cpp +3 -3
- package/worker/src/RTC/SCTP/packet/chunks/SackChunk.cpp +3 -3
- package/worker/src/RTC/SCTP/packet/chunks/ShutdownAckChunk.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/chunks/ShutdownChunk.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/chunks/ShutdownCompleteChunk.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/errorCauses/CookieReceivedWhileShuttingDownErrorCause.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/errorCauses/InvalidMandatoryParameterErrorCause.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/errorCauses/InvalidStreamIdentifierErrorCause.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/errorCauses/MissingMandatoryParameterErrorCause.cpp +4 -4
- package/worker/src/RTC/SCTP/packet/errorCauses/NoUserDataErrorCause.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/errorCauses/OutOfResourceErrorCause.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/errorCauses/ProtocolViolationErrorCause.cpp +1 -1
- package/worker/src/RTC/SCTP/packet/errorCauses/RestartOfAnAssociationWithNewAddressesErrorCause.cpp +1 -1
- package/worker/src/RTC/SCTP/packet/errorCauses/StaleCookieErrorCause.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/errorCauses/UnrecognizedChunkTypeErrorCause.cpp +1 -1
- package/worker/src/RTC/SCTP/packet/errorCauses/UnrecognizedParametersErrorCause.cpp +1 -1
- package/worker/src/RTC/SCTP/packet/errorCauses/UnresolvableAddressErrorCause.cpp +1 -1
- package/worker/src/RTC/SCTP/packet/errorCauses/UserInitiatedAbortErrorCause.cpp +1 -1
- package/worker/src/RTC/SCTP/packet/parameters/AddIncomingStreamsRequestParameter.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/parameters/AddOutgoingStreamsRequestParameter.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/parameters/CookiePreservativeParameter.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/parameters/ForwardTsnSupportedParameter.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/parameters/HeartbeatInfoParameter.cpp +1 -1
- package/worker/src/RTC/SCTP/packet/parameters/IPv4AddressParameter.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/parameters/IPv6AddressParameter.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/parameters/IncomingSsnResetRequestParameter.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/parameters/OutgoingSsnResetRequestParameter.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/parameters/ReconfigurationResponseParameter.cpp +3 -3
- package/worker/src/RTC/SCTP/packet/parameters/SsnTsnResetRequestParameter.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/parameters/StateCookieParameter.cpp +3 -3
- package/worker/src/RTC/SCTP/packet/parameters/SupportedAddressTypesParameter.cpp +3 -3
- package/worker/src/RTC/SCTP/packet/parameters/SupportedExtensionsParameter.cpp +1 -1
- package/worker/src/RTC/SCTP/packet/parameters/UnrecognizedParameterParameter.cpp +1 -1
- package/worker/src/RTC/SCTP/packet/parameters/ZeroChecksumAcceptableParameter.cpp +3 -3
- package/worker/src/RTC/SCTP/rx/InterleavedReassemblyStreams.cpp +1 -0
- package/worker/src/RTC/SCTP/rx/TraditionalReassemblyStreams.cpp +1 -0
- package/worker/src/RTC/SCTP/tx/OutstandingData.cpp +8 -8
- package/worker/src/RTC/SCTP/tx/RoundRobinSendQueue.cpp +1 -1
- package/worker/src/RTC/SvcConsumer.cpp +6 -2
- package/worker/src/RTC/TcpServer.cpp +4 -4
- package/worker/src/RTC/Transport.cpp +42 -19
- package/worker/src/RTC/UdpSocket.cpp +4 -4
- package/worker/src/RTC/WebRtcServer.cpp +8 -8
- package/worker/src/RTC/WebRtcTransport.cpp +9 -8
- package/worker/src/Settings.cpp +2 -2
- package/worker/src/lib.cpp +1 -2
- package/worker/subprojects/packagefiles/ankerl-unordered-dense/meson.build +5 -0
- package/worker/subprojects/unordered-dense.wrap +9 -0
- package/worker/tasks.py +293 -196
- package/worker/test/src/RTC/ICE/TestStunPacket.cpp +22 -22
- package/worker/test/src/RTC/ICE/iceCommon.cpp +1 -1
- package/worker/test/src/RTC/RTCP/TestFeedbackRtpEcn.cpp +8 -8
- package/worker/test/src/RTC/RTCP/TestFeedbackRtpNack.cpp +1 -1
- package/worker/test/src/RTC/RTCP/TestFeedbackRtpSrReq.cpp +1 -1
- package/worker/test/src/RTC/RTCP/TestFeedbackRtpTllei.cpp +1 -1
- package/worker/test/src/RTC/RTCP/TestFeedbackRtpTmmb.cpp +1 -1
- package/worker/test/src/RTC/RTCP/TestSenderReport.cpp +1 -1
- package/worker/test/src/RTC/RTP/TestPacket.cpp +26 -26
- package/worker/test/src/RTC/RTP/TestSharedPacket.cpp +1 -1
- package/worker/test/src/RTC/RTP/rtpCommon.cpp +1 -1
- package/worker/test/src/RTC/SCTP/association/TestNegotiatedCapabilities.cpp +4 -4
- package/worker/test/src/RTC/SCTP/packet/TestPacket.cpp +14 -14
- package/worker/test/src/RTC/SCTP/packet/chunks/TestAbortAssociationChunk.cpp +4 -4
- 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/TestForwardTsnChunk.cpp +3 -3
- package/worker/test/src/RTC/SCTP/packet/chunks/TestHeartbeatAckChunk.cpp +3 -3
- package/worker/test/src/RTC/SCTP/packet/chunks/TestHeartbeatRequestChunk.cpp +9 -9
- package/worker/test/src/RTC/SCTP/packet/chunks/TestIDataChunk.cpp +2 -2
- package/worker/test/src/RTC/SCTP/packet/chunks/TestIForwardTsnChunk.cpp +3 -3
- package/worker/test/src/RTC/SCTP/packet/chunks/TestInitAckChunk.cpp +3 -3
- package/worker/test/src/RTC/SCTP/packet/chunks/TestInitChunk.cpp +8 -8
- package/worker/test/src/RTC/SCTP/packet/chunks/TestOperationErrorChunk.cpp +7 -7
- package/worker/test/src/RTC/SCTP/packet/chunks/TestReConfigChunk.cpp +6 -6
- package/worker/test/src/RTC/SCTP/packet/chunks/TestSackChunk.cpp +2 -2
- package/worker/test/src/RTC/SCTP/packet/chunks/TestShutdownAckChunk.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 +2 -2
- 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 +6 -6
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestMissingMandatoryParameterErrorCause.cpp +11 -11
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestNoUserDataErrorCause.cpp +6 -6
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestOutOfResourceErrorCause.cpp +5 -5
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestProtocolViolationErrorCause.cpp +2 -2
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestRestartOfAnAssociationWithNewAddressesErrorCause.cpp +2 -2
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestStaleCookieErrorCause.cpp +6 -6
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnknownErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnrecognizedChunkTypeErrorCause.cpp +2 -2
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnrecognizedParametersErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnresolvableAddressErrorCause.cpp +2 -2
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUserInitiatedAbortErrorCause.cpp +2 -2
- 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 +7 -7
- package/worker/test/src/RTC/SCTP/packet/parameters/TestForwardTsnSupportedParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestHeartbeatInfoParameter.cpp +2 -2
- package/worker/test/src/RTC/SCTP/packet/parameters/TestIPv4AddressParameter.cpp +7 -7
- package/worker/test/src/RTC/SCTP/packet/parameters/TestIPv6AddressParameter.cpp +7 -7
- package/worker/test/src/RTC/SCTP/packet/parameters/TestIncomingSsnResetRequestParameter.cpp +2 -2
- package/worker/test/src/RTC/SCTP/packet/parameters/TestOutgoingSsnResetRequestParameter.cpp +2 -2
- package/worker/test/src/RTC/SCTP/packet/parameters/TestReconfigurationResponseParameter.cpp +5 -5
- 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 +6 -6
- package/worker/test/src/RTC/SCTP/packet/parameters/TestSupportedExtensionsParameter.cpp +3 -3
- 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/sctpCommon.cpp +1 -1
- package/worker/test/src/RTC/SCTP/tx/TestOutstandingData.cpp +3 -3
- package/worker/test/src/RTC/SCTP/tx/TestRetransmissionQueue.cpp +1 -1
- package/worker/test/src/RTC/TestNackGenerator.cpp +1 -1
- package/worker/test/src/RTC/TestPortManager.cpp +126 -0
- package/worker/test/src/RTC/TestTransportCongestionControlServer.cpp +2 -2
- package/worker/test/src/RTC/TestTransportTuple.cpp +3 -2
- package/worker/test/src/Utils/TestCrypto.cpp +3 -3
- package/worker/test/src/Utils/TestString.cpp +1 -1
|
@@ -15,7 +15,7 @@ namespace RTC
|
|
|
15
15
|
struct AssociationMetrics
|
|
16
16
|
{
|
|
17
17
|
/**
|
|
18
|
-
* Number of SCTP
|
|
18
|
+
* Number of SCTP packets sent.
|
|
19
19
|
*/
|
|
20
20
|
uint64_t txPacketsCount{ 0 };
|
|
21
21
|
|
|
@@ -25,7 +25,7 @@ namespace RTC
|
|
|
25
25
|
uint64_t txMessagesCount{ 0 };
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
|
-
* Number of SCTP
|
|
28
|
+
* Number of SCTP packets received.
|
|
29
29
|
*/
|
|
30
30
|
uint64_t rxPacketsCount{ 0 };
|
|
31
31
|
|
|
@@ -35,10 +35,10 @@ namespace RTC
|
|
|
35
35
|
uint64_t rxMessagesCount{ 0 };
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
|
-
* Number of
|
|
39
|
-
* retransmitted DATA or I-DATA
|
|
38
|
+
* Number of packets retransmitted. Since SCTP packets can contain both
|
|
39
|
+
* retransmitted DATA or I-DATA chunks and chunks that are transmitted for
|
|
40
40
|
* the first time, this represents an upper bound as it's incremented
|
|
41
|
-
* every time a
|
|
41
|
+
* every time a packet contains a retransmitted DATA or I-DATA chunk.
|
|
42
42
|
*/
|
|
43
43
|
uint64_t rtxPacketsCount{ 0 };
|
|
44
44
|
|
|
@@ -76,7 +76,7 @@ namespace RTC
|
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
78
|
* SCTP implementation of the peer. Only detected when the peer sends an
|
|
79
|
-
*
|
|
79
|
+
* INIT-ACK chunk to us with a State Cookie.
|
|
80
80
|
*/
|
|
81
81
|
Types::SctpImplementation peerImplementation{ Types::SctpImplementation::UNKNOWN };
|
|
82
82
|
|
|
@@ -102,7 +102,7 @@ namespace RTC
|
|
|
102
102
|
bool usesPartialReliability{ false };
|
|
103
103
|
|
|
104
104
|
/**
|
|
105
|
-
* Whether Stream Schedulers and User Message Interleaving (I-DATA
|
|
105
|
+
* Whether Stream Schedulers and User Message Interleaving (I-DATA chunks)
|
|
106
106
|
* have been negotiated.
|
|
107
107
|
*
|
|
108
108
|
* @see RFC 8260.
|
|
@@ -41,7 +41,7 @@ namespace RTC
|
|
|
41
41
|
uint16_t announcedMaxInboundStreams{ 65535 };
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
|
-
* Maximum size of an SCTP
|
|
44
|
+
* Maximum size of an SCTP packet. It doesn't include any overhead of
|
|
45
45
|
* DTLS, TURN, UDP or IP headers.
|
|
46
46
|
*/
|
|
47
47
|
size_t mtu{ RTC::Consts::MaxSafeMtuSizeForSctp };
|
|
@@ -147,7 +147,7 @@ namespace RTC
|
|
|
147
147
|
|
|
148
148
|
/**
|
|
149
149
|
* The maximum time when a SACK will be sent from the arrival of an
|
|
150
|
-
* unacknowledged
|
|
150
|
+
* unacknowledged packet. Whatever is smallest of RTO/2 and this will be
|
|
151
151
|
* used.
|
|
152
152
|
*/
|
|
153
153
|
uint64_t delayedAckMaxTimeoutMs{ 200 };
|
|
@@ -220,7 +220,7 @@ namespace RTC
|
|
|
220
220
|
size_t maxBurst{ 4 };
|
|
221
221
|
|
|
222
222
|
/**
|
|
223
|
-
* Maximum data retransmit attempts (for DATA,
|
|
223
|
+
* Maximum data retransmit attempts (for DATA, I-DATA and other chunks).
|
|
224
224
|
* Set to std::nullopt for no limit.
|
|
225
225
|
*/
|
|
226
226
|
std::optional<uint16_t> maxRetransmissions{ 10 };
|
|
@@ -240,7 +240,7 @@ namespace RTC
|
|
|
240
240
|
bool enablePartialReliability{ true };
|
|
241
241
|
|
|
242
242
|
/**
|
|
243
|
-
* Enable Stream Schedulers and User Message Interleaving (I-DATA
|
|
243
|
+
* Enable Stream Schedulers and User Message Interleaving (I-DATA chunks).
|
|
244
244
|
*
|
|
245
245
|
* @see RFC 8260.
|
|
246
246
|
*/
|
|
@@ -25,25 +25,25 @@ namespace RTC
|
|
|
25
25
|
*/
|
|
26
26
|
NEW,
|
|
27
27
|
/**
|
|
28
|
-
* The
|
|
28
|
+
* The association is closed.
|
|
29
29
|
*/
|
|
30
30
|
CLOSED,
|
|
31
31
|
/**
|
|
32
|
-
* The
|
|
32
|
+
* The association has initiated a connection, which is not yet
|
|
33
33
|
* established.
|
|
34
34
|
*
|
|
35
35
|
* @remarks
|
|
36
|
-
* - For incoming connections and for reconnections when the
|
|
37
|
-
* is already connected, the
|
|
36
|
+
* - For incoming connections and for reconnections when the association
|
|
37
|
+
* is already connected, the association will not transition to this
|
|
38
38
|
* state.
|
|
39
39
|
*/
|
|
40
40
|
CONNECTING,
|
|
41
41
|
/**
|
|
42
|
-
* The
|
|
42
|
+
* The association is connected and the connection is established.
|
|
43
43
|
*/
|
|
44
44
|
CONNECTED,
|
|
45
45
|
/**
|
|
46
|
-
* The
|
|
46
|
+
* The association is shutting down, and the connection is not yet closed.
|
|
47
47
|
*/
|
|
48
48
|
SHUTTING_DOWN
|
|
49
49
|
};
|
|
@@ -98,7 +98,7 @@ namespace RTC
|
|
|
98
98
|
TOO_MANY_RETRIES,
|
|
99
99
|
/**
|
|
100
100
|
* A command was received that is only possible to execute when the
|
|
101
|
-
*
|
|
101
|
+
* association is connected, which it is not.
|
|
102
102
|
*/
|
|
103
103
|
NOT_CONNECTED,
|
|
104
104
|
/**
|
|
@@ -166,7 +166,7 @@ namespace RTC
|
|
|
166
166
|
|
|
167
167
|
case ErrorKind::PROTOCOL_VIOLATION:
|
|
168
168
|
{
|
|
169
|
-
return "
|
|
169
|
+
return "PROTOCOL-VIOLATION";
|
|
170
170
|
}
|
|
171
171
|
|
|
172
172
|
case ErrorKind::RESOURCE_EXHAUSTION:
|
|
@@ -292,13 +292,13 @@ namespace RTC
|
|
|
292
292
|
ERROR_MESSAGE_TOO_LARGE,
|
|
293
293
|
|
|
294
294
|
/**
|
|
295
|
-
* The message could not be enqueued as the
|
|
295
|
+
* The message could not be enqueued as the association is out of
|
|
296
296
|
* resources. This mainly indicates that the send queue is full.
|
|
297
297
|
*/
|
|
298
298
|
ERROR_RESOURCE_EXHAUSTION,
|
|
299
299
|
|
|
300
300
|
/**
|
|
301
|
-
* The message could not be sent as the
|
|
301
|
+
* The message could not be sent as the association is shutting down.
|
|
302
302
|
*/
|
|
303
303
|
ERROR_SHUTTING_DOWN
|
|
304
304
|
};
|
|
@@ -246,7 +246,7 @@ namespace RTC
|
|
|
246
246
|
bool WillIncreaseCumAckTsn(uint32_t tsn) const;
|
|
247
247
|
|
|
248
248
|
/**
|
|
249
|
-
* Adds a SACK chunk with selective ack to the given
|
|
249
|
+
* Adds a SACK chunk with selective ack to the given packet.
|
|
250
250
|
*
|
|
251
251
|
* @remarks
|
|
252
252
|
* - It will clear `this->duplicates`, so every SACK chunk that is
|
|
@@ -73,7 +73,7 @@ namespace RTC
|
|
|
73
73
|
/**
|
|
74
74
|
* Called for incoming (possibly deferred) RE-CONFIG chunks asking for
|
|
75
75
|
* either a few streams, or all streams (when the list is empty) to be
|
|
76
|
-
* reset - to have their next SSN or
|
|
76
|
+
* reset - to have their next SSN or message ID to be zero.
|
|
77
77
|
*/
|
|
78
78
|
virtual void ResetStreams(std::span<const uint16_t> streamIds) = 0;
|
|
79
79
|
};
|
|
@@ -38,26 +38,26 @@ namespace RTC
|
|
|
38
38
|
enum class State : uint8_t
|
|
39
39
|
{
|
|
40
40
|
/**
|
|
41
|
-
* The
|
|
42
|
-
* of view, as no SACK has been received yet that reference this
|
|
41
|
+
* The chunk has been sent but not received yet (from the sender's point
|
|
42
|
+
* of view, as no SACK has been received yet that reference this chunk).
|
|
43
43
|
*/
|
|
44
44
|
IN_FLIGHT,
|
|
45
45
|
/**
|
|
46
|
-
* A SACK has been received which explicitly marked this
|
|
46
|
+
* A SACK has been received which explicitly marked this chunk as missing.
|
|
47
47
|
* It's now NACKED and may be retransmitted if NACKED enough times.
|
|
48
48
|
*/
|
|
49
49
|
NACKED,
|
|
50
50
|
/**
|
|
51
|
-
* A
|
|
51
|
+
* A chunk that will be retransmitted when possible.
|
|
52
52
|
*/
|
|
53
53
|
TO_BE_RETRANSMITTED,
|
|
54
54
|
/**
|
|
55
|
-
* A SACK has been received which explicitly marked this
|
|
55
|
+
* A SACK has been received which explicitly marked this chunk as
|
|
56
56
|
* received.
|
|
57
57
|
*/
|
|
58
58
|
ACKED,
|
|
59
59
|
/**
|
|
60
|
-
* A
|
|
60
|
+
* A chunk whose message has expired or has been retransmitted too many
|
|
61
61
|
* times (RFC3758). It will not be retransmitted anymore.
|
|
62
62
|
*/
|
|
63
63
|
ABANDONED,
|
|
@@ -128,16 +128,16 @@ namespace RTC
|
|
|
128
128
|
enum class Lifecycle : uint8_t
|
|
129
129
|
{
|
|
130
130
|
/**
|
|
131
|
-
* The
|
|
131
|
+
* The chunk is alive (sent, received, etc).
|
|
132
132
|
*/
|
|
133
133
|
ACTIVE,
|
|
134
134
|
/**
|
|
135
|
-
* The
|
|
135
|
+
* The chunk is scheduled to be retransmitted, and will then
|
|
136
136
|
* transition to become active.
|
|
137
137
|
*/
|
|
138
138
|
TO_BE_RETRANSMITTED,
|
|
139
139
|
/**
|
|
140
|
-
* The
|
|
140
|
+
* The chunk has been abandoned. This is a terminal state.
|
|
141
141
|
*/
|
|
142
142
|
ABANDONED
|
|
143
143
|
};
|
|
@@ -145,15 +145,15 @@ namespace RTC
|
|
|
145
145
|
enum class AckState : uint8_t
|
|
146
146
|
{
|
|
147
147
|
/**
|
|
148
|
-
* The
|
|
148
|
+
* The chunk is in-flight.
|
|
149
149
|
*/
|
|
150
150
|
UNACKED,
|
|
151
151
|
/**
|
|
152
|
-
* The
|
|
152
|
+
* The chunk has been received and acknowledged.
|
|
153
153
|
*/
|
|
154
154
|
ACKED,
|
|
155
155
|
/**
|
|
156
|
-
* The
|
|
156
|
+
* The chunk has been nacked and is possibly lost.
|
|
157
157
|
*/
|
|
158
158
|
NACKED
|
|
159
159
|
};
|
|
@@ -232,7 +232,7 @@ namespace RTC
|
|
|
232
232
|
}
|
|
233
233
|
|
|
234
234
|
/**
|
|
235
|
-
* Indicates if this
|
|
235
|
+
* Indicates if this chunk should be retransmitted.
|
|
236
236
|
*/
|
|
237
237
|
bool ShouldBeRetransmitted() const
|
|
238
238
|
{
|
|
@@ -240,7 +240,7 @@ namespace RTC
|
|
|
240
240
|
}
|
|
241
241
|
|
|
242
242
|
/**
|
|
243
|
-
* Indicates if this
|
|
243
|
+
* Indicates if this chunk has ever been retransmitted.
|
|
244
244
|
*/
|
|
245
245
|
bool HasBeenRetransmitted() const
|
|
246
246
|
{
|
|
@@ -248,7 +248,7 @@ namespace RTC
|
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
/**
|
|
251
|
-
* Given the current time, and the current state of this DATA
|
|
251
|
+
* Given the current time, and the current state of this DATA chunk, it
|
|
252
252
|
* will indicate if it has expired (SCTP Partial Reliability Extension).
|
|
253
253
|
*/
|
|
254
254
|
bool HasExpired(uint64_t nowMs) const
|
|
@@ -277,16 +277,16 @@ namespace RTC
|
|
|
277
277
|
// An optional lifecycle id, which may only be set for the last
|
|
278
278
|
// fragment.
|
|
279
279
|
const std::optional<uint64_t> lifecycleId;
|
|
280
|
-
// Indicates the life cycle status of this
|
|
280
|
+
// Indicates the life cycle status of this chunk.
|
|
281
281
|
Lifecycle lifecycle{ Lifecycle::ACTIVE };
|
|
282
|
-
// Indicates the presence of this
|
|
282
|
+
// Indicates the presence of this chunk, if it's in flight (UNACKED),
|
|
283
283
|
// has been received (ACKED) or is possibly lost (NACKED).
|
|
284
284
|
AckState ackState{ AckState::UNACKED };
|
|
285
|
-
// The number of times the DATA
|
|
285
|
+
// The number of times the DATA chunk has been nacked (by having
|
|
286
286
|
// received a SACK which doesn't include it). Will be cleared on
|
|
287
287
|
// retransmissions.
|
|
288
288
|
uint8_t nackCount{ 0 };
|
|
289
|
-
// The number of times the DATA
|
|
289
|
+
// The number of times the DATA chunk has been retransmitted.
|
|
290
290
|
uint16_t numRetransmissions{ 0 };
|
|
291
291
|
};
|
|
292
292
|
|
|
@@ -303,15 +303,15 @@ namespace RTC
|
|
|
303
303
|
bool isInFastRecovery);
|
|
304
304
|
|
|
305
305
|
/**
|
|
306
|
-
* Returns as many of the
|
|
306
|
+
* Returns as many of the chunks that are eligible for fast retransmissions
|
|
307
307
|
* and that would fit in a single packet of `maxLength`. The eligible
|
|
308
|
-
*
|
|
308
|
+
* chunks that didn't fit will be marked for (normal) retransmission and
|
|
309
309
|
* will not be returned if this method is called again.
|
|
310
310
|
*/
|
|
311
311
|
std::vector<std::pair<uint32_t /*tsn*/, UserData>> GetChunksToBeFastRetransmitted(size_t maxLength);
|
|
312
312
|
|
|
313
313
|
/**
|
|
314
|
-
* Given `maxLength` of space left in a packet, which
|
|
314
|
+
* Given `maxLength` of space left in a packet, which chunks can be added
|
|
315
315
|
* to it?
|
|
316
316
|
*/
|
|
317
317
|
std::vector<std::pair<uint32_t /*tsn*/, UserData>> GetChunksToBeRetransmitted(size_t maxLength);
|
|
@@ -333,7 +333,7 @@ namespace RTC
|
|
|
333
333
|
}
|
|
334
334
|
|
|
335
335
|
/**
|
|
336
|
-
* Returns the number of DATA
|
|
336
|
+
* Returns the number of DATA chunks that are in-flight (not acked or
|
|
337
337
|
* nacked).
|
|
338
338
|
*/
|
|
339
339
|
size_t GetUnackedItems() const
|
|
@@ -343,7 +343,7 @@ namespace RTC
|
|
|
343
343
|
|
|
344
344
|
/**
|
|
345
345
|
* Given the current time `nowMs`, expire and abandon outstanding (sent
|
|
346
|
-
* at least once)
|
|
346
|
+
* at least once) chunks that have a limited lifetime.
|
|
347
347
|
*/
|
|
348
348
|
void ExpireOutstandingChunks(uint64_t nowMs);
|
|
349
349
|
|
|
@@ -393,25 +393,25 @@ namespace RTC
|
|
|
393
393
|
void NackAll();
|
|
394
394
|
|
|
395
395
|
/**
|
|
396
|
-
* Adds a FORWARD-TSN
|
|
396
|
+
* Adds a FORWARD-TSN chunk to the given packet and returns it.
|
|
397
397
|
*/
|
|
398
398
|
const ForwardTsnChunk* AddForwardTsn(Packet* packet) const;
|
|
399
399
|
|
|
400
400
|
/**
|
|
401
|
-
* Adds an I-FORWARD-TSN
|
|
401
|
+
* Adds an I-FORWARD-TSN chunk to the given packet and returns it.
|
|
402
402
|
*/
|
|
403
403
|
const IForwardTsnChunk* AddIForwardTsn(Packet* packet) const;
|
|
404
404
|
|
|
405
405
|
/**
|
|
406
406
|
* Given the current time and a TSN, it returns the measured RTT between
|
|
407
|
-
* when the
|
|
408
|
-
* algorithm, so if the
|
|
407
|
+
* when the chunk was sent and now. It takes into acccount Karn's
|
|
408
|
+
* algorithm, so if the chunk has ever been retransmitted, it will return
|
|
409
409
|
* `std::nullopt`.
|
|
410
410
|
*/
|
|
411
411
|
std::optional<uint64_t> MeasureRtt(uint64_t nowMs, Types::UnwrappedTsn tsn) const;
|
|
412
412
|
|
|
413
413
|
/**
|
|
414
|
-
* Returns true if the next
|
|
414
|
+
* Returns true if the next chunk that is not acked by the peer has been
|
|
415
415
|
* abandoned, which means that a FORWARD-TSN should be sent.
|
|
416
416
|
*/
|
|
417
417
|
bool ShouldSendForwardTsn() const;
|
|
@@ -424,7 +424,7 @@ namespace RTC
|
|
|
424
424
|
|
|
425
425
|
#ifdef MS_TEST
|
|
426
426
|
/**
|
|
427
|
-
* Returns the internal state of all queued
|
|
427
|
+
* Returns the internal state of all queued chunks.
|
|
428
428
|
*
|
|
429
429
|
* @remarks
|
|
430
430
|
* - Used in tests.
|
|
@@ -434,7 +434,7 @@ namespace RTC
|
|
|
434
434
|
|
|
435
435
|
private:
|
|
436
436
|
/**
|
|
437
|
-
* Returns how large a
|
|
437
|
+
* Returns how large a chunk will be, serialized, carrying the data.
|
|
438
438
|
*/
|
|
439
439
|
size_t GetSerializedChunkLength(const UserData& data) const;
|
|
440
440
|
|
|
@@ -450,7 +450,7 @@ namespace RTC
|
|
|
450
450
|
void RemoveAcked(Types::UnwrappedTsn cumulativeTsnAck, AckInfo& ackInfo);
|
|
451
451
|
|
|
452
452
|
/**
|
|
453
|
-
* Will mark the
|
|
453
|
+
* Will mark the chunks covered by the `gapAckBlocks` from an incoming
|
|
454
454
|
* SACK as "acked" and update `ackInfo` by adding new TSNs to
|
|
455
455
|
* `this->cumulativeTsnAck`.
|
|
456
456
|
*/
|
|
@@ -460,7 +460,7 @@ namespace RTC
|
|
|
460
460
|
AckInfo& ackInfo);
|
|
461
461
|
|
|
462
462
|
/**
|
|
463
|
-
* Mark
|
|
463
|
+
* Mark chunks reported as "missing", as "nacked" or "to be retransmitted"
|
|
464
464
|
* depending how many times this has happened. Only packets up until
|
|
465
465
|
* `ackInfo.highestTsnAcked` (highest TSN newly acknowledged) are
|
|
466
466
|
* nacked/retransmitted. The method will set `ackInfo.hasPacketLoss`.
|
|
@@ -473,7 +473,7 @@ namespace RTC
|
|
|
473
473
|
AckInfo& ackInfo);
|
|
474
474
|
|
|
475
475
|
/**
|
|
476
|
-
* Process the acknowledgement of the
|
|
476
|
+
* Process the acknowledgement of the chunk referenced by `item` and
|
|
477
477
|
* updates state in `ackInfo` and the object's state.
|
|
478
478
|
*/
|
|
479
479
|
void AckChunk(AckInfo& ackInfo, Types::UnwrappedTsn tsn, Item& item);
|
|
@@ -498,7 +498,7 @@ namespace RTC
|
|
|
498
498
|
/**
|
|
499
499
|
* Given that a message fragment, `item` has been abandoned, abandon all
|
|
500
500
|
* other fragments that share the same message - both never-before-sent
|
|
501
|
-
* fragments that are still in the SendQueue and outstanding
|
|
501
|
+
* fragments that are still in the SendQueue and outstanding chunks.
|
|
502
502
|
*/
|
|
503
503
|
void AbandonAllFor(const OutstandingData::Item& item);
|
|
504
504
|
|
|
@@ -508,7 +508,7 @@ namespace RTC
|
|
|
508
508
|
void AssertIsConsistent() const;
|
|
509
509
|
|
|
510
510
|
private:
|
|
511
|
-
// The size of the data
|
|
511
|
+
// The size of the data chunk (DATA/I-DATA) header that is used.
|
|
512
512
|
const size_t dataChunkHeaderLength;
|
|
513
513
|
// The last cumulative TSN ack number.
|
|
514
514
|
Types::UnwrappedTsn lastCumulativeTsnAck;
|
|
@@ -524,12 +524,12 @@ namespace RTC
|
|
|
524
524
|
// The number of bytes that are in-flight, as sent on the wire (as
|
|
525
525
|
// packets).
|
|
526
526
|
size_t unackedPacketBytes{ 0 };
|
|
527
|
-
// The number of DATA
|
|
527
|
+
// The number of DATA chunks that are in-flight (sent but not yet acked
|
|
528
528
|
// or nacked).
|
|
529
529
|
size_t unackedItems{ 0 };
|
|
530
|
-
// Data
|
|
530
|
+
// Data chunks that are eligible for fast retransmission.
|
|
531
531
|
std::set<Types::UnwrappedTsn> toBeFastRetransmitted;
|
|
532
|
-
// Data
|
|
532
|
+
// Data chunks that are to be retransmitted.
|
|
533
533
|
std::set<Types::UnwrappedTsn> toBeRetransmitted;
|
|
534
534
|
// Wben a stream reset has begun, the "next TSN to assign" is added to
|
|
535
535
|
// this set, and removed when the cum-ack TSN reaches it. This is used
|
|
@@ -11,7 +11,7 @@ namespace RTC
|
|
|
11
11
|
{
|
|
12
12
|
/**
|
|
13
13
|
* The RetransmissionErrorCounter is a simple counter with a limit, and when
|
|
14
|
-
* the limit is exceeded, the counter is exhausted and the
|
|
14
|
+
* the limit is exceeded, the counter is exhausted and the association will
|
|
15
15
|
* be closed. It's incremented on retransmission errors, such as the T3-RTX
|
|
16
16
|
* timer expiring, but also missing heartbeats and stream reset requests.
|
|
17
17
|
*/
|
|
@@ -90,23 +90,23 @@ namespace RTC
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
/**
|
|
93
|
-
* Returns a list of
|
|
93
|
+
* Returns a list of chunks to "fast retransmit" that would fit in
|
|
94
94
|
* `maxLength` (bytes). The current value of `cwnd` is ignored.
|
|
95
95
|
*/
|
|
96
96
|
std::vector<std::pair<uint32_t /*tsn*/, UserData>> GetChunksForFastRetransmit(size_t maxLength);
|
|
97
97
|
|
|
98
98
|
/**
|
|
99
|
-
* Returns a list of
|
|
99
|
+
* Returns a list of chunks to send that would fit in `maxLength`
|
|
100
100
|
* (bytes). This may be further limited by the congestion control windows.
|
|
101
101
|
* Note that `ShouldSendForwardTsn()` must be called prior to this method,
|
|
102
|
-
* to abandon expired
|
|
102
|
+
* to abandon expired chunks, as this method will not expire any chunks.
|
|
103
103
|
*/
|
|
104
104
|
std::vector<std::pair<uint32_t /*tsn*/, UserData>> GetChunksToSend(
|
|
105
105
|
uint64_t nowMs, size_t maxLength);
|
|
106
106
|
|
|
107
107
|
#ifdef MS_TEST
|
|
108
108
|
/**
|
|
109
|
-
* Returns the internal state of all queued
|
|
109
|
+
* Returns the internal state of all queued chunks.
|
|
110
110
|
*
|
|
111
111
|
* @remarks
|
|
112
112
|
* - Used in tests.
|
|
@@ -118,7 +118,7 @@ namespace RTC
|
|
|
118
118
|
#endif
|
|
119
119
|
|
|
120
120
|
/**
|
|
121
|
-
* Returns the next TSN that will be allocated for sent DATA
|
|
121
|
+
* Returns the next TSN that will be allocated for sent DATA chunks.
|
|
122
122
|
*/
|
|
123
123
|
uint32_t GetNextTsn() const
|
|
124
124
|
{
|
|
@@ -182,14 +182,14 @@ namespace RTC
|
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
/**
|
|
185
|
-
* Given the current time `nowMs`, it will evaluate if there are
|
|
185
|
+
* Given the current time `nowMs`, it will evaluate if there are chunks
|
|
186
186
|
* that have expired and that need to be discarded. It returns true if a
|
|
187
187
|
* FORWARD-TSN should be sent.
|
|
188
188
|
*/
|
|
189
189
|
bool ShouldSendForwardTsn(uint64_t nowMs);
|
|
190
190
|
|
|
191
191
|
/**
|
|
192
|
-
* Adds a FORWARD-TSN
|
|
192
|
+
* Adds a FORWARD-TSN chunk to the given packet and returns it.
|
|
193
193
|
*/
|
|
194
194
|
const ForwardTsnChunk* AddForwardTsn(Packet* packet) const
|
|
195
195
|
{
|
|
@@ -197,7 +197,7 @@ namespace RTC
|
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
/**
|
|
200
|
-
* Adds an I-FORWARD-TSN
|
|
200
|
+
* Adds an I-FORWARD-TSN chunk to the given packet and returns it.
|
|
201
201
|
*/
|
|
202
202
|
const IForwardTsnChunk* AddIForwardTsn(Packet* packet) const
|
|
203
203
|
{
|
|
@@ -229,7 +229,7 @@ namespace RTC
|
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
/**
|
|
232
|
-
* Indicates if the provided SACK
|
|
232
|
+
* Indicates if the provided SACK chunk is valid given what has previously
|
|
233
233
|
* been received. If it returns false, the SACK is most likely a duplicate
|
|
234
234
|
* of something already seen, so this returning false doesn't necessarily
|
|
235
235
|
* mean that the SACK is illegal.
|
|
@@ -237,7 +237,7 @@ namespace RTC
|
|
|
237
237
|
bool IsSackChunkValid(const SackChunk* sackChunk) const;
|
|
238
238
|
|
|
239
239
|
/**
|
|
240
|
-
* When a SACK
|
|
240
|
+
* When a SACK chunk is received, this method will be called which may
|
|
241
241
|
* call into the `RetransmissionTimeout` to update the RTO.
|
|
242
242
|
*/
|
|
243
243
|
void UpdateRttMs(uint64_t nowMs, Types::UnwrappedTsn cumulativeTsnAck);
|
|
@@ -249,7 +249,7 @@ namespace RTC
|
|
|
249
249
|
void MayExitFastRecovery(Types::UnwrappedTsn cumulativeTsnAck);
|
|
250
250
|
|
|
251
251
|
/**
|
|
252
|
-
* If
|
|
252
|
+
* If chunks have been ACKed, stop the retransmission timer.
|
|
253
253
|
*
|
|
254
254
|
* @remarks
|
|
255
255
|
* - This method is NOT defined in dcsctp! See bug report:
|
|
@@ -259,13 +259,13 @@ namespace RTC
|
|
|
259
259
|
|
|
260
260
|
/**
|
|
261
261
|
* Update the congestion control algorithm given as the cumulative ack TSN
|
|
262
|
-
* value has increased, as reported in an incoming SACK
|
|
262
|
+
* value has increased, as reported in an incoming SACK chunk.
|
|
263
263
|
*/
|
|
264
264
|
void HandleIncreasedCumulativeTsnAck(size_t unackedPacketBytes, size_t totalBytesAcked);
|
|
265
265
|
|
|
266
266
|
/**
|
|
267
267
|
* Update the congestion control algorithm, given as packet loss has been
|
|
268
|
-
* detected, as reported in an incoming SACK
|
|
268
|
+
* detected, as reported in an incoming SACK chunk.
|
|
269
269
|
*/
|
|
270
270
|
void HandlePacketLoss(Types::UnwrappedTsn highestTsnAcked);
|
|
271
271
|
|
|
@@ -318,7 +318,7 @@ namespace RTC
|
|
|
318
318
|
std::optional<Types::UnwrappedTsn> fastRecoveryExitTsn{ std::nullopt };
|
|
319
319
|
// The send queue.
|
|
320
320
|
SendQueueInterface& sendQueue;
|
|
321
|
-
// All the outstanding data
|
|
321
|
+
// All the outstanding data chunks that are in-flight and that have not
|
|
322
322
|
// been cumulative acked. Note that it also contains chunks that have been
|
|
323
323
|
// acked in gap-ack-blocks.
|
|
324
324
|
OutstandingData outstandingData;
|
|
@@ -243,7 +243,7 @@ namespace RTC
|
|
|
243
243
|
// been fragmented.
|
|
244
244
|
size_t remainingOffset{ 0 };
|
|
245
245
|
size_t remainingLength;
|
|
246
|
-
// If set, an allocated
|
|
246
|
+
// If set, an allocated message ID and SSN. Will be allocated when the
|
|
247
247
|
// first fragment is sent.
|
|
248
248
|
std::optional<uint32_t> mid{ std::nullopt };
|
|
249
249
|
std::optional<uint16_t> ssn{ std::nullopt };
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#include "common.hpp"
|
|
5
5
|
#include "RTC/DataProducer.hpp"
|
|
6
|
-
#include <
|
|
6
|
+
#include <ankerl/unordered_dense.h>
|
|
7
7
|
|
|
8
8
|
namespace RTC
|
|
9
9
|
{
|
|
@@ -18,7 +18,7 @@ namespace RTC
|
|
|
18
18
|
|
|
19
19
|
public:
|
|
20
20
|
// Table of streamId / DataProducer pairs.
|
|
21
|
-
|
|
21
|
+
ankerl::unordered_dense::map<uint16_t, RTC::DataProducer*> streamIdTable;
|
|
22
22
|
};
|
|
23
23
|
} // namespace RTC
|
|
24
24
|
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
#include "RTC/Consumer.hpp"
|
|
5
5
|
#include "RTC/RTP/Codecs/PayloadDescriptorHandler.hpp"
|
|
6
6
|
#include "RTC/SeqManager.hpp"
|
|
7
|
+
#include <ankerl/unordered_dense.h>
|
|
7
8
|
#include <map>
|
|
8
9
|
|
|
9
10
|
namespace RTC
|
|
@@ -111,7 +112,7 @@ namespace RTC
|
|
|
111
112
|
// Allocated by this.
|
|
112
113
|
RTC::RTP::RtpStreamSend* rtpStream{ nullptr };
|
|
113
114
|
// Others.
|
|
114
|
-
|
|
115
|
+
ankerl::unordered_dense::map<uint32_t, int16_t> mapMappedSsrcSpatialLayer;
|
|
115
116
|
std::vector<RTC::RTP::RtpStreamSend*> rtpStreams;
|
|
116
117
|
std::vector<RTC::RTP::RtpStreamRecv*> producerRtpStreams; // Indexed by spatial layer.
|
|
117
118
|
bool syncRequired{ false };
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
#include "common.hpp"
|
|
5
5
|
#include "handles/TcpConnectionHandle.hpp"
|
|
6
6
|
#include "handles/TcpServerHandle.hpp"
|
|
7
|
+
#include "RTC/PortManager.hpp"
|
|
7
8
|
#include "RTC/TcpConnection.hpp"
|
|
8
9
|
#include "RTC/Transport.hpp"
|
|
9
10
|
#include <string>
|
|
@@ -37,7 +38,7 @@ namespace RTC
|
|
|
37
38
|
uint16_t minPort,
|
|
38
39
|
uint16_t maxPort,
|
|
39
40
|
RTC::Transport::SocketFlags& flags,
|
|
40
|
-
|
|
41
|
+
RTC::PortManager::PortRangeKey& portRangeKey);
|
|
41
42
|
~TcpServer() override;
|
|
42
43
|
|
|
43
44
|
/* Pure virtual methods inherited from ::TcpServerHandle. */
|
|
@@ -50,7 +51,7 @@ namespace RTC
|
|
|
50
51
|
Listener* listener{ nullptr };
|
|
51
52
|
RTC::TcpConnection::Listener* connListener{ nullptr };
|
|
52
53
|
bool fixedPort{ false };
|
|
53
|
-
|
|
54
|
+
RTC::PortManager::PortRangeKey portRangeKey{};
|
|
54
55
|
};
|
|
55
56
|
} // namespace RTC
|
|
56
57
|
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
#include "handles/TimerHandleInterface.hpp"
|
|
31
31
|
#include "RTC/TransportCongestionControlClient.hpp"
|
|
32
32
|
#include "RTC/TransportCongestionControlServer.hpp"
|
|
33
|
-
#include <
|
|
33
|
+
#include <ankerl/unordered_dense.h>
|
|
34
34
|
#include <string>
|
|
35
35
|
#include <vector>
|
|
36
36
|
|
|
@@ -338,13 +338,13 @@ namespace RTC
|
|
|
338
338
|
// Passed by argument.
|
|
339
339
|
Listener* listener{ nullptr };
|
|
340
340
|
// Allocated by this.
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
341
|
+
ankerl::unordered_dense::map<std::string, RTC::Producer*> mapProducers;
|
|
342
|
+
ankerl::unordered_dense::map<std::string, RTC::Consumer*> mapConsumers;
|
|
343
|
+
ankerl::unordered_dense::map<std::string, RTC::DataProducer*> mapDataProducers;
|
|
344
|
+
ankerl::unordered_dense::map<std::string, RTC::DataConsumer*> mapDataConsumers;
|
|
345
|
+
ankerl::unordered_dense::map<uint16_t, RTC::DataConsumer*> mapSctpStreamIdDataConsumers;
|
|
346
|
+
ankerl::unordered_dense::map<uint32_t, RTC::Consumer*> mapSsrcConsumer;
|
|
347
|
+
ankerl::unordered_dense::map<uint32_t, RTC::Consumer*> mapRtxSsrcConsumer;
|
|
348
348
|
TimerHandleInterface* rtcpTimer{ nullptr };
|
|
349
349
|
// Allocated by this.
|
|
350
350
|
std::unique_ptr<RTC::SCTP::AssociationInterface> sctpAssociation{ nullptr };
|