mediasoup 3.19.21 → 3.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node/lib/ActiveSpeakerObserver.js +34 -1
- package/node/lib/AudioLevelObserver.js +35 -2
- package/node/lib/Channel.d.ts.map +1 -1
- package/node/lib/Channel.js +37 -5
- package/node/lib/Consumer.js +39 -6
- package/node/lib/DataConsumer.d.ts.map +1 -1
- package/node/lib/DataConsumer.js +39 -5
- package/node/lib/DataConsumerTypes.d.ts +1 -0
- package/node/lib/DataConsumerTypes.d.ts.map +1 -1
- package/node/lib/DataProducer.js +37 -4
- package/node/lib/DirectTransport.js +37 -4
- package/node/lib/DirectTransportTypes.d.ts +7 -2
- package/node/lib/DirectTransportTypes.d.ts.map +1 -1
- package/node/lib/Logger.js +4 -1
- package/node/lib/PipeTransport.d.ts +3 -1
- package/node/lib/PipeTransport.d.ts.map +1 -1
- package/node/lib/PipeTransport.js +56 -5
- package/node/lib/PipeTransportTypes.d.ts +28 -8
- package/node/lib/PipeTransportTypes.d.ts.map +1 -1
- package/node/lib/PlainTransport.d.ts +3 -1
- package/node/lib/PlainTransport.d.ts.map +1 -1
- package/node/lib/PlainTransport.js +54 -3
- package/node/lib/PlainTransportTypes.d.ts +27 -7
- package/node/lib/PlainTransportTypes.d.ts.map +1 -1
- package/node/lib/Producer.js +40 -7
- package/node/lib/Router.d.ts +5 -5
- package/node/lib/Router.d.ts.map +1 -1
- package/node/lib/Router.js +81 -36
- package/node/lib/RouterTypes.d.ts +25 -3
- package/node/lib/RouterTypes.d.ts.map +1 -1
- package/node/lib/RtpObserver.js +36 -3
- package/node/lib/Transport.d.ts +3 -1
- package/node/lib/Transport.d.ts.map +1 -1
- package/node/lib/Transport.js +74 -22
- package/node/lib/TransportTypes.d.ts +2 -1
- package/node/lib/TransportTypes.d.ts.map +1 -1
- package/node/lib/WebRtcServer.js +36 -3
- package/node/lib/WebRtcTransport.d.ts +3 -1
- package/node/lib/WebRtcTransport.d.ts.map +1 -1
- package/node/lib/WebRtcTransport.js +55 -4
- package/node/lib/WebRtcTransportTypes.d.ts +27 -7
- package/node/lib/WebRtcTransportTypes.d.ts.map +1 -1
- package/node/lib/Worker.d.ts +2 -1
- package/node/lib/Worker.d.ts.map +1 -1
- package/node/lib/Worker.js +71 -25
- package/node/lib/WorkerTypes.d.ts +0 -4
- package/node/lib/WorkerTypes.d.ts.map +1 -1
- package/node/lib/enhancedEvents.d.ts +2 -2
- package/node/lib/enhancedEvents.d.ts.map +1 -1
- package/node/lib/enhancedEvents.js +0 -2
- package/node/lib/fbs/active-speaker-observer/active-speaker-observer-options.js +34 -1
- package/node/lib/fbs/active-speaker-observer/dominant-speaker-notification.js +34 -1
- package/node/lib/fbs/audio-level-observer/audio-level-observer-options.js +34 -1
- package/node/lib/fbs/audio-level-observer/volume.js +34 -1
- package/node/lib/fbs/audio-level-observer/volumes-notification.js +34 -1
- package/node/lib/fbs/common/string-string-array.js +34 -1
- package/node/lib/fbs/common/string-string.js +34 -1
- package/node/lib/fbs/common/string-uint8.js +34 -1
- package/node/lib/fbs/common/uint16-string.js +34 -1
- package/node/lib/fbs/common/uint32-string.js +34 -1
- package/node/lib/fbs/consumer/base-consumer-dump.js +34 -1
- package/node/lib/fbs/consumer/consumer-dump.js +34 -1
- package/node/lib/fbs/consumer/consumer-layers.js +34 -1
- package/node/lib/fbs/consumer/consumer-score.js +34 -1
- package/node/lib/fbs/consumer/dump-response.js +34 -1
- package/node/lib/fbs/consumer/enable-trace-event-request.js +34 -1
- package/node/lib/fbs/consumer/fir-trace-info.js +34 -1
- package/node/lib/fbs/consumer/get-stats-response.js +34 -1
- package/node/lib/fbs/consumer/key-frame-trace-info.js +34 -1
- package/node/lib/fbs/consumer/layers-change-notification.js +34 -1
- package/node/lib/fbs/consumer/pli-trace-info.js +34 -1
- package/node/lib/fbs/consumer/rtp-notification.js +34 -1
- package/node/lib/fbs/consumer/rtp-trace-info.js +34 -1
- package/node/lib/fbs/consumer/score-notification.js +34 -1
- package/node/lib/fbs/consumer/set-preferred-layers-request.js +34 -1
- package/node/lib/fbs/consumer/set-preferred-layers-response.js +34 -1
- package/node/lib/fbs/consumer/set-priority-request.js +34 -1
- package/node/lib/fbs/consumer/set-priority-response.js +34 -1
- package/node/lib/fbs/consumer/trace-notification.js +34 -1
- package/node/lib/fbs/data-consumer/add-subchannel-request.js +34 -1
- package/node/lib/fbs/data-consumer/add-subchannel-response.js +34 -1
- package/node/lib/fbs/data-consumer/buffered-amount-low-notification.js +34 -1
- package/node/lib/fbs/data-consumer/dump-response.d.ts +5 -2
- package/node/lib/fbs/data-consumer/dump-response.d.ts.map +1 -1
- package/node/lib/fbs/data-consumer/dump-response.js +60 -16
- package/node/lib/fbs/data-consumer/get-buffered-amount-response.js +34 -1
- package/node/lib/fbs/data-consumer/get-stats-response.js +34 -1
- package/node/lib/fbs/data-consumer/message-notification.js +34 -1
- package/node/lib/fbs/data-consumer/remove-subchannel-request.js +34 -1
- package/node/lib/fbs/data-consumer/remove-subchannel-response.js +34 -1
- package/node/lib/fbs/data-consumer/send-request.js +34 -1
- package/node/lib/fbs/data-consumer/set-buffered-amount-low-threshold-request.js +34 -1
- package/node/lib/fbs/data-consumer/set-subchannels-request.js +34 -1
- package/node/lib/fbs/data-consumer/set-subchannels-response.js +34 -1
- package/node/lib/fbs/data-consumer/type.d.ts +5 -0
- package/node/lib/fbs/data-consumer/type.d.ts.map +1 -0
- package/node/lib/fbs/data-consumer/type.js +10 -0
- package/node/lib/fbs/data-consumer.d.ts +1 -0
- package/node/lib/fbs/data-consumer.d.ts.map +1 -1
- package/node/lib/fbs/data-consumer.js +3 -1
- package/node/lib/fbs/data-producer/dump-response.js +34 -1
- package/node/lib/fbs/data-producer/get-stats-response.js +34 -1
- package/node/lib/fbs/data-producer/send-notification.js +34 -1
- package/node/lib/fbs/direct-transport/direct-transport-options.js +34 -1
- package/node/lib/fbs/direct-transport/dump-response.js +34 -1
- package/node/lib/fbs/direct-transport/get-stats-response.js +34 -1
- package/node/lib/fbs/direct-transport/rtcp-notification.js +34 -1
- package/node/lib/fbs/lib-uring/dump.js +34 -1
- package/node/lib/fbs/log/log.js +34 -1
- package/node/lib/fbs/message/message.js +34 -1
- package/node/lib/fbs/notification/body.d.ts +24 -22
- package/node/lib/fbs/notification/body.d.ts.map +1 -1
- package/node/lib/fbs/notification/body.js +24 -20
- package/node/lib/fbs/notification/event.d.ts +27 -26
- package/node/lib/fbs/notification/event.d.ts.map +1 -1
- package/node/lib/fbs/notification/event.js +27 -26
- package/node/lib/fbs/notification/notification.d.ts +3 -2
- package/node/lib/fbs/notification/notification.d.ts.map +1 -1
- package/node/lib/fbs/notification/notification.js +34 -1
- package/node/lib/fbs/pipe-transport/connect-request.js +34 -1
- package/node/lib/fbs/pipe-transport/connect-response.js +34 -1
- package/node/lib/fbs/pipe-transport/dump-response.js +34 -1
- package/node/lib/fbs/pipe-transport/get-stats-response.js +34 -1
- package/node/lib/fbs/pipe-transport/pipe-transport-options.js +34 -1
- package/node/lib/fbs/plain-transport/connect-request.js +34 -1
- package/node/lib/fbs/plain-transport/connect-response.js +34 -1
- package/node/lib/fbs/plain-transport/dump-response.js +34 -1
- package/node/lib/fbs/plain-transport/get-stats-response.js +34 -1
- package/node/lib/fbs/plain-transport/plain-transport-options.js +34 -1
- package/node/lib/fbs/plain-transport/rtcp-tuple-notification.js +34 -1
- package/node/lib/fbs/plain-transport/tuple-notification.js +34 -1
- package/node/lib/fbs/producer/dump-response.js +34 -1
- package/node/lib/fbs/producer/enable-trace-event-request.js +34 -1
- package/node/lib/fbs/producer/fir-trace-info.js +34 -1
- package/node/lib/fbs/producer/get-stats-response.js +34 -1
- package/node/lib/fbs/producer/key-frame-trace-info.js +34 -1
- package/node/lib/fbs/producer/pli-trace-info.js +34 -1
- package/node/lib/fbs/producer/rtp-trace-info.js +34 -1
- package/node/lib/fbs/producer/score-notification.js +34 -1
- package/node/lib/fbs/producer/score.js +34 -1
- package/node/lib/fbs/producer/send-notification.js +34 -1
- package/node/lib/fbs/producer/sr-trace-info.js +34 -1
- package/node/lib/fbs/producer/trace-notification.js +34 -1
- package/node/lib/fbs/producer/video-orientation-change-notification.js +34 -1
- package/node/lib/fbs/request/request.js +34 -1
- package/node/lib/fbs/response/response.js +34 -1
- package/node/lib/fbs/router/close-rtp-observer-request.js +34 -1
- package/node/lib/fbs/router/close-transport-request.js +34 -1
- package/node/lib/fbs/router/create-active-speaker-observer-request.js +34 -1
- package/node/lib/fbs/router/create-audio-level-observer-request.js +34 -1
- package/node/lib/fbs/router/create-direct-transport-request.js +34 -1
- package/node/lib/fbs/router/create-pipe-transport-request.js +34 -1
- package/node/lib/fbs/router/create-plain-transport-request.js +34 -1
- package/node/lib/fbs/router/create-web-rtc-transport-request.js +34 -1
- package/node/lib/fbs/router/dump-response.js +34 -1
- package/node/lib/fbs/rtp-observer/add-producer-request.js +34 -1
- package/node/lib/fbs/rtp-observer/remove-producer-request.js +34 -1
- package/node/lib/fbs/rtp-packet/dump.js +34 -1
- package/node/lib/fbs/rtp-parameters/boolean.js +34 -1
- package/node/lib/fbs/rtp-parameters/codec-mapping.js +34 -1
- package/node/lib/fbs/rtp-parameters/double.js +34 -1
- package/node/lib/fbs/rtp-parameters/encoding-mapping.js +34 -1
- package/node/lib/fbs/rtp-parameters/integer32-array.js +34 -1
- package/node/lib/fbs/rtp-parameters/integer32.js +34 -1
- package/node/lib/fbs/rtp-parameters/parameter.js +34 -1
- package/node/lib/fbs/rtp-parameters/rtcp-feedback.js +34 -1
- package/node/lib/fbs/rtp-parameters/rtcp-parameters.js +34 -1
- package/node/lib/fbs/rtp-parameters/rtp-codec-parameters.js +34 -1
- package/node/lib/fbs/rtp-parameters/rtp-encoding-parameters.js +34 -1
- package/node/lib/fbs/rtp-parameters/rtp-header-extension-parameters.js +34 -1
- package/node/lib/fbs/rtp-parameters/rtp-mapping.js +34 -1
- package/node/lib/fbs/rtp-parameters/rtp-parameters.js +34 -1
- package/node/lib/fbs/rtp-parameters/rtx.js +34 -1
- package/node/lib/fbs/rtp-parameters/string.js +34 -1
- package/node/lib/fbs/rtp-stream/base-stats.js +34 -1
- package/node/lib/fbs/rtp-stream/bitrate-by-layer.js +34 -1
- package/node/lib/fbs/rtp-stream/dump.js +34 -1
- package/node/lib/fbs/rtp-stream/params.js +34 -1
- package/node/lib/fbs/rtp-stream/recv-stats.js +34 -1
- package/node/lib/fbs/rtp-stream/send-stats.js +34 -1
- package/node/lib/fbs/rtp-stream/stats.js +34 -1
- package/node/lib/fbs/rtx-stream/params.js +34 -1
- package/node/lib/fbs/rtx-stream/rtx-dump.js +34 -1
- package/node/lib/fbs/sctp-association/sctp-negotiated-capabilities.d.ts +24 -0
- package/node/lib/fbs/sctp-association/sctp-negotiated-capabilities.d.ts.map +1 -0
- package/node/lib/fbs/sctp-association/sctp-negotiated-capabilities.js +102 -0
- package/node/lib/fbs/sctp-association.d.ts +1 -0
- package/node/lib/fbs/sctp-association.d.ts.map +1 -1
- package/node/lib/fbs/sctp-association.js +4 -1
- package/node/lib/fbs/sctp-parameters/num-sctp-streams.js +34 -1
- package/node/lib/fbs/sctp-parameters/sctp-parameters.d.ts +14 -14
- package/node/lib/fbs/sctp-parameters/sctp-parameters.d.ts.map +1 -1
- package/node/lib/fbs/sctp-parameters/sctp-parameters.js +73 -40
- package/node/lib/fbs/sctp-parameters/sctp-stream-parameters.js +34 -1
- package/node/lib/fbs/sctp-parameters.d.ts +0 -1
- package/node/lib/fbs/sctp-parameters.d.ts.map +1 -1
- package/node/lib/fbs/sctp-parameters.js +1 -4
- package/node/lib/fbs/srtp-parameters/srtp-parameters.js +34 -1
- package/node/lib/fbs/transport/bwe-trace-info.js +34 -1
- package/node/lib/fbs/transport/close-consumer-request.js +34 -1
- package/node/lib/fbs/transport/close-data-consumer-request.js +34 -1
- package/node/lib/fbs/transport/close-data-producer-request.js +34 -1
- package/node/lib/fbs/transport/close-producer-request.js +34 -1
- package/node/lib/fbs/transport/consume-data-request.d.ts +1 -1
- package/node/lib/fbs/transport/consume-data-request.js +35 -2
- package/node/lib/fbs/transport/consume-request.js +34 -1
- package/node/lib/fbs/transport/consume-response.js +34 -1
- package/node/lib/fbs/transport/dump.d.ts +7 -4
- package/node/lib/fbs/transport/dump.d.ts.map +1 -1
- package/node/lib/fbs/transport/dump.js +66 -22
- package/node/lib/fbs/transport/enable-trace-event-request.js +34 -1
- package/node/lib/fbs/transport/listen-info.js +34 -1
- package/node/lib/fbs/transport/options.d.ts +14 -14
- package/node/lib/fbs/transport/options.d.ts.map +1 -1
- package/node/lib/fbs/transport/options.js +92 -51
- package/node/lib/fbs/transport/port-range.js +34 -1
- package/node/lib/fbs/transport/produce-data-request.js +34 -1
- package/node/lib/fbs/transport/produce-request.js +34 -1
- package/node/lib/fbs/transport/produce-response.js +34 -1
- package/node/lib/fbs/transport/recv-rtp-header-extensions.js +34 -1
- package/node/lib/fbs/transport/restart-ice-response.js +34 -1
- package/node/lib/fbs/transport/rtp-listener.js +34 -1
- package/node/lib/fbs/transport/sctp-listener.js +34 -1
- package/node/lib/fbs/transport/sctp-negotiated-capabilities-notification.d.ts +22 -0
- package/node/lib/fbs/transport/sctp-negotiated-capabilities-notification.d.ts.map +1 -0
- package/node/lib/fbs/transport/sctp-negotiated-capabilities-notification.js +93 -0
- package/node/lib/fbs/transport/sctp-state-change-notification.js +34 -1
- package/node/lib/fbs/transport/send-rtcp-notification.js +34 -1
- package/node/lib/fbs/transport/set-max-incoming-bitrate-request.js +34 -1
- package/node/lib/fbs/transport/set-max-outgoing-bitrate-request.js +34 -1
- package/node/lib/fbs/transport/set-min-outgoing-bitrate-request.js +34 -1
- package/node/lib/fbs/transport/socket-flags.js +34 -1
- package/node/lib/fbs/transport/stats.js +34 -1
- package/node/lib/fbs/transport/trace-notification.js +34 -1
- package/node/lib/fbs/transport/tuple.js +34 -1
- package/node/lib/fbs/transport.d.ts +1 -0
- package/node/lib/fbs/transport.d.ts.map +1 -1
- package/node/lib/fbs/transport.js +5 -2
- package/node/lib/fbs/web-rtc-server/dump-response.js +34 -1
- package/node/lib/fbs/web-rtc-server/ice-user-name-fragment.js +34 -1
- package/node/lib/fbs/web-rtc-server/ip-port.js +34 -1
- package/node/lib/fbs/web-rtc-server/tuple-hash.js +34 -1
- package/node/lib/fbs/web-rtc-transport/connect-request.js +34 -1
- package/node/lib/fbs/web-rtc-transport/connect-response.js +34 -1
- package/node/lib/fbs/web-rtc-transport/dtls-parameters.js +34 -1
- package/node/lib/fbs/web-rtc-transport/dtls-state-change-notification.js +34 -1
- package/node/lib/fbs/web-rtc-transport/dump-response.js +34 -1
- package/node/lib/fbs/web-rtc-transport/fingerprint.js +34 -1
- package/node/lib/fbs/web-rtc-transport/get-stats-response.js +34 -1
- package/node/lib/fbs/web-rtc-transport/ice-candidate.js +34 -1
- package/node/lib/fbs/web-rtc-transport/ice-parameters.js +34 -1
- package/node/lib/fbs/web-rtc-transport/ice-selected-tuple-change-notification.js +34 -1
- package/node/lib/fbs/web-rtc-transport/ice-state-change-notification.js +34 -1
- package/node/lib/fbs/web-rtc-transport/listen-individual.js +34 -1
- package/node/lib/fbs/web-rtc-transport/listen-server.js +34 -1
- package/node/lib/fbs/web-rtc-transport/web-rtc-transport-options.js +34 -1
- package/node/lib/fbs/worker/channel-message-handlers.js +34 -1
- package/node/lib/fbs/worker/close-router-request.js +34 -1
- package/node/lib/fbs/worker/close-web-rtc-server-request.js +34 -1
- package/node/lib/fbs/worker/create-router-request.js +34 -1
- package/node/lib/fbs/worker/create-web-rtc-server-request.js +34 -1
- package/node/lib/fbs/worker/dump-response.js +34 -1
- package/node/lib/fbs/worker/resource-usage-response.js +34 -1
- package/node/lib/fbs/worker/update-settings-request.js +34 -1
- package/node/lib/index.d.ts +1 -1
- package/node/lib/index.d.ts.map +1 -1
- package/node/lib/index.js +37 -5
- package/node/lib/ortc.js +36 -3
- package/node/lib/rtpParametersFbsUtils.js +34 -1
- package/node/lib/rtpStreamStatsFbsUtils.js +35 -2
- package/node/lib/sctpParametersFbsUtils.d.ts +2 -2
- package/node/lib/sctpParametersFbsUtils.d.ts.map +1 -1
- package/node/lib/sctpParametersFbsUtils.js +44 -7
- package/node/lib/sctpParametersTypes.d.ts +10 -46
- package/node/lib/sctpParametersTypes.d.ts.map +1 -1
- package/node/lib/srtpParametersFbsUtils.js +34 -1
- package/node/lib/test/test-ActiveSpeakerObserver.js +35 -2
- package/node/lib/test/test-AudioLevelObserver.js +35 -2
- package/node/lib/test/test-Consumer.js +37 -4
- package/node/lib/test/test-DataConsumer.js +35 -2
- package/node/lib/test/test-DataProducer.js +35 -2
- package/node/lib/test/test-DirectTransport.js +36 -8
- package/node/lib/test/test-PipeTransport.js +35 -2
- package/node/lib/test/test-PlainTransport.js +45 -12
- package/node/lib/test/test-Producer.js +37 -4
- package/node/lib/test/test-Router.js +35 -2
- package/node/lib/test/test-WebRtcServer.js +34 -1
- package/node/lib/test/test-WebRtcTransport.js +51 -22
- package/node/lib/test/test-Worker.js +37 -4
- package/node/lib/test/test-mediasoup.js +36 -3
- package/node/lib/test/test-multiopus.js +35 -2
- package/node/lib/test/test-ortc.js +34 -1
- package/node/lib/test/test-werift-sctp.js +39 -5
- package/npm-scripts.mjs +2 -2
- package/package.json +13 -11
- package/worker/deps/libwebrtc/LICENSE +5 -0
- package/worker/deps/libwebrtc/README.md +3 -3
- package/worker/deps/libwebrtc/libwebrtc/mediasoup_helpers.h +13 -10
- package/worker/fbs/dataConsumer.fbs +7 -2
- package/worker/fbs/dataProducer.fbs +1 -0
- package/worker/fbs/notification.fbs +2 -0
- package/worker/fbs/sctpAssociation.fbs +4 -0
- package/worker/fbs/sctpParameters.fbs +5 -12
- package/worker/fbs/transport.fbs +12 -8
- package/worker/fuzzer/src/RTC/FuzzerDtlsTransport.cpp +13 -3
- package/worker/fuzzer/src/RTC/FuzzerRateCalculator.cpp +2 -2
- package/worker/fuzzer/src/RTC/FuzzerSeqManager.cpp +1 -1
- package/worker/fuzzer/src/RTC/FuzzerTrendCalculator.cpp +5 -5
- package/worker/fuzzer/src/RTC/ICE/FuzzerStunPacket.cpp +9 -6
- package/worker/fuzzer/src/RTC/RTP/FuzzerRetransmissionBuffer.cpp +1 -1
- package/worker/fuzzer/src/RTC/RTP/FuzzerRtpStreamSend.cpp +14 -2
- package/worker/fuzzer/src/RTC/SCTP/association/FuzzerStateCookie.cpp +1 -1
- package/worker/fuzzer/src/RTC/SCTP/packet/FuzzerPacket.cpp +5 -2
- package/worker/fuzzer/src/fuzzer.cpp +3 -10
- package/worker/include/Channel/ChannelMessageRegistrator.hpp +39 -0
- package/worker/include/Channel/ChannelMessageRegistratorInterface.hpp +32 -0
- package/worker/include/Channel/ChannelRequest.hpp +1 -1
- package/worker/include/Channel/ChannelSocket.hpp +1 -1
- package/worker/include/DepLibUV.hpp +1 -1
- package/worker/include/DepLibUring.hpp +3 -3
- package/worker/include/Logger.hpp +4 -4
- package/worker/include/MediaSoupErrors.hpp +1 -1
- package/worker/include/RTC/ActiveSpeakerObserver.hpp +11 -9
- package/worker/include/RTC/AudioLevelObserver.hpp +7 -7
- package/worker/include/RTC/Consumer.hpp +3 -3
- package/worker/include/RTC/DataConsumer.hpp +13 -17
- package/worker/include/RTC/DataProducer.hpp +6 -9
- package/worker/include/RTC/DirectTransport.hpp +4 -6
- package/worker/include/RTC/DtlsTransport.hpp +13 -11
- package/worker/include/RTC/ICE/IceServer.hpp +8 -5
- package/worker/include/RTC/ICE/StunPacket.hpp +1 -1
- package/worker/include/RTC/KeyFrameRequestManager.hpp +15 -12
- package/worker/include/RTC/NackGenerator.hpp +8 -6
- package/worker/include/RTC/PipeConsumer.hpp +1 -2
- package/worker/include/RTC/PipeTransport.hpp +4 -6
- package/worker/include/RTC/PlainTransport.hpp +4 -6
- package/worker/include/RTC/PortManager.hpp +1 -1
- package/worker/include/RTC/Producer.hpp +3 -3
- package/worker/include/RTC/RTCP/FeedbackPs.hpp +1 -1
- package/worker/include/RTC/RTCP/FeedbackRtp.hpp +1 -1
- package/worker/include/RTC/RTCP/FeedbackRtpNack.hpp +1 -1
- package/worker/include/RTC/RTCP/ReceiverReport.hpp +1 -1
- package/worker/include/RTC/RTP/Packet.hpp +2 -2
- package/worker/include/RTC/RTP/RtpStream.hpp +17 -12
- package/worker/include/RTC/RTP/RtpStreamRecv.hpp +8 -6
- package/worker/include/RTC/RTP/RtpStreamSend.hpp +4 -1
- package/worker/include/RTC/RTP/RtxStream.hpp +3 -1
- package/worker/include/RTC/RTP/SharedPacket.hpp +1 -1
- package/worker/include/RTC/RateCalculator.hpp +5 -2
- package/worker/include/RTC/Router.hpp +7 -8
- package/worker/include/RTC/RtpObserver.hpp +3 -3
- package/worker/include/RTC/SCTP/association/Association.hpp +53 -19
- package/worker/include/RTC/SCTP/association/AssociationListenerDeferrer.hpp +14 -6
- package/worker/include/RTC/SCTP/association/HeartbeatHandler.hpp +18 -14
- package/worker/include/RTC/SCTP/association/PacketSender.hpp +3 -3
- package/worker/include/RTC/SCTP/association/StateCookie.hpp +1 -1
- package/worker/include/RTC/SCTP/association/StreamResetHandler.hpp +49 -35
- package/worker/include/RTC/SCTP/association/TransmissionControlBlock.hpp +114 -31
- package/worker/include/RTC/SCTP/association/{TCBContext.hpp → TransmissionControlBlockContextInterface.hpp} +14 -8
- package/worker/include/RTC/SCTP/packet/Chunk.hpp +3 -3
- package/worker/include/RTC/SCTP/packet/TLV.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/UserData.hpp +61 -17
- package/worker/include/RTC/SCTP/packet/chunks/AnyDataChunk.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/chunks/AnyForwardTsnChunk.hpp +9 -9
- package/worker/include/RTC/SCTP/packet/chunks/AnyInitChunk.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/chunks/DataChunk.hpp +4 -2
- package/worker/include/RTC/SCTP/packet/chunks/ForwardTsnChunk.hpp +3 -3
- package/worker/include/RTC/SCTP/packet/chunks/IDataChunk.hpp +4 -2
- package/worker/include/RTC/SCTP/packet/chunks/IForwardTsnChunk.hpp +3 -3
- package/worker/include/RTC/SCTP/packet/chunks/InitAckChunk.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/chunks/InitChunk.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/chunks/SackChunk.hpp +10 -3
- package/worker/include/RTC/SCTP/packet/chunks/ShutdownChunk.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/errorCauses/InvalidStreamIdentifierErrorCause.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/errorCauses/MissingMandatoryParameterErrorCause.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/errorCauses/NoUserDataErrorCause.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/errorCauses/StaleCookieErrorCause.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/AddIncomingStreamsRequestParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/AddOutgoingStreamsRequestParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/CookiePreservativeParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/IncomingSsnResetRequestParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/OutgoingSsnResetRequestParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/ReconfigurationResponseParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/SsnTsnResetRequestParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/SupportedAddressTypesParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/SupportedExtensionsParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/ZeroChecksumAcceptableParameter.hpp +1 -1
- package/worker/include/RTC/SCTP/public/AssociationInterface.hpp +22 -2
- package/worker/include/RTC/SCTP/public/{AssociationListener.hpp → AssociationListenerInterface.hpp} +5 -5
- package/worker/include/RTC/SCTP/public/Message.hpp +26 -10
- package/worker/include/RTC/SCTP/public/SctpOptions.hpp +28 -19
- package/worker/include/RTC/SCTP/public/SctpTypes.hpp +21 -0
- package/worker/include/RTC/SCTP/rx/DataTracker.hpp +277 -0
- package/worker/include/RTC/SCTP/rx/InterleavedReassemblyStreams.hpp +116 -0
- package/worker/include/RTC/SCTP/rx/ReassemblyQueue.hpp +202 -0
- package/worker/include/RTC/SCTP/rx/ReassemblyStreamsInterface.hpp +83 -0
- package/worker/include/RTC/SCTP/rx/TraditionalReassemblyStreams.hpp +183 -0
- package/worker/include/RTC/SCTP/tx/OutstandingData.hpp +595 -0
- package/worker/include/RTC/SCTP/tx/RetransmissionErrorCounter.hpp +3 -3
- package/worker/include/RTC/SCTP/tx/RetransmissionQueue.hpp +329 -0
- package/worker/include/RTC/SCTP/tx/RetransmissionTimeout.hpp +11 -10
- package/worker/include/RTC/SCTP/tx/RoundRobinSendQueue.hpp +356 -0
- package/worker/include/RTC/SCTP/tx/SendQueueInterface.hpp +180 -0
- package/worker/include/RTC/SCTP/tx/StreamScheduler.hpp +235 -0
- package/worker/include/RTC/SenderBandwidthEstimator.hpp +5 -1
- package/worker/include/RTC/Serializable.hpp +11 -3
- package/worker/include/RTC/SimpleConsumer.hpp +1 -2
- package/worker/include/RTC/SimulcastConsumer.hpp +1 -2
- package/worker/include/RTC/SvcConsumer.hpp +1 -2
- package/worker/include/RTC/TcpServer.hpp +2 -2
- package/worker/include/RTC/Transport.hpp +65 -86
- package/worker/include/RTC/TransportCongestionControlClient.hpp +8 -5
- package/worker/include/RTC/TransportCongestionControlServer.hpp +8 -5
- package/worker/include/RTC/TransportTuple.hpp +1 -1
- package/worker/include/RTC/UdpSocket.hpp +1 -1
- package/worker/include/RTC/WebRtcServer.hpp +3 -3
- package/worker/include/RTC/WebRtcTransport.hpp +5 -7
- package/worker/include/Settings.hpp +2 -3
- package/worker/include/Shared.hpp +64 -0
- package/worker/include/SharedInterface.hpp +77 -0
- package/worker/include/Utils/UnwrappedSequenceNumber.hpp +270 -0
- package/worker/include/Utils.hpp +10 -4
- package/worker/include/Worker.hpp +6 -6
- package/worker/include/common.hpp +12 -12
- package/worker/include/handles/BackoffTimerHandle.hpp +28 -67
- package/worker/include/handles/BackoffTimerHandleInterface.hpp +123 -0
- package/worker/include/handles/TimerHandle.hpp +29 -20
- package/worker/include/handles/TimerHandleInterface.hpp +43 -0
- package/worker/meson.build +45 -29
- package/worker/meson_options.txt +2 -1
- package/worker/mocks/include/Channel/MockChannelMessageRegistrator.hpp +45 -0
- package/worker/mocks/include/MockShared.hpp +90 -0
- package/worker/mocks/include/RTC/SCTP/association/MockAssociationListener.hpp +308 -0
- package/worker/mocks/include/RTC/SCTP/association/MockTransmissionControlBlockContext.hpp +183 -0
- package/worker/mocks/include/RTC/SCTP/tx/MockSendQueue.hpp +262 -0
- package/worker/mocks/include/handles/MockBackoffTimerHandle.hpp +153 -0
- package/worker/mocks/include/handles/MockTimerHandle.hpp +74 -0
- package/worker/mocks/include/mockTypes.hpp +15 -0
- package/worker/mocks/src/Channel/MockChannelMessageRegistrator.cpp +128 -0
- package/worker/mocks/src/MockShared.cpp +46 -0
- package/worker/mocks/src/RTC/SCTP/association/MockTransmissionControlBlockContext.cpp +39 -0
- package/worker/mocks/src/handles/MockBackoffTimerHandle.cpp +127 -0
- package/worker/scripts/clang-scripts.mjs +5 -1
- package/worker/scripts/package-lock.json +6 -7
- package/worker/src/Channel/ChannelMessageRegistrator.cpp +125 -0
- package/worker/src/Channel/ChannelSocket.cpp +3 -4
- package/worker/src/DepLibUV.cpp +1 -1
- package/worker/src/DepLibUring.cpp +3 -1
- package/worker/src/Logger.cpp +1 -1
- package/worker/src/MediaSoupErrors.cpp +2 -0
- package/worker/src/RTC/ActiveSpeakerObserver.cpp +14 -14
- package/worker/src/RTC/AudioLevelObserver.cpp +12 -10
- package/worker/src/RTC/Consumer.cpp +28 -26
- package/worker/src/RTC/DataConsumer.cpp +61 -71
- package/worker/src/RTC/DataProducer.cpp +16 -11
- package/worker/src/RTC/DirectTransport.cpp +21 -20
- package/worker/src/RTC/DtlsTransport.cpp +4 -4
- package/worker/src/RTC/ICE/IceServer.cpp +6 -5
- package/worker/src/RTC/ICE/StunPacket.cpp +1 -1
- package/worker/src/RTC/KeyFrameRequestManager.cpp +15 -15
- package/worker/src/RTC/NackGenerator.cpp +6 -6
- package/worker/src/RTC/PipeConsumer.cpp +6 -5
- package/worker/src/RTC/PipeTransport.cpp +9 -22
- package/worker/src/RTC/PlainTransport.cpp +16 -28
- package/worker/src/RTC/Producer.cpp +40 -39
- package/worker/src/RTC/RTCP/FeedbackPsAfb.cpp +1 -1
- package/worker/src/RTC/RTCP/FeedbackPsRpsi.cpp +1 -2
- package/worker/src/RTC/RTCP/FeedbackRtpTransport.cpp +1 -1
- package/worker/src/RTC/RTCP/XR.cpp +1 -1
- package/worker/src/RTC/RTP/Packet.cpp +3 -1
- package/worker/src/RTC/RTP/ProbationGenerator.cpp +4 -4
- package/worker/src/RTC/RTP/RetransmissionBuffer.cpp +1 -1
- package/worker/src/RTC/RTP/RtpStream.cpp +17 -10
- package/worker/src/RTC/RTP/RtpStreamRecv.cpp +16 -14
- package/worker/src/RTC/RTP/RtpStreamSend.cpp +12 -9
- package/worker/src/RTC/RTP/RtxStream.cpp +7 -7
- package/worker/src/RTC/RTP/SharedPacket.cpp +3 -3
- package/worker/src/RTC/RateCalculator.cpp +1 -2
- package/worker/src/RTC/Router.cpp +61 -38
- package/worker/src/RTC/RtpDictionaries/RtpCodecMimeType.cpp +1 -1
- package/worker/src/RTC/RtpObserver.cpp +2 -1
- package/worker/src/RTC/SCTP/LICENSE +44 -0
- package/worker/src/RTC/SCTP/association/Association.cpp +417 -411
- package/worker/src/RTC/SCTP/association/AssociationListenerDeferrer.cpp +46 -13
- package/worker/src/RTC/SCTP/association/HeartbeatHandler.cpp +47 -43
- package/worker/src/RTC/SCTP/association/PacketSender.cpp +8 -8
- package/worker/src/RTC/SCTP/association/StreamResetHandler.cpp +113 -101
- package/worker/src/RTC/SCTP/association/TransmissionControlBlock.cpp +291 -62
- package/worker/src/RTC/SCTP/packet/Chunk.cpp +5 -1
- package/worker/src/RTC/SCTP/packet/Packet.cpp +8 -1
- package/worker/src/RTC/SCTP/packet/chunks/DataChunk.cpp +17 -0
- package/worker/src/RTC/SCTP/packet/chunks/ForwardTsnChunk.cpp +4 -4
- package/worker/src/RTC/SCTP/packet/chunks/IDataChunk.cpp +25 -0
- package/worker/src/RTC/SCTP/packet/chunks/IForwardTsnChunk.cpp +10 -7
- package/worker/src/RTC/SCTP/packet/chunks/SackChunk.cpp +21 -4
- package/worker/src/RTC/SCTP/packet/chunks/ShutdownCompleteChunk.cpp +1 -1
- package/worker/src/RTC/SCTP/packet/errorCauses/NoUserDataErrorCause.cpp +1 -1
- package/worker/src/RTC/SCTP/packet/errorCauses/ProtocolViolationErrorCause.cpp +2 -2
- package/worker/src/RTC/SCTP/packet/errorCauses/UserInitiatedAbortErrorCause.cpp +1 -1
- package/worker/src/RTC/SCTP/public/Message.cpp +8 -0
- package/worker/src/RTC/SCTP/public/SctpOptions.cpp +90 -0
- package/worker/src/RTC/SCTP/rx/DataTracker.cpp +471 -0
- package/worker/src/RTC/SCTP/rx/InterleavedReassemblyStreams.cpp +327 -0
- package/worker/src/RTC/SCTP/rx/ReassemblyQueue.cpp +288 -0
- package/worker/src/RTC/SCTP/rx/TraditionalReassemblyStreams.cpp +453 -0
- package/worker/src/RTC/SCTP/tx/OutstandingData.cpp +912 -0
- package/worker/src/RTC/SCTP/tx/RetransmissionQueue.cpp +786 -0
- package/worker/src/RTC/SCTP/tx/RetransmissionTimeout.cpp +2 -2
- package/worker/src/RTC/SCTP/tx/RoundRobinSendQueue.cpp +752 -0
- package/worker/src/RTC/SCTP/tx/StreamScheduler.cpp +257 -0
- package/worker/src/RTC/SenderBandwidthEstimator.cpp +7 -5
- package/worker/src/RTC/SimpleConsumer.cpp +11 -11
- package/worker/src/RTC/SimulcastConsumer.cpp +16 -16
- package/worker/src/RTC/SrtpSession.cpp +1 -1
- package/worker/src/RTC/SvcConsumer.cpp +16 -16
- package/worker/src/RTC/TcpConnection.cpp +1 -1
- package/worker/src/RTC/Transport.cpp +497 -563
- package/worker/src/RTC/TransportCongestionControlClient.cpp +9 -8
- package/worker/src/RTC/TransportCongestionControlServer.cpp +5 -5
- package/worker/src/RTC/WebRtcServer.cpp +5 -4
- package/worker/src/RTC/WebRtcTransport.cpp +44 -39
- package/worker/src/Settings.cpp +9 -28
- package/worker/src/Shared.cpp +35 -0
- package/worker/src/Utils/Crypto.cpp +1 -1
- package/worker/src/Utils/String.cpp +1 -1
- package/worker/src/Worker.cpp +19 -48
- package/worker/src/handles/BackoffTimerHandle.cpp +34 -21
- package/worker/src/handles/TimerHandle.cpp +5 -4
- package/worker/src/handles/UdpSocketHandle.cpp +1 -1
- package/worker/src/lib.cpp +17 -16
- package/worker/subprojects/catch2.wrap +6 -6
- package/worker/tasks.py +1 -1
- package/worker/test/include/RTC/ICE/iceCommon.hpp +8 -7
- package/worker/test/include/RTC/RTP/rtpCommon.hpp +7 -6
- package/worker/test/include/RTC/SCTP/sctpCommon.hpp +16 -10
- package/worker/test/include/catch2Macros.hpp +31 -0
- package/worker/test/src/RTC/ICE/TestStunPacket.cpp +3 -3
- package/worker/test/src/RTC/ICE/iceCommon.cpp +2 -2
- package/worker/test/src/RTC/RTP/Codecs/TestVP8.cpp +1 -1
- package/worker/test/src/RTC/RTP/Codecs/TestVP9.cpp +1 -1
- package/worker/test/src/RTC/RTP/TestPacket.cpp +3 -3
- package/worker/test/src/RTC/RTP/TestRtpStreamRecv.cpp +16 -9
- package/worker/test/src/RTC/RTP/TestRtpStreamSend.cpp +38 -23
- package/worker/test/src/RTC/RTP/TestSharedPacket.cpp +1 -1
- package/worker/test/src/RTC/RTP/rtpCommon.cpp +2 -2
- package/worker/test/src/RTC/SCTP/association/TestHeartbeatHandler.cpp +292 -0
- package/worker/test/src/RTC/SCTP/association/TestNegotiatedCapabilities.cpp +1 -1
- package/worker/test/src/RTC/SCTP/association/TestStateCookie.cpp +1 -1
- package/worker/test/src/RTC/SCTP/association/TestTransmissionControlBlock.cpp +99 -0
- package/worker/test/src/RTC/SCTP/packet/TestChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/TestPacket.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestAbortAssociationChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestCookieAckChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestCookieEchoChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestDataChunk.cpp +77 -7
- package/worker/test/src/RTC/SCTP/packet/chunks/TestForwardTsnChunk.cpp +35 -26
- package/worker/test/src/RTC/SCTP/packet/chunks/TestHeartbeatAckChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestHeartbeatRequestChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestIDataChunk.cpp +77 -7
- package/worker/test/src/RTC/SCTP/packet/chunks/TestIForwardTsnChunk.cpp +59 -27
- package/worker/test/src/RTC/SCTP/packet/chunks/TestInitAckChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestInitChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestOperationErrorChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestReConfigChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestSackChunk.cpp +73 -35
- package/worker/test/src/RTC/SCTP/packet/chunks/TestShutdownAckChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestShutdownChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestShutdownCompleteChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestUnknownChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestCookieReceivedWhileShuttingDownErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestInvalidMandatoryParameterErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestInvalidStreamIdentifierErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestMissingMandatoryParameterErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestNoUserDataErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestOutOfResourceErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestProtocolViolationErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestRestartOfAnAssociationWithNewAddressesErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestStaleCookieErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnknownErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnrecognizedChunkTypeErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnrecognizedParametersErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnresolvableAddressErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUserInitiatedAbortErrorCause.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestAddIncomingStreamsRequestParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestAddOutgoingStreamsRequestParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestCookiePreservativeParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestForwardTsnSupportedParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestHeartbeatInfoParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestIPv4AddressParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestIPv6AddressParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestIncomingSsnResetRequestParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestOutgoingSsnResetRequestParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestReconfigurationResponseParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestSsnTsnResetRequestParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestStateCookieParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestSupportedAddressTypesParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestSupportedExtensionsParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestUnknownParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestUnrecognizedParameterParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestZeroChecksumAcceptableParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/rx/TestDataTracker.cpp +1117 -0
- package/worker/test/src/RTC/SCTP/rx/TestInterleavedReassemblyStreams.cpp +565 -0
- package/worker/test/src/RTC/SCTP/rx/TestReassemblyQueue.cpp +557 -0
- package/worker/test/src/RTC/SCTP/rx/TestTraditionalReassemblyStreams.cpp +555 -0
- package/worker/test/src/RTC/SCTP/sctpCommon.cpp +2 -2
- package/worker/test/src/RTC/SCTP/tx/TestOutstandingData.cpp +1248 -0
- package/worker/test/src/RTC/SCTP/tx/TestRetransmissionErrorCounter.cpp +4 -0
- package/worker/test/src/RTC/SCTP/tx/TestRetransmissionQueue.cpp +2218 -0
- package/worker/test/src/RTC/SCTP/tx/TestRetransmissionTimeout.cpp +33 -33
- package/worker/test/src/RTC/SCTP/tx/TestRoundRobinSendQueue.cpp +1130 -0
- package/worker/test/src/RTC/SCTP/tx/TestStreamScheduler.cpp +721 -0
- package/worker/test/src/RTC/TestKeyFrameRequestManager.cpp +20 -30
- package/worker/test/src/RTC/TestNackGenerator.cpp +11 -8
- package/worker/test/src/RTC/TestRateCalculator.cpp +6 -7
- package/worker/test/src/RTC/TestSimpleConsumer.cpp +11 -11
- package/worker/test/src/RTC/TestTransportCongestionControlServer.cpp +15 -3
- package/worker/test/src/Utils/TestByte.cpp +98 -0
- package/worker/test/src/{RTC/SCTP/common → Utils}/TestUnwrappedSequenceNumber.cpp +2 -2
- package/worker/test/src/testHelpers.cpp +1 -1
- package/worker/test/src/tests.cpp +0 -12
- package/node/lib/fbs/consumer/degrade-request.d.ts +0 -30
- package/node/lib/fbs/consumer/degrade-request.d.ts.map +0 -1
- package/node/lib/fbs/consumer/degrade-request.js +0 -91
- package/node/lib/fbs/consumer/enable-delay-and-loss-request.d.ts +0 -24
- package/node/lib/fbs/consumer/enable-delay-and-loss-request.d.ts.map +0 -1
- package/node/lib/fbs/consumer/enable-delay-and-loss-request.js +0 -69
- package/node/lib/fbs/producer/degrade-request.d.ts +0 -30
- package/node/lib/fbs/producer/degrade-request.d.ts.map +0 -1
- package/node/lib/fbs/producer/degrade-request.js +0 -91
- package/node/lib/fbs/worker/close-notification.d.ts +0 -18
- package/node/lib/fbs/worker/close-notification.d.ts.map +0 -1
- package/node/lib/fbs/worker/close-notification.js +0 -45
- package/node/lib/fbs/worker/close-request.d.ts +0 -18
- package/node/lib/fbs/worker/close-request.d.ts.map +0 -1
- package/node/lib/fbs/worker/close-request.js +0 -45
- package/node/lib/fbs/worker/close-worker-notification.d.ts +0 -18
- package/node/lib/fbs/worker/close-worker-notification.d.ts.map +0 -1
- package/node/lib/fbs/worker/close-worker-notification.js +0 -45
- package/worker/include/ChannelMessageRegistrator.hpp +0 -30
- package/worker/include/DepUsrSCTP.hpp +0 -48
- package/worker/include/RTC/SCTP/TODO_SCTP.md +0 -43
- package/worker/include/RTC/SCTP/common/UnwrappedSequenceNumber.hpp +0 -274
- package/worker/include/RTC/SctpAssociation.hpp +0 -147
- package/worker/include/RTC/Shared.hpp +0 -23
- package/worker/src/ChannelMessageRegistrator.cpp +0 -119
- package/worker/src/DepUsrSCTP.cpp +0 -277
- package/worker/src/RTC/SctpAssociation.cpp +0 -1175
- package/worker/src/RTC/Shared.cpp +0 -23
- package/worker/subprojects/usrsctp.wrap +0 -8
|
@@ -13,7 +13,7 @@ namespace RTC
|
|
|
13
13
|
/* Instance methods. */
|
|
14
14
|
|
|
15
15
|
AudioLevelObserver::AudioLevelObserver(
|
|
16
|
-
|
|
16
|
+
SharedInterface* shared,
|
|
17
17
|
const std::string& id,
|
|
18
18
|
RTC::RtpObserver::Listener* listener,
|
|
19
19
|
const FBS::AudioLevelObserver::AudioLevelObserverOptions* options)
|
|
@@ -39,12 +39,12 @@ namespace RTC
|
|
|
39
39
|
this->interval = 5000;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
this->periodicTimer =
|
|
42
|
+
this->periodicTimer = this->shared->CreateTimer(this);
|
|
43
43
|
|
|
44
44
|
this->periodicTimer->Start(this->interval, this->interval);
|
|
45
45
|
|
|
46
46
|
// NOTE: This may throw.
|
|
47
|
-
this->shared->
|
|
47
|
+
this->shared->GetChannelMessageRegistrator()->RegisterHandler(
|
|
48
48
|
this->id,
|
|
49
49
|
/*channelRequestHandler*/ this,
|
|
50
50
|
/*channelNotificationHandler*/ nullptr);
|
|
@@ -54,7 +54,7 @@ namespace RTC
|
|
|
54
54
|
{
|
|
55
55
|
MS_TRACE();
|
|
56
56
|
|
|
57
|
-
this->shared->
|
|
57
|
+
this->shared->GetChannelMessageRegistrator()->UnregisterHandler(this->id);
|
|
58
58
|
|
|
59
59
|
delete this->periodicTimer;
|
|
60
60
|
}
|
|
@@ -127,7 +127,7 @@ namespace RTC
|
|
|
127
127
|
{
|
|
128
128
|
this->silence = true;
|
|
129
129
|
|
|
130
|
-
this->shared->
|
|
130
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
131
131
|
this->id, FBS::Notification::Event::AUDIOLEVELOBSERVER_SILENCE);
|
|
132
132
|
}
|
|
133
133
|
}
|
|
@@ -179,13 +179,15 @@ namespace RTC
|
|
|
179
179
|
{
|
|
180
180
|
volumes.emplace_back(
|
|
181
181
|
FBS::AudioLevelObserver::CreateVolumeDirect(
|
|
182
|
-
this->shared->
|
|
182
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(),
|
|
183
|
+
rit->second->id.c_str(),
|
|
184
|
+
rit->first));
|
|
183
185
|
}
|
|
184
186
|
|
|
185
187
|
auto notification = FBS::AudioLevelObserver::CreateVolumesNotificationDirect(
|
|
186
|
-
this->shared->
|
|
188
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(), &volumes);
|
|
187
189
|
|
|
188
|
-
this->shared->
|
|
190
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
189
191
|
this->id,
|
|
190
192
|
FBS::Notification::Event::AUDIOLEVELOBSERVER_VOLUMES,
|
|
191
193
|
FBS::Notification::Body::AudioLevelObserver_VolumesNotification,
|
|
@@ -195,7 +197,7 @@ namespace RTC
|
|
|
195
197
|
{
|
|
196
198
|
this->silence = true;
|
|
197
199
|
|
|
198
|
-
this->shared->
|
|
200
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
199
201
|
this->id, FBS::Notification::Event::AUDIOLEVELOBSERVER_SILENCE);
|
|
200
202
|
}
|
|
201
203
|
}
|
|
@@ -213,7 +215,7 @@ namespace RTC
|
|
|
213
215
|
}
|
|
214
216
|
}
|
|
215
217
|
|
|
216
|
-
inline void AudioLevelObserver::OnTimer(
|
|
218
|
+
inline void AudioLevelObserver::OnTimer(TimerHandleInterface* /*timer*/)
|
|
217
219
|
{
|
|
218
220
|
MS_TRACE();
|
|
219
221
|
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// #define MS_LOG_DEV_LEVEL 3
|
|
3
3
|
|
|
4
4
|
#include "RTC/Consumer.hpp"
|
|
5
|
-
#include "DepLibUV.hpp"
|
|
6
5
|
#include "Logger.hpp"
|
|
7
6
|
#include "MediaSoupErrors.hpp"
|
|
8
7
|
|
|
@@ -11,7 +10,7 @@ namespace RTC
|
|
|
11
10
|
/* Instance methods. */
|
|
12
11
|
|
|
13
12
|
Consumer::Consumer(
|
|
14
|
-
|
|
13
|
+
SharedInterface* shared,
|
|
15
14
|
const std::string& id,
|
|
16
15
|
const std::string& producerId,
|
|
17
16
|
Listener* listener,
|
|
@@ -445,7 +444,8 @@ namespace RTC
|
|
|
445
444
|
UserOnPaused();
|
|
446
445
|
}
|
|
447
446
|
|
|
448
|
-
this->shared->
|
|
447
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
448
|
+
this->id, FBS::Notification::Event::CONSUMER_PRODUCER_PAUSE);
|
|
449
449
|
}
|
|
450
450
|
|
|
451
451
|
void Consumer::ProducerResumed()
|
|
@@ -466,7 +466,8 @@ namespace RTC
|
|
|
466
466
|
UserOnResumed();
|
|
467
467
|
}
|
|
468
468
|
|
|
469
|
-
this->shared->
|
|
469
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
470
|
+
this->id, FBS::Notification::Event::CONSUMER_PRODUCER_RESUME);
|
|
470
471
|
}
|
|
471
472
|
|
|
472
473
|
void Consumer::ProducerRtpStreamScores(const std::vector<uint8_t>* scores)
|
|
@@ -487,7 +488,8 @@ namespace RTC
|
|
|
487
488
|
|
|
488
489
|
MS_DEBUG_DEV("Producer closed [consumerId:%s]", this->id.c_str());
|
|
489
490
|
|
|
490
|
-
this->shared->
|
|
491
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
492
|
+
this->id, FBS::Notification::Event::CONSUMER_PRODUCER_CLOSE);
|
|
491
493
|
|
|
492
494
|
this->listener->OnConsumerProducerClosed(this);
|
|
493
495
|
}
|
|
@@ -498,14 +500,14 @@ namespace RTC
|
|
|
498
500
|
|
|
499
501
|
if (this->traceEventTypes.keyframe && packet->IsKeyFrame())
|
|
500
502
|
{
|
|
501
|
-
auto rtpPacketDump = packet->FillBuffer(this->shared->
|
|
502
|
-
auto traceInfo
|
|
503
|
-
this->shared->
|
|
503
|
+
auto rtpPacketDump = packet->FillBuffer(this->shared->GetChannelNotifier()->GetBufferBuilder());
|
|
504
|
+
auto traceInfo = FBS::Consumer::CreateKeyFrameTraceInfo(
|
|
505
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(), rtpPacketDump, isRtx);
|
|
504
506
|
|
|
505
507
|
auto notification = FBS::Consumer::CreateTraceNotification(
|
|
506
|
-
this->shared->
|
|
508
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(),
|
|
507
509
|
FBS::Consumer::TraceEventType::KEYFRAME,
|
|
508
|
-
|
|
510
|
+
this->shared->GetTimeMs(),
|
|
509
511
|
FBS::Common::TraceDirection::DIRECTION_OUT,
|
|
510
512
|
FBS::Consumer::TraceInfo::KeyFrameTraceInfo,
|
|
511
513
|
traceInfo.Union());
|
|
@@ -514,14 +516,14 @@ namespace RTC
|
|
|
514
516
|
}
|
|
515
517
|
else if (this->traceEventTypes.rtp)
|
|
516
518
|
{
|
|
517
|
-
auto rtpPacketDump = packet->FillBuffer(this->shared->
|
|
518
|
-
auto traceInfo
|
|
519
|
-
this->shared->
|
|
519
|
+
auto rtpPacketDump = packet->FillBuffer(this->shared->GetChannelNotifier()->GetBufferBuilder());
|
|
520
|
+
auto traceInfo = FBS::Consumer::CreateRtpTraceInfo(
|
|
521
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(), rtpPacketDump, isRtx);
|
|
520
522
|
|
|
521
523
|
auto notification = FBS::Consumer::CreateTraceNotification(
|
|
522
|
-
this->shared->
|
|
524
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(),
|
|
523
525
|
FBS::Consumer::TraceEventType::RTP,
|
|
524
|
-
|
|
526
|
+
this->shared->GetTimeMs(),
|
|
525
527
|
FBS::Common::TraceDirection::DIRECTION_OUT,
|
|
526
528
|
FBS::Consumer::TraceInfo::RtpTraceInfo,
|
|
527
529
|
traceInfo.Union());
|
|
@@ -539,13 +541,13 @@ namespace RTC
|
|
|
539
541
|
return;
|
|
540
542
|
}
|
|
541
543
|
|
|
542
|
-
auto traceInfo =
|
|
543
|
-
|
|
544
|
+
auto traceInfo = FBS::Consumer::CreatePliTraceInfo(
|
|
545
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(), ssrc);
|
|
544
546
|
|
|
545
547
|
auto notification = FBS::Consumer::CreateTraceNotification(
|
|
546
|
-
this->shared->
|
|
548
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(),
|
|
547
549
|
FBS::Consumer::TraceEventType::PLI,
|
|
548
|
-
|
|
550
|
+
this->shared->GetTimeMs(),
|
|
549
551
|
FBS::Common::TraceDirection::DIRECTION_IN,
|
|
550
552
|
FBS::Consumer::TraceInfo::PliTraceInfo,
|
|
551
553
|
traceInfo.Union());
|
|
@@ -562,13 +564,13 @@ namespace RTC
|
|
|
562
564
|
return;
|
|
563
565
|
}
|
|
564
566
|
|
|
565
|
-
auto traceInfo =
|
|
566
|
-
|
|
567
|
+
auto traceInfo = FBS::Consumer::CreateFirTraceInfo(
|
|
568
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(), ssrc);
|
|
567
569
|
|
|
568
570
|
auto notification = FBS::Consumer::CreateTraceNotification(
|
|
569
|
-
this->shared->
|
|
571
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(),
|
|
570
572
|
FBS::Consumer::TraceEventType::FIR,
|
|
571
|
-
|
|
573
|
+
this->shared->GetTimeMs(),
|
|
572
574
|
FBS::Common::TraceDirection::DIRECTION_IN,
|
|
573
575
|
FBS::Consumer::TraceInfo::FirTraceInfo,
|
|
574
576
|
traceInfo.Union());
|
|
@@ -586,9 +588,9 @@ namespace RTC
|
|
|
586
588
|
}
|
|
587
589
|
|
|
588
590
|
auto notification = FBS::Consumer::CreateTraceNotification(
|
|
589
|
-
this->shared->
|
|
591
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(),
|
|
590
592
|
FBS::Consumer::TraceEventType::NACK,
|
|
591
|
-
|
|
593
|
+
this->shared->GetTimeMs(),
|
|
592
594
|
FBS::Common::TraceDirection::DIRECTION_IN);
|
|
593
595
|
|
|
594
596
|
EmitTraceEvent(notification);
|
|
@@ -598,7 +600,7 @@ namespace RTC
|
|
|
598
600
|
{
|
|
599
601
|
MS_TRACE();
|
|
600
602
|
|
|
601
|
-
this->shared->
|
|
603
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
602
604
|
this->id,
|
|
603
605
|
FBS::Notification::Event::CONSUMER_TRACE,
|
|
604
606
|
FBS::Notification::Body::Consumer_TraceNotification,
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// #define MS_LOG_DEV_LEVEL 3
|
|
3
3
|
|
|
4
4
|
#include "RTC/DataConsumer.hpp"
|
|
5
|
-
#include "DepLibUV.hpp"
|
|
6
5
|
#include "Logger.hpp"
|
|
7
6
|
#include "MediaSoupErrors.hpp"
|
|
8
7
|
|
|
@@ -11,7 +10,7 @@ namespace RTC
|
|
|
11
10
|
/* Instance methods. */
|
|
12
11
|
|
|
13
12
|
DataConsumer::DataConsumer(
|
|
14
|
-
|
|
13
|
+
SharedInterface* shared,
|
|
15
14
|
const std::string& id,
|
|
16
15
|
const std::string& dataProducerId,
|
|
17
16
|
RTC::DataConsumer::Listener* listener,
|
|
@@ -27,13 +26,13 @@ namespace RTC
|
|
|
27
26
|
|
|
28
27
|
switch (data->type())
|
|
29
28
|
{
|
|
30
|
-
case FBS::
|
|
29
|
+
case FBS::DataConsumer::Type::SCTP:
|
|
31
30
|
{
|
|
32
31
|
this->type = DataConsumer::Type::SCTP;
|
|
33
32
|
|
|
34
33
|
break;
|
|
35
34
|
}
|
|
36
|
-
case FBS::
|
|
35
|
+
case FBS::DataConsumer::Type::DIRECT:
|
|
37
36
|
{
|
|
38
37
|
this->type = DataConsumer::Type::DIRECT;
|
|
39
38
|
|
|
@@ -75,7 +74,7 @@ namespace RTC
|
|
|
75
74
|
}
|
|
76
75
|
|
|
77
76
|
// NOTE: This may throw.
|
|
78
|
-
this->shared->
|
|
77
|
+
this->shared->GetChannelMessageRegistrator()->RegisterHandler(
|
|
79
78
|
this->id,
|
|
80
79
|
/*channelRequestHandler*/ this,
|
|
81
80
|
/*channelNotificationHandler*/ nullptr);
|
|
@@ -85,7 +84,7 @@ namespace RTC
|
|
|
85
84
|
{
|
|
86
85
|
MS_TRACE();
|
|
87
86
|
|
|
88
|
-
this->shared->
|
|
87
|
+
this->shared->GetChannelMessageRegistrator()->UnregisterHandler(this->id);
|
|
89
88
|
}
|
|
90
89
|
|
|
91
90
|
flatbuffers::Offset<FBS::DataConsumer::DumpResponse> DataConsumer::FillBuffer(
|
|
@@ -110,16 +109,28 @@ namespace RTC
|
|
|
110
109
|
subchannels.emplace_back(subchannel);
|
|
111
110
|
}
|
|
112
111
|
|
|
112
|
+
uint32_t bufferedAmount{ 0 };
|
|
113
|
+
|
|
114
|
+
this->listener->OnDataConsumerNeedBufferedAmount(this, bufferedAmount);
|
|
115
|
+
|
|
116
|
+
uint32_t bufferedAmountLowThreshold{ 0 };
|
|
117
|
+
|
|
118
|
+
if (this->type == DataConsumer::Type::SCTP)
|
|
119
|
+
{
|
|
120
|
+
this->listener->OnDataConsumerNeedBufferedAmountLowThreshold(this, bufferedAmountLowThreshold);
|
|
121
|
+
}
|
|
122
|
+
|
|
113
123
|
return FBS::DataConsumer::CreateDumpResponseDirect(
|
|
114
124
|
builder,
|
|
115
125
|
this->id.c_str(),
|
|
116
126
|
this->dataProducerId.c_str(),
|
|
117
|
-
this->type == DataConsumer::Type::SCTP ? FBS::
|
|
118
|
-
: FBS::
|
|
127
|
+
this->type == DataConsumer::Type::SCTP ? FBS::DataConsumer::Type::SCTP
|
|
128
|
+
: FBS::DataConsumer::Type::DIRECT,
|
|
119
129
|
sctpStreamParameters,
|
|
120
130
|
this->label.c_str(),
|
|
121
131
|
this->protocol.c_str(),
|
|
122
|
-
|
|
132
|
+
bufferedAmount,
|
|
133
|
+
bufferedAmountLowThreshold,
|
|
123
134
|
this->paused,
|
|
124
135
|
this->dataProducerPaused,
|
|
125
136
|
std::addressof(subchannels));
|
|
@@ -130,10 +141,14 @@ namespace RTC
|
|
|
130
141
|
{
|
|
131
142
|
MS_TRACE();
|
|
132
143
|
|
|
144
|
+
uint32_t bufferedAmount{ 0 };
|
|
145
|
+
|
|
146
|
+
this->listener->OnDataConsumerNeedBufferedAmount(this, bufferedAmount);
|
|
147
|
+
|
|
133
148
|
return FBS::DataConsumer::CreateGetStatsResponseDirect(
|
|
134
149
|
builder,
|
|
135
150
|
// timestamp.
|
|
136
|
-
|
|
151
|
+
this->shared->GetTimeMs(),
|
|
137
152
|
// label.
|
|
138
153
|
this->label.c_str(),
|
|
139
154
|
// protocol.
|
|
@@ -143,7 +158,7 @@ namespace RTC
|
|
|
143
158
|
// bytesSent.
|
|
144
159
|
this->bytesSent,
|
|
145
160
|
// bufferedAmount.
|
|
146
|
-
|
|
161
|
+
bufferedAmount);
|
|
147
162
|
}
|
|
148
163
|
|
|
149
164
|
void DataConsumer::HandleRequest(Channel::ChannelRequest* request)
|
|
@@ -234,32 +249,12 @@ namespace RTC
|
|
|
234
249
|
|
|
235
250
|
const auto* body =
|
|
236
251
|
request->data->body_as<FBS::DataConsumer::SetBufferedAmountLowThresholdRequest>();
|
|
252
|
+
const auto bufferedAmountLowThreshold = static_cast<size_t>(body->threshold());
|
|
237
253
|
|
|
238
|
-
this->
|
|
254
|
+
this->listener->OnDataConsumerSetBufferedAmountLowThreshold(this, bufferedAmountLowThreshold);
|
|
239
255
|
|
|
240
256
|
request->Accept();
|
|
241
257
|
|
|
242
|
-
// There is less or same buffered data than the given threshold.
|
|
243
|
-
// Trigger 'bufferedamountlow' now.
|
|
244
|
-
if (this->bufferedAmount <= this->bufferedAmountLowThreshold)
|
|
245
|
-
{
|
|
246
|
-
// Notify the Node DataConsumer.
|
|
247
|
-
auto bufferedAmountLowOffset = FBS::DataConsumer::CreateBufferedAmountLowNotification(
|
|
248
|
-
this->shared->channelNotifier->GetBufferBuilder(), this->bufferedAmount);
|
|
249
|
-
|
|
250
|
-
this->shared->channelNotifier->Emit(
|
|
251
|
-
this->id,
|
|
252
|
-
FBS::Notification::Event::DATACONSUMER_BUFFERED_AMOUNT_LOW,
|
|
253
|
-
FBS::Notification::Body::DataConsumer_BufferedAmountLowNotification,
|
|
254
|
-
bufferedAmountLowOffset);
|
|
255
|
-
}
|
|
256
|
-
// Force the trigger of 'bufferedamountlow' once there is less or same
|
|
257
|
-
// buffered data than the given threshold.
|
|
258
|
-
else
|
|
259
|
-
{
|
|
260
|
-
this->forceTriggerBufferedAmountLow = true;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
258
|
break;
|
|
264
259
|
}
|
|
265
260
|
|
|
@@ -295,9 +290,16 @@ namespace RTC
|
|
|
295
290
|
}
|
|
296
291
|
});
|
|
297
292
|
|
|
298
|
-
static std::vector<uint16_t> emptySubchannels;
|
|
293
|
+
static thread_local std::vector<uint16_t> emptySubchannels;
|
|
294
|
+
|
|
295
|
+
const uint16_t streamId =
|
|
296
|
+
this->type == DataConsumer::Type::SCTP ? this->sctpStreamParameters.streamId : 0;
|
|
299
297
|
|
|
300
|
-
|
|
298
|
+
// NOTE: We are creating a copy of the data here, otherwise we cannot
|
|
299
|
+
// move the Message and pass its ownership to the SCTP stack.
|
|
300
|
+
RTC::SCTP::Message message(streamId, body->ppid(), std::vector<uint8_t>(data, data + len));
|
|
301
|
+
|
|
302
|
+
SendMessage(std::move(message), emptySubchannels, std::nullopt, cb);
|
|
301
303
|
|
|
302
304
|
break;
|
|
303
305
|
}
|
|
@@ -415,9 +417,9 @@ namespace RTC
|
|
|
415
417
|
|
|
416
418
|
this->dataProducerPaused = true;
|
|
417
419
|
|
|
418
|
-
MS_DEBUG_DEV("
|
|
420
|
+
MS_DEBUG_DEV("DataConsumer paused [dataConsumerId:%s]", this->id.c_str());
|
|
419
421
|
|
|
420
|
-
this->shared->
|
|
422
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
421
423
|
this->id, FBS::Notification::Event::DATACONSUMER_DATAPRODUCER_PAUSE);
|
|
422
424
|
}
|
|
423
425
|
|
|
@@ -432,9 +434,9 @@ namespace RTC
|
|
|
432
434
|
|
|
433
435
|
this->dataProducerPaused = false;
|
|
434
436
|
|
|
435
|
-
MS_DEBUG_DEV("
|
|
437
|
+
MS_DEBUG_DEV("DataConsumer resumed [dataConsumerId:%s]", this->id.c_str());
|
|
436
438
|
|
|
437
|
-
this->shared->
|
|
439
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
438
440
|
this->id, FBS::Notification::Event::DATACONSUMER_DATAPRODUCER_RESUME);
|
|
439
441
|
}
|
|
440
442
|
|
|
@@ -456,38 +458,26 @@ namespace RTC
|
|
|
456
458
|
MS_DEBUG_DEV("SctpAssociation closed [dataConsumerId:%s]", this->id.c_str());
|
|
457
459
|
}
|
|
458
460
|
|
|
459
|
-
void DataConsumer::
|
|
461
|
+
void DataConsumer::SctpBufferedAmountLow(uint32_t bufferedAmount) const
|
|
460
462
|
{
|
|
461
463
|
MS_TRACE();
|
|
462
464
|
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
if (
|
|
468
|
-
(this->forceTriggerBufferedAmountLow ||
|
|
469
|
-
previousBufferedAmount > this->bufferedAmountLowThreshold) &&
|
|
470
|
-
this->bufferedAmount <= this->bufferedAmountLowThreshold)
|
|
471
|
-
{
|
|
472
|
-
this->forceTriggerBufferedAmountLow = false;
|
|
473
|
-
|
|
474
|
-
// Notify the Node DataConsumer.
|
|
475
|
-
auto bufferedAmountLowOffset = FBS::DataConsumer::CreateBufferedAmountLowNotification(
|
|
476
|
-
this->shared->channelNotifier->GetBufferBuilder(), this->bufferedAmount);
|
|
465
|
+
// Notify the Node DataConsumer.
|
|
466
|
+
auto bufferedAmountLowOffset = FBS::DataConsumer::CreateBufferedAmountLowNotification(
|
|
467
|
+
this->shared->GetChannelNotifier()->GetBufferBuilder(), bufferedAmount);
|
|
477
468
|
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
}
|
|
469
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
470
|
+
this->id,
|
|
471
|
+
FBS::Notification::Event::DATACONSUMER_BUFFERED_AMOUNT_LOW,
|
|
472
|
+
FBS::Notification::Body::DataConsumer_BufferedAmountLowNotification,
|
|
473
|
+
bufferedAmountLowOffset);
|
|
484
474
|
}
|
|
485
475
|
|
|
486
|
-
void DataConsumer::
|
|
476
|
+
void DataConsumer::SctpSendBufferFull() const
|
|
487
477
|
{
|
|
488
478
|
MS_TRACE();
|
|
489
479
|
|
|
490
|
-
this->shared->
|
|
480
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
491
481
|
this->id, FBS::Notification::Event::DATACONSUMER_SCTP_SENDBUFFER_FULL);
|
|
492
482
|
}
|
|
493
483
|
|
|
@@ -499,18 +489,16 @@ namespace RTC
|
|
|
499
489
|
|
|
500
490
|
this->dataProducerClosed = true;
|
|
501
491
|
|
|
502
|
-
MS_DEBUG_DEV("
|
|
492
|
+
MS_DEBUG_DEV("DataConsumer closed [dataConsumerId:%s]", this->id.c_str());
|
|
503
493
|
|
|
504
|
-
this->shared->
|
|
494
|
+
this->shared->GetChannelNotifier()->Emit(
|
|
505
495
|
this->id, FBS::Notification::Event::DATACONSUMER_DATAPRODUCER_CLOSE);
|
|
506
496
|
|
|
507
497
|
this->listener->OnDataConsumerDataProducerClosed(this);
|
|
508
498
|
}
|
|
509
499
|
|
|
510
500
|
bool DataConsumer::SendMessage(
|
|
511
|
-
|
|
512
|
-
size_t len,
|
|
513
|
-
uint32_t ppid,
|
|
501
|
+
RTC::SCTP::Message message,
|
|
514
502
|
std::vector<uint16_t>& subchannels,
|
|
515
503
|
std::optional<uint16_t> requiredSubchannel,
|
|
516
504
|
const onQueuedCallback* cb)
|
|
@@ -571,12 +559,14 @@ namespace RTC
|
|
|
571
559
|
}
|
|
572
560
|
}
|
|
573
561
|
|
|
574
|
-
|
|
562
|
+
const size_t messageLen = message.GetPayloadLength();
|
|
563
|
+
|
|
564
|
+
if (messageLen > this->maxMessageSize)
|
|
575
565
|
{
|
|
576
566
|
MS_WARN_TAG(
|
|
577
567
|
message,
|
|
578
568
|
"given message exceeds maxMessageSize value [maxMessageSize:%zu, len:%zu]",
|
|
579
|
-
|
|
569
|
+
messageLen,
|
|
580
570
|
this->maxMessageSize);
|
|
581
571
|
|
|
582
572
|
if (cb)
|
|
@@ -589,9 +579,9 @@ namespace RTC
|
|
|
589
579
|
}
|
|
590
580
|
|
|
591
581
|
this->messagesSent++;
|
|
592
|
-
this->bytesSent +=
|
|
582
|
+
this->bytesSent += messageLen;
|
|
593
583
|
|
|
594
|
-
this->listener->OnDataConsumerSendMessage(this,
|
|
584
|
+
this->listener->OnDataConsumerSendMessage(this, std::move(message), cb);
|
|
595
585
|
|
|
596
586
|
return true;
|
|
597
587
|
}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// #define MS_LOG_DEV_LEVEL 3
|
|
3
3
|
|
|
4
4
|
#include "RTC/DataProducer.hpp"
|
|
5
|
-
#include "DepLibUV.hpp"
|
|
6
5
|
#include "Logger.hpp"
|
|
7
6
|
#include "MediaSoupErrors.hpp"
|
|
7
|
+
#include "Settings.hpp"
|
|
8
8
|
#include <vector>
|
|
9
9
|
|
|
10
10
|
namespace RTC
|
|
@@ -12,7 +12,7 @@ namespace RTC
|
|
|
12
12
|
/* Instance methods. */
|
|
13
13
|
|
|
14
14
|
DataProducer::DataProducer(
|
|
15
|
-
|
|
15
|
+
SharedInterface* shared,
|
|
16
16
|
const std::string& id,
|
|
17
17
|
size_t maxMessageSize,
|
|
18
18
|
RTC::DataProducer::Listener* listener,
|
|
@@ -63,7 +63,7 @@ namespace RTC
|
|
|
63
63
|
this->paused = data->paused();
|
|
64
64
|
|
|
65
65
|
// NOTE: This may throw.
|
|
66
|
-
this->shared->
|
|
66
|
+
this->shared->GetChannelMessageRegistrator()->RegisterHandler(
|
|
67
67
|
this->id,
|
|
68
68
|
/*channelRequestHandler*/ this,
|
|
69
69
|
/*channelNotificationHandler*/ this);
|
|
@@ -73,7 +73,7 @@ namespace RTC
|
|
|
73
73
|
{
|
|
74
74
|
MS_TRACE();
|
|
75
75
|
|
|
76
|
-
this->shared->
|
|
76
|
+
this->shared->GetChannelMessageRegistrator()->UnregisterHandler(this->id);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
flatbuffers::Offset<FBS::DataProducer::DumpResponse> DataProducer::FillBuffer(
|
|
@@ -108,7 +108,7 @@ namespace RTC
|
|
|
108
108
|
return FBS::DataProducer::CreateGetStatsResponseDirect(
|
|
109
109
|
builder,
|
|
110
110
|
// timestamp.
|
|
111
|
-
|
|
111
|
+
this->shared->GetTimeMs(),
|
|
112
112
|
// label.
|
|
113
113
|
this->label.c_str(),
|
|
114
114
|
// protocol.
|
|
@@ -229,7 +229,14 @@ namespace RTC
|
|
|
229
229
|
requiredSubchannel = body->requiredSubchannel();
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
|
|
232
|
+
const uint16_t streamId =
|
|
233
|
+
this->type == DataProducer::Type::SCTP ? this->sctpStreamParameters.streamId : 0;
|
|
234
|
+
|
|
235
|
+
// NOTE: We are creating a copy of the data here, otherwise we cannot
|
|
236
|
+
// move the Message and pass its ownership to the SCTP stack.
|
|
237
|
+
RTC::SCTP::Message message(streamId, body->ppid(), std::vector<uint8_t>(data, data + len));
|
|
238
|
+
|
|
239
|
+
ReceiveMessage(std::move(message), subchannels, requiredSubchannel);
|
|
233
240
|
|
|
234
241
|
// Increase receive transmission.
|
|
235
242
|
this->listener->OnDataProducerReceiveData(this, len);
|
|
@@ -245,16 +252,14 @@ namespace RTC
|
|
|
245
252
|
}
|
|
246
253
|
|
|
247
254
|
void DataProducer::ReceiveMessage(
|
|
248
|
-
|
|
249
|
-
size_t len,
|
|
250
|
-
uint32_t ppid,
|
|
255
|
+
RTC::SCTP::Message message,
|
|
251
256
|
std::vector<uint16_t>& subchannels,
|
|
252
257
|
std::optional<uint16_t> requiredSubchannel)
|
|
253
258
|
{
|
|
254
259
|
MS_TRACE();
|
|
255
260
|
|
|
256
261
|
this->messagesReceived++;
|
|
257
|
-
this->bytesReceived +=
|
|
262
|
+
this->bytesReceived += message.GetPayloadLength();
|
|
258
263
|
|
|
259
264
|
// If paused stop here.
|
|
260
265
|
if (this->paused)
|
|
@@ -263,6 +268,6 @@ namespace RTC
|
|
|
263
268
|
}
|
|
264
269
|
|
|
265
270
|
this->listener->OnDataProducerMessageReceived(
|
|
266
|
-
this,
|
|
271
|
+
this, std::move(message), subchannels, requiredSubchannel);
|
|
267
272
|
}
|
|
268
273
|
} // namespace RTC
|