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
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
#include "common.hpp"
|
|
5
5
|
#include "RTC/Serializable.hpp"
|
|
6
6
|
#include "Utils.hpp"
|
|
7
|
+
#include <ankerl/unordered_dense.h>
|
|
7
8
|
#include <string_view>
|
|
8
|
-
#include <unordered_map>
|
|
9
9
|
|
|
10
10
|
namespace RTC
|
|
11
11
|
{
|
|
@@ -58,10 +58,10 @@ namespace RTC
|
|
|
58
58
|
/**
|
|
59
59
|
* STUN Attributes.
|
|
60
60
|
*
|
|
61
|
-
* After the STUN
|
|
62
|
-
*
|
|
63
|
-
* value. Each STUN
|
|
64
|
-
* in an
|
|
61
|
+
* After the STUN message header are zero or more attributes. Each
|
|
62
|
+
* attribute MUST be TLV encoded, with a 16-bit type, 16-bit length, and
|
|
63
|
+
* value. Each STUN attribute MUST end on a 32-bit boundary. All fields
|
|
64
|
+
* in an attribute are transmitted most significant bit first.
|
|
65
65
|
*
|
|
66
66
|
* 0 1 2 3
|
|
67
67
|
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
|
@@ -145,7 +145,7 @@ namespace RTC
|
|
|
145
145
|
*/
|
|
146
146
|
uint16_t len;
|
|
147
147
|
/**
|
|
148
|
-
* Offset of the
|
|
148
|
+
* Offset of the attribute from the start of the attributes.
|
|
149
149
|
*/
|
|
150
150
|
size_t offset;
|
|
151
151
|
};
|
|
@@ -161,23 +161,23 @@ namespace RTC
|
|
|
161
161
|
static const size_t FingerprintAttributeLength{ 4 };
|
|
162
162
|
|
|
163
163
|
/**
|
|
164
|
-
* Whether given buffer could be a valid STUN
|
|
164
|
+
* Whether given buffer could be a valid STUN packet.
|
|
165
165
|
*/
|
|
166
166
|
static bool IsStun(const uint8_t* buffer, size_t bufferLength);
|
|
167
167
|
|
|
168
168
|
/**
|
|
169
|
-
* Parse a STUN
|
|
169
|
+
* Parse a STUN packet.
|
|
170
170
|
*
|
|
171
171
|
* @remarks
|
|
172
|
-
* - `bufferLength` must be the exact length of the STUN
|
|
172
|
+
* - `bufferLength` must be the exact length of the STUN packet.
|
|
173
173
|
*/
|
|
174
174
|
static StunPacket* Parse(const uint8_t* buffer, size_t bufferLength);
|
|
175
175
|
|
|
176
176
|
/**
|
|
177
|
-
* Create a STUN
|
|
177
|
+
* Create a STUN packet.
|
|
178
178
|
*
|
|
179
179
|
* @remarks
|
|
180
|
-
* - `bufferLength` must be the exact length of the STUN
|
|
180
|
+
* - `bufferLength` must be the exact length of the STUN packet.
|
|
181
181
|
* - If `transactionId` is not given then a random Transaction ID is
|
|
182
182
|
* generated.
|
|
183
183
|
*/
|
|
@@ -196,7 +196,7 @@ namespace RTC
|
|
|
196
196
|
|
|
197
197
|
private:
|
|
198
198
|
/**
|
|
199
|
-
* Constructor is private because we only want to create STUN
|
|
199
|
+
* Constructor is private because we only want to create STUN packet
|
|
200
200
|
* instances via Parse() and Factory().
|
|
201
201
|
*/
|
|
202
202
|
StunPacket(uint8_t* buffer, size_t bufferLength);
|
|
@@ -366,8 +366,8 @@ namespace RTC
|
|
|
366
366
|
StunPacket::AuthenticationResult CheckAuthentication(std::string_view password) const;
|
|
367
367
|
|
|
368
368
|
/**
|
|
369
|
-
* Whether the STUN
|
|
370
|
-
* MESSAGE-INTEGRITY and/or FINGERPRINT
|
|
369
|
+
* Whether the STUN packet is protected, meaning that it has
|
|
370
|
+
* MESSAGE-INTEGRITY and/or FINGERPRINT attributes.
|
|
371
371
|
*/
|
|
372
372
|
bool IsProtected() const
|
|
373
373
|
{
|
|
@@ -377,17 +377,17 @@ namespace RTC
|
|
|
377
377
|
}
|
|
378
378
|
|
|
379
379
|
/**
|
|
380
|
-
* Adds MESSAGE-INTEGRITY and FINGERPRINT to the STUN
|
|
380
|
+
* Adds MESSAGE-INTEGRITY and FINGERPRINT to the STUN packet.
|
|
381
381
|
*
|
|
382
382
|
* @remarks
|
|
383
383
|
* - MESSAGE-INTEGRITY is only added if given `password` is not empty.
|
|
384
|
-
* - The application MUST NOT add more
|
|
385
|
-
* and MUST NOT modify any field of the STUN
|
|
384
|
+
* - The application MUST NOT add more attributes into the STUN packet
|
|
385
|
+
* and MUST NOT modify any field of the STUN packet after calling
|
|
386
386
|
* this method.
|
|
387
387
|
*
|
|
388
388
|
* @throw MediaSoupTypeError - If there is no enough space in the buffer.
|
|
389
|
-
* @throw MediaSoupError - If the STUN
|
|
390
|
-
* or FINGERPRINT
|
|
389
|
+
* @throw MediaSoupError - If the STUN packet already has MESSAGE-INTEGRITY
|
|
390
|
+
* or FINGERPRINT attributes.
|
|
391
391
|
*/
|
|
392
392
|
void Protect(const std::string_view password);
|
|
393
393
|
|
|
@@ -396,15 +396,15 @@ namespace RTC
|
|
|
396
396
|
/**
|
|
397
397
|
* Creates a STUN success response for the current STUN request.
|
|
398
398
|
*
|
|
399
|
-
* @throw MediaSoupError - If the STUN
|
|
399
|
+
* @throw MediaSoupError - If the STUN packet is not a STUN request.
|
|
400
400
|
*/
|
|
401
401
|
StunPacket* CreateSuccessResponse(uint8_t* buffer, size_t bufferLength) const;
|
|
402
402
|
|
|
403
403
|
/**
|
|
404
404
|
* Creates a STUN error response for the current STUN request. It uses
|
|
405
|
-
* given `errorCode` and `reasonPhrase` to add a ERROR-CODE
|
|
405
|
+
* given `errorCode` and `reasonPhrase` to add a ERROR-CODE attribute.
|
|
406
406
|
*
|
|
407
|
-
* @throw MediaSoupError - If the STUN
|
|
407
|
+
* @throw MediaSoupError - If the STUN packet is not a STUN request.
|
|
408
408
|
*/
|
|
409
409
|
StunPacket* CreateErrorResponse(
|
|
410
410
|
uint8_t* buffer,
|
|
@@ -444,8 +444,8 @@ namespace RTC
|
|
|
444
444
|
}
|
|
445
445
|
|
|
446
446
|
/**
|
|
447
|
-
* Validates whether the STUN
|
|
448
|
-
* offsets pointing to relevant STUN
|
|
447
|
+
* Validates whether the STUN packet is valid. It also stores internal
|
|
448
|
+
* offsets pointing to relevant STUN attributes if `storeAttributes` is
|
|
449
449
|
* `true`.
|
|
450
450
|
*/
|
|
451
451
|
#ifdef MS_TEST
|
|
@@ -457,26 +457,26 @@ namespace RTC
|
|
|
457
457
|
#endif
|
|
458
458
|
|
|
459
459
|
/**
|
|
460
|
-
* Parses
|
|
461
|
-
* internal containers holding
|
|
460
|
+
* Parses attributes. Returns `true` if they are valid. It also stores
|
|
461
|
+
* internal containers holding attributes if `storeAttributes` is `true`.
|
|
462
462
|
*/
|
|
463
463
|
bool ParseAttributes(bool storeAttributes);
|
|
464
464
|
|
|
465
465
|
/**
|
|
466
|
-
* Stores the parsed
|
|
466
|
+
* Stores the parsed attribute data into the map of attributes.
|
|
467
467
|
*
|
|
468
|
-
* @return `true` if the
|
|
469
|
-
* be stored because there was already an
|
|
468
|
+
* @return `true` if the attribute was stored and `false` if it couldn't
|
|
469
|
+
* be stored because there was already an attribute with same type in
|
|
470
470
|
* the map.
|
|
471
471
|
*/
|
|
472
472
|
bool StoreParsedAttribute(StunPacket::AttributeType type, uint16_t len, size_t offset);
|
|
473
473
|
|
|
474
474
|
/**
|
|
475
|
-
* Stores a new
|
|
475
|
+
* Stores a new attribute data into the map of attributes.
|
|
476
476
|
*
|
|
477
477
|
* @throw MediaSoupError - If there is not enough space in the buffer for
|
|
478
|
-
* the new
|
|
479
|
-
* there was already an
|
|
478
|
+
* the new attribute or if the attribute couldn't be stored because
|
|
479
|
+
* there was already an attribute with same type in the map.
|
|
480
480
|
*/
|
|
481
481
|
void StoreNewAttribute(StunPacket::AttributeType type, const void* data, uint16_t len);
|
|
482
482
|
|
|
@@ -532,8 +532,8 @@ namespace RTC
|
|
|
532
532
|
private:
|
|
533
533
|
StunPacket::Class klass{ StunPacket::Class::UNSET };
|
|
534
534
|
StunPacket::Method method{ StunPacket::Method::UNSET };
|
|
535
|
-
// Map of STUN
|
|
536
|
-
|
|
535
|
+
// Map of STUN attributes indexed by attribute type.
|
|
536
|
+
ankerl::unordered_dense::map<StunPacket::AttributeType, StunPacket::Attribute> attributes;
|
|
537
537
|
};
|
|
538
538
|
} // namespace ICE
|
|
539
539
|
} // namespace RTC
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#include "handles/TimerHandleInterface.hpp"
|
|
5
5
|
#include "SharedInterface.hpp"
|
|
6
|
-
#include <
|
|
6
|
+
#include <ankerl/unordered_dense.h>
|
|
7
7
|
|
|
8
8
|
namespace RTC
|
|
9
9
|
{
|
|
@@ -125,8 +125,8 @@ namespace RTC
|
|
|
125
125
|
Listener* listener{ nullptr };
|
|
126
126
|
SharedInterface* shared{ nullptr };
|
|
127
127
|
uint32_t keyFrameRequestDelay{ 0u }; // 0 means disabled.
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
ankerl::unordered_dense::map<uint32_t, PendingKeyFrameInfo*> mapSsrcPendingKeyFrameInfo;
|
|
129
|
+
ankerl::unordered_dense::map<uint32_t, KeyFrameRequestDelayer*> mapSsrcKeyFrameRequestDelayer;
|
|
130
130
|
};
|
|
131
131
|
} // namespace RTC
|
|
132
132
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#include "common.hpp"
|
|
5
5
|
#include "FBS/rtpParameters.h"
|
|
6
|
-
#include <
|
|
6
|
+
#include <ankerl/unordered_dense.h>
|
|
7
7
|
#include <string>
|
|
8
8
|
#include <vector>
|
|
9
9
|
|
|
@@ -78,7 +78,7 @@ namespace RTC
|
|
|
78
78
|
const std::vector<int32_t>& GetArrayOfIntegers(const std::string& key) const;
|
|
79
79
|
|
|
80
80
|
private:
|
|
81
|
-
|
|
81
|
+
ankerl::unordered_dense::map<std::string, Value> mapKeyValues;
|
|
82
82
|
};
|
|
83
83
|
} // namespace RTC
|
|
84
84
|
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#include "RTC/Consumer.hpp"
|
|
5
5
|
#include "RTC/SeqManager.hpp"
|
|
6
|
+
#include <ankerl/unordered_dense.h>
|
|
6
7
|
#include <map>
|
|
7
8
|
|
|
8
9
|
namespace RTC
|
|
@@ -77,14 +78,14 @@ namespace RTC
|
|
|
77
78
|
// Allocated by this.
|
|
78
79
|
std::vector<RTC::RTP::RtpStreamSend*> rtpStreams;
|
|
79
80
|
// Others.
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
ankerl::unordered_dense::map<uint32_t, uint32_t> mapMappedSsrcSsrc;
|
|
82
|
+
ankerl::unordered_dense::map<uint32_t, RTC::RTP::RtpStreamSend*> mapSsrcRtpStream;
|
|
82
83
|
bool keyFrameSupported{ false };
|
|
83
|
-
|
|
84
|
-
|
|
84
|
+
ankerl::unordered_dense::map<RTC::RTP::RtpStreamSend*, bool> mapRtpStreamSyncRequired;
|
|
85
|
+
ankerl::unordered_dense::map<RTC::RTP::RtpStreamSend*, RTC::SeqManager<uint16_t>> mapRtpStreamRtpSeqManager;
|
|
85
86
|
// Buffers to store packets that arrive earlier than the first packet of the
|
|
86
87
|
// video key frame.
|
|
87
|
-
|
|
88
|
+
ankerl::unordered_dense::map<
|
|
88
89
|
RTC::RTP::RtpStreamSend*,
|
|
89
90
|
std::map<uint16_t, RTC::RTP::SharedPacket, RTC::SeqManager<uint16_t>::SeqLowerThan>>
|
|
90
91
|
mapRtpStreamTargetLayerRetransmissionBuffer;
|
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
|
|
4
4
|
#include "common.hpp"
|
|
5
5
|
#include "RTC/Transport.hpp"
|
|
6
|
+
#include "Utils.hpp"
|
|
6
7
|
#include <uv.h>
|
|
7
|
-
#include <
|
|
8
|
+
#include <ankerl/unordered_dense.h>
|
|
9
|
+
#include <ostream>
|
|
8
10
|
#include <string>
|
|
9
11
|
#include <vector>
|
|
10
12
|
|
|
@@ -12,13 +14,75 @@ namespace RTC
|
|
|
12
14
|
{
|
|
13
15
|
class PortManager
|
|
14
16
|
{
|
|
15
|
-
|
|
17
|
+
public:
|
|
16
18
|
enum class Protocol : uint8_t
|
|
17
19
|
{
|
|
18
20
|
UDP = 1,
|
|
19
21
|
TCP
|
|
20
22
|
};
|
|
21
23
|
|
|
24
|
+
/**
|
|
25
|
+
* Opaque-ish key identifying one (protocol, bind address, port range)
|
|
26
|
+
* tuple. Issued by Bind*() and consumed by Unbind(). Callers store it as
|
|
27
|
+
* an opaque token; equality and hashing are exact-tuple based, so distinct
|
|
28
|
+
* tuples never collide regardless of how close their numeric
|
|
29
|
+
* representations are.
|
|
30
|
+
*/
|
|
31
|
+
class PortRangeKey
|
|
32
|
+
{
|
|
33
|
+
private:
|
|
34
|
+
friend class PortManager;
|
|
35
|
+
friend struct PortRangeKeyHash;
|
|
36
|
+
|
|
37
|
+
public:
|
|
38
|
+
PortRangeKey() = default;
|
|
39
|
+
PortRangeKey(
|
|
40
|
+
Protocol protocol, const sockaddr_storage& bindAddr, uint16_t minPort, uint16_t maxPort);
|
|
41
|
+
|
|
42
|
+
bool operator==(const PortRangeKey& other) const noexcept;
|
|
43
|
+
bool operator!=(const PortRangeKey& other) const noexcept
|
|
44
|
+
{
|
|
45
|
+
return !(*this == other);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public:
|
|
49
|
+
Protocol GetProtocol() const
|
|
50
|
+
{
|
|
51
|
+
return this->protocol;
|
|
52
|
+
}
|
|
53
|
+
const sockaddr_storage& GetSockaddrStorage() const
|
|
54
|
+
{
|
|
55
|
+
return this->bindAddr;
|
|
56
|
+
}
|
|
57
|
+
uint16_t GetMinPort() const
|
|
58
|
+
{
|
|
59
|
+
return this->minPort;
|
|
60
|
+
}
|
|
61
|
+
uint16_t GetMaxPort() const
|
|
62
|
+
{
|
|
63
|
+
return this->maxPort;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
private:
|
|
67
|
+
Protocol protocol{ Protocol::UDP };
|
|
68
|
+
sockaddr_storage bindAddr{};
|
|
69
|
+
uint16_t minPort{ 0u };
|
|
70
|
+
uint16_t maxPort{ 0u };
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
struct PortRangeKeyHash
|
|
74
|
+
{
|
|
75
|
+
/**
|
|
76
|
+
* Hash function. Uses ankerl::unordered_dense per-field hashes combined
|
|
77
|
+
* with the standard boost-style `hash_combine` seed mixer. We deliberately
|
|
78
|
+
* do NOT hash the raw `sockaddr_storage` bytes (padding is
|
|
79
|
+
* caller-controlled and would cause structurally-equal keys to hash
|
|
80
|
+
* differently); instead we hash the same fields that `operator==`
|
|
81
|
+
* inspects.
|
|
82
|
+
*/
|
|
83
|
+
size_t operator()(const PortRangeKey& key) const noexcept;
|
|
84
|
+
};
|
|
85
|
+
|
|
22
86
|
private:
|
|
23
87
|
struct PortRange
|
|
24
88
|
{
|
|
@@ -42,9 +106,9 @@ namespace RTC
|
|
|
42
106
|
uint16_t minPort,
|
|
43
107
|
uint16_t maxPort,
|
|
44
108
|
RTC::Transport::SocketFlags& flags,
|
|
45
|
-
|
|
109
|
+
PortRangeKey& key)
|
|
46
110
|
{
|
|
47
|
-
return reinterpret_cast<uv_udp_t*>(Bind(Protocol::UDP, ip, minPort, maxPort, flags,
|
|
111
|
+
return reinterpret_cast<uv_udp_t*>(Bind(Protocol::UDP, ip, minPort, maxPort, flags, key));
|
|
48
112
|
}
|
|
49
113
|
static uv_tcp_t* BindTcp(std::string& ip, uint16_t port, RTC::Transport::SocketFlags& flags)
|
|
50
114
|
{
|
|
@@ -55,11 +119,11 @@ namespace RTC
|
|
|
55
119
|
uint16_t minPort,
|
|
56
120
|
uint16_t maxPort,
|
|
57
121
|
RTC::Transport::SocketFlags& flags,
|
|
58
|
-
|
|
122
|
+
PortRangeKey& key)
|
|
59
123
|
{
|
|
60
|
-
return reinterpret_cast<uv_tcp_t*>(Bind(Protocol::TCP, ip, minPort, maxPort, flags,
|
|
124
|
+
return reinterpret_cast<uv_tcp_t*>(Bind(Protocol::TCP, ip, minPort, maxPort, flags, key));
|
|
61
125
|
}
|
|
62
|
-
static void Unbind(
|
|
126
|
+
static void Unbind(const PortRangeKey& key, uint16_t port);
|
|
63
127
|
void Dump(int indentation = 0) const;
|
|
64
128
|
|
|
65
129
|
private:
|
|
@@ -71,15 +135,31 @@ namespace RTC
|
|
|
71
135
|
uint16_t minPort,
|
|
72
136
|
uint16_t maxPort,
|
|
73
137
|
RTC::Transport::SocketFlags& flags,
|
|
74
|
-
|
|
75
|
-
static
|
|
76
|
-
Protocol protocol, sockaddr_storage* bindAddr, uint16_t minPort, uint16_t maxPort);
|
|
77
|
-
static PortRange& GetOrCreatePortRange(uint64_t hash, uint16_t minPort, uint16_t maxPort);
|
|
138
|
+
PortRangeKey& key);
|
|
139
|
+
static PortRange& GetOrCreatePortRange(const PortRangeKey& key, uint16_t minPort, uint16_t maxPort);
|
|
78
140
|
static uint8_t ConvertSocketFlags(RTC::Transport::SocketFlags& flags, Protocol protocol, int family);
|
|
79
141
|
|
|
80
142
|
private:
|
|
81
|
-
static thread_local
|
|
143
|
+
static thread_local ankerl::unordered_dense::map<PortRangeKey, PortRange, PortRangeKeyHash> mapPortRanges;
|
|
82
144
|
};
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* For Catch2 to print it nicely.
|
|
148
|
+
*/
|
|
149
|
+
inline std::ostream& operator<<(std::ostream& os, const PortManager::PortRangeKey& k)
|
|
150
|
+
{
|
|
151
|
+
const std::string protocolStr = (k.GetProtocol() == PortManager::Protocol::UDP) ? "udp" : "tcp";
|
|
152
|
+
|
|
153
|
+
int family;
|
|
154
|
+
uint16_t port;
|
|
155
|
+
std::string ip;
|
|
156
|
+
auto* storage = const_cast<sockaddr_storage*>(std::addressof(k.GetSockaddrStorage()));
|
|
157
|
+
|
|
158
|
+
Utils::IP::GetAddressInfo(reinterpret_cast<sockaddr*>(storage), family, ip, port);
|
|
159
|
+
|
|
160
|
+
return os << "{protocol:" << protocolStr << ", family:" << family << ", ip:" << ip
|
|
161
|
+
<< ", minPort:" << k.GetMinPort() << ", maxPort:" << k.GetMaxPort() << "}";
|
|
162
|
+
}
|
|
83
163
|
} // namespace RTC
|
|
84
164
|
|
|
85
165
|
#endif
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
#include "RTC/RTP/RtpStreamRecv.hpp"
|
|
15
15
|
#include "RTC/RtpDictionaries.hpp"
|
|
16
16
|
#include "SharedInterface.hpp"
|
|
17
|
+
#include <ankerl/unordered_dense.h>
|
|
17
18
|
#include <string>
|
|
18
19
|
#include <vector>
|
|
19
20
|
|
|
@@ -61,7 +62,7 @@ namespace RTC
|
|
|
61
62
|
private:
|
|
62
63
|
struct RtpMapping
|
|
63
64
|
{
|
|
64
|
-
|
|
65
|
+
ankerl::unordered_dense::map<uint8_t, uint8_t> codecs;
|
|
65
66
|
std::vector<RtpEncodingMapping> encodings;
|
|
66
67
|
};
|
|
67
68
|
|
|
@@ -125,7 +126,7 @@ namespace RTC
|
|
|
125
126
|
{
|
|
126
127
|
return this->paused;
|
|
127
128
|
}
|
|
128
|
-
const
|
|
129
|
+
const ankerl::unordered_dense::map<RTC::RTP::RtpStreamRecv*, uint32_t>& GetRtpStreams()
|
|
129
130
|
{
|
|
130
131
|
return this->mapRtpStreamMappedSsrc;
|
|
131
132
|
}
|
|
@@ -182,7 +183,7 @@ namespace RTC
|
|
|
182
183
|
SharedInterface* shared{ nullptr };
|
|
183
184
|
RTC::Producer::Listener* listener{ nullptr };
|
|
184
185
|
// Allocated by this.
|
|
185
|
-
|
|
186
|
+
ankerl::unordered_dense::map<uint32_t, RTC::RTP::RtpStreamRecv*> mapSsrcRtpStream;
|
|
186
187
|
RTC::KeyFrameRequestManager* keyFrameRequestManager{ nullptr };
|
|
187
188
|
// Others.
|
|
188
189
|
RTC::Media::Kind kind;
|
|
@@ -191,9 +192,9 @@ namespace RTC
|
|
|
191
192
|
struct RtpMapping rtpMapping;
|
|
192
193
|
std::vector<RTC::RTP::RtpStreamRecv*> rtpStreamByEncodingIdx;
|
|
193
194
|
std::vector<uint8_t> rtpStreamScores;
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
195
|
+
ankerl::unordered_dense::map<uint32_t, RTC::RTP::RtpStreamRecv*> mapRtxSsrcRtpStream;
|
|
196
|
+
ankerl::unordered_dense::map<RTC::RTP::RtpStreamRecv*, uint32_t> mapRtpStreamMappedSsrc;
|
|
197
|
+
ankerl::unordered_dense::map<uint32_t, uint32_t> mapMappedSsrcSsrc;
|
|
197
198
|
struct RTC::RTP::HeaderExtensionIds rtpHeaderExtensionIds;
|
|
198
199
|
bool paused{ false };
|
|
199
200
|
bool enableMediasoupPacketIdHeaderExtension{ false };
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
#include "common.hpp"
|
|
5
5
|
#include "RTC/RTCP/Packet.hpp"
|
|
6
|
-
#include <absl/container/flat_hash_map.h>
|
|
7
6
|
|
|
8
7
|
namespace RTC
|
|
9
8
|
{
|
|
@@ -32,7 +31,7 @@ namespace RTC
|
|
|
32
31
|
static const std::string& MessageTypeToString(typename T::MessageType type);
|
|
33
32
|
|
|
34
33
|
private:
|
|
35
|
-
static const
|
|
34
|
+
static const ankerl::unordered_dense::map<typename T::MessageType, std::string> MessageType2String;
|
|
36
35
|
|
|
37
36
|
public:
|
|
38
37
|
typename T::MessageType GetMessageType() const
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
#include "RTC/RTCP/Feedback.hpp"
|
|
6
6
|
#include <vector>
|
|
7
7
|
|
|
8
|
-
/* RTP
|
|
8
|
+
/* RTP extensions for Transport-wide Congestion Control
|
|
9
9
|
* draft-holmer-rmcat-transport-wide-cc-extensions-01
|
|
10
10
|
|
|
11
11
|
0 1 2 3
|
|
@@ -201,7 +201,7 @@ namespace RTC
|
|
|
201
201
|
static FeedbackRtpTransportPacket* Parse(const uint8_t* data, size_t len);
|
|
202
202
|
|
|
203
203
|
private:
|
|
204
|
-
static const
|
|
204
|
+
static const ankerl::unordered_dense::map<Status, std::string> Status2String;
|
|
205
205
|
|
|
206
206
|
public:
|
|
207
207
|
FeedbackRtpTransportPacket(uint32_t senderSsrc, uint32_t mediaSsrc)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
#define MS_RTC_RTCP_PACKET_HPP
|
|
3
3
|
|
|
4
4
|
#include "common.hpp"
|
|
5
|
-
#include <
|
|
5
|
+
#include <ankerl/unordered_dense.h>
|
|
6
6
|
#include <string>
|
|
7
7
|
|
|
8
8
|
namespace RTC
|
|
@@ -77,7 +77,7 @@ namespace RTC
|
|
|
77
77
|
static const std::string& TypeToString(Type type);
|
|
78
78
|
|
|
79
79
|
private:
|
|
80
|
-
static const
|
|
80
|
+
static const ankerl::unordered_dense::map<Type, std::string> Type2String;
|
|
81
81
|
|
|
82
82
|
public:
|
|
83
83
|
explicit Packet(Type type) : type(type)
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#include "common.hpp"
|
|
5
5
|
#include "Utils.hpp" // BitStream.
|
|
6
|
+
#include <ankerl/unordered_dense.h>
|
|
6
7
|
|
|
7
8
|
namespace RTC
|
|
8
9
|
{
|
|
@@ -31,7 +32,7 @@ namespace RTC
|
|
|
31
32
|
};
|
|
32
33
|
|
|
33
34
|
private:
|
|
34
|
-
static
|
|
35
|
+
static ankerl::unordered_dense::map<DecodeTargetIndication, std::string> dtiToString;
|
|
35
36
|
|
|
36
37
|
private:
|
|
37
38
|
struct FrameDependencyTemplate
|