werift 0.26.0 → 0.27.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/README.md +63 -0
- package/THIRD_PARTY_LICENSES_LIBWEBRTC.txt +58 -0
- package/lib/common/src/binary.d.ts +1 -3
- package/lib/common/src/binary.js +8 -6
- package/lib/common/src/binary.js.map +1 -1
- package/lib/common/src/binaryData.js +2 -1
- package/lib/common/src/binaryData.js.map +1 -1
- package/lib/common/src/log.js +5 -7
- package/lib/common/src/log.js.map +1 -1
- package/lib/common/src/transport.js +10 -5
- package/lib/common/src/transport.js.map +1 -1
- package/lib/dtls/src/context/cipher.d.ts +1 -1
- package/lib/dtls/src/context/cipher.js +6 -3
- package/lib/dtls/src/context/cipher.js.map +1 -1
- package/lib/dtls/src/context/dtls.js +4 -2
- package/lib/dtls/src/context/dtls.js.map +1 -1
- package/lib/dtls/src/context/transport.js +2 -1
- package/lib/dtls/src/context/transport.js.map +1 -1
- package/lib/dtls/src/flight/client/flight1.js +2 -1
- package/lib/dtls/src/flight/client/flight1.js.map +1 -1
- package/lib/dtls/src/flight/client/flight5.js +4 -2
- package/lib/dtls/src/flight/client/flight5.js.map +1 -1
- package/lib/dtls/src/flight/flight.d.ts +1 -1
- package/lib/dtls/src/flight/flight.js +8 -4
- package/lib/dtls/src/flight/flight.js.map +1 -1
- package/lib/dtls/src/flight/server/flight4.js +4 -2
- package/lib/dtls/src/flight/server/flight4.js.map +1 -1
- package/lib/dtls/src/flight/server/flight6.js +2 -1
- package/lib/dtls/src/flight/server/flight6.js.map +1 -1
- package/lib/dtls/src/handshake/const.d.ts +17 -13
- package/lib/dtls/src/handshake/const.js +16 -14
- package/lib/dtls/src/handshake/const.js.map +1 -1
- package/lib/dtls/src/handshake/message/alert.js +4 -2
- package/lib/dtls/src/handshake/message/alert.js.map +1 -1
- package/lib/dtls/src/handshake/message/certificate.js +2 -1
- package/lib/dtls/src/handshake/message/certificate.js.map +1 -1
- package/lib/dtls/src/handshake/message/changeCipherSpec.js +2 -1
- package/lib/dtls/src/handshake/message/changeCipherSpec.js.map +1 -1
- package/lib/dtls/src/handshake/message/client/certificateVerify.js +4 -2
- package/lib/dtls/src/handshake/message/client/certificateVerify.js.map +1 -1
- package/lib/dtls/src/handshake/message/client/hello.js +14 -7
- package/lib/dtls/src/handshake/message/client/hello.js.map +1 -1
- package/lib/dtls/src/handshake/message/client/keyExchange.js +2 -1
- package/lib/dtls/src/handshake/message/client/keyExchange.js.map +1 -1
- package/lib/dtls/src/handshake/message/finished.js +2 -1
- package/lib/dtls/src/handshake/message/finished.js.map +1 -1
- package/lib/dtls/src/handshake/message/server/certificateRequest.js +6 -3
- package/lib/dtls/src/handshake/message/server/certificateRequest.js.map +1 -1
- package/lib/dtls/src/handshake/message/server/hello.js +12 -6
- package/lib/dtls/src/handshake/message/server/hello.js.map +1 -1
- package/lib/dtls/src/handshake/message/server/helloDone.js.map +1 -1
- package/lib/dtls/src/handshake/message/server/helloVerifyRequest.js +4 -2
- package/lib/dtls/src/handshake/message/server/helloVerifyRequest.js.map +1 -1
- package/lib/dtls/src/handshake/message/server/keyExchange.js +16 -8
- package/lib/dtls/src/handshake/message/server/keyExchange.js.map +1 -1
- package/lib/dtls/src/handshake/random.d.ts +2 -2
- package/lib/dtls/src/handshake/random.js +5 -2
- package/lib/dtls/src/handshake/random.js.map +1 -1
- package/lib/dtls/src/record/const.d.ts +43 -33
- package/lib/dtls/src/record/const.js +43 -36
- package/lib/dtls/src/record/const.js.map +1 -1
- package/lib/dtls/src/record/message/fragment.js +12 -6
- package/lib/dtls/src/record/message/fragment.js.map +1 -1
- package/lib/dtls/src/record/message/header.js +10 -5
- package/lib/dtls/src/record/message/header.js.map +1 -1
- package/lib/dtls/src/record/message/plaintext.js +4 -2
- package/lib/dtls/src/record/message/plaintext.js.map +1 -1
- package/lib/dtls/src/record/receive.js +2 -2
- package/lib/dtls/src/record/receive.js.map +1 -1
- package/lib/dtls/src/socket.js +4 -2
- package/lib/dtls/src/socket.js.map +1 -1
- package/lib/ice/src/candidate.d.ts +1 -1
- package/lib/ice/src/candidate.js +24 -12
- package/lib/ice/src/candidate.js.map +1 -1
- package/lib/ice/src/dns/lookup.d.ts +10 -1
- package/lib/ice/src/dns/lookup.js +42 -7
- package/lib/ice/src/dns/lookup.js.map +1 -1
- package/lib/ice/src/exceptions.d.ts +21 -5
- package/lib/ice/src/exceptions.js +58 -13
- package/lib/ice/src/exceptions.js.map +1 -1
- package/lib/ice/src/ice.d.ts +52 -8
- package/lib/ice/src/ice.js +288 -152
- package/lib/ice/src/ice.js.map +1 -1
- package/lib/ice/src/iceBase.d.ts +126 -11
- package/lib/ice/src/iceBase.js +165 -12
- package/lib/ice/src/iceBase.js.map +1 -1
- package/lib/ice/src/stun/transaction.d.ts +30 -1
- package/lib/ice/src/stun/transaction.js +86 -17
- package/lib/ice/src/stun/transaction.js.map +1 -1
- package/lib/ice/src/turn/credential.d.ts +49 -0
- package/lib/ice/src/turn/credential.js +78 -0
- package/lib/ice/src/turn/credential.js.map +1 -0
- package/lib/ice/src/turn/protocol.d.ts +29 -8
- package/lib/ice/src/turn/protocol.js +121 -48
- package/lib/ice/src/turn/protocol.js.map +1 -1
- package/lib/ice-server/src/stun/attributes.d.ts +2 -0
- package/lib/ice-server/src/stun/attributes.js +7 -1
- package/lib/ice-server/src/stun/attributes.js.map +1 -1
- package/lib/ice-server/src/stun/const.d.ts +24 -16
- package/lib/ice-server/src/stun/const.js +22 -18
- package/lib/ice-server/src/stun/const.js.map +1 -1
- package/lib/ice-server/src/stun/message.d.ts +1 -3
- package/lib/ice-server/src/stun/message.js +13 -9
- package/lib/ice-server/src/stun/message.js.map +1 -1
- package/lib/index.mjs +9770 -2648
- package/lib/nonstandard/index.mjs +2428 -1052
- package/lib/polyfill/dom.mjs +8738 -1815
- package/lib/polyfill/index.mjs +8738 -1815
- package/lib/rtp/src/codec/assertPayload.d.ts +4 -0
- package/lib/rtp/src/codec/assertPayload.js +12 -0
- package/lib/rtp/src/codec/assertPayload.js.map +1 -0
- package/lib/rtp/src/codec/av1.js +2 -0
- package/lib/rtp/src/codec/av1.js.map +1 -1
- package/lib/rtp/src/codec/h264.js +35 -43
- package/lib/rtp/src/codec/h264.js.map +1 -1
- package/lib/rtp/src/codec/vp8.js +11 -5
- package/lib/rtp/src/codec/vp8.js.map +1 -1
- package/lib/rtp/src/codec/vp9.js +12 -0
- package/lib/rtp/src/codec/vp9.js.map +1 -1
- package/lib/rtp/src/extra/container/mp4/container.js +2 -1
- package/lib/rtp/src/extra/container/mp4/container.js.map +1 -1
- package/lib/rtp/src/extra/container/mp4/exp-golomb.js +2 -1
- package/lib/rtp/src/extra/container/mp4/exp-golomb.js.map +1 -1
- package/lib/rtp/src/extra/container/mp4/h264.d.ts +21 -17
- package/lib/rtp/src/extra/container/mp4/h264.js +26 -24
- package/lib/rtp/src/extra/container/mp4/h264.js.map +1 -1
- package/lib/rtp/src/extra/container/ogg/index.d.ts +1 -0
- package/lib/rtp/src/extra/container/ogg/index.js +1 -0
- package/lib/rtp/src/extra/container/ogg/index.js.map +1 -1
- package/lib/rtp/src/extra/container/ogg/writer.d.ts +90 -0
- package/lib/rtp/src/extra/container/ogg/writer.js +300 -0
- package/lib/rtp/src/extra/container/ogg/writer.js.map +1 -0
- package/lib/rtp/src/extra/container/webm/ebml/ebml.js +6 -3
- package/lib/rtp/src/extra/container/webm/ebml/ebml.js.map +1 -1
- package/lib/rtp/src/extra/processor/depacketizer.d.ts +5 -0
- package/lib/rtp/src/extra/processor/depacketizer.js +28 -2
- package/lib/rtp/src/extra/processor/depacketizer.js.map +1 -1
- package/lib/rtp/src/extra/processor/dtx.js +4 -2
- package/lib/rtp/src/extra/processor/dtx.js.map +1 -1
- package/lib/rtp/src/extra/processor/index.d.ts +2 -0
- package/lib/rtp/src/extra/processor/index.js +2 -0
- package/lib/rtp/src/extra/processor/index.js.map +1 -1
- package/lib/rtp/src/extra/processor/jitterBuffer.d.ts +29 -6
- package/lib/rtp/src/extra/processor/jitterBuffer.js +101 -111
- package/lib/rtp/src/extra/processor/jitterBuffer.js.map +1 -1
- package/lib/rtp/src/extra/processor/jitterBufferTransformer.js +2 -1
- package/lib/rtp/src/extra/processor/jitterBufferTransformer.js.map +1 -1
- package/lib/rtp/src/extra/processor/lipsync.d.ts +63 -0
- package/lib/rtp/src/extra/processor/lipsync.js +202 -51
- package/lib/rtp/src/extra/processor/lipsync.js.map +1 -1
- package/lib/rtp/src/extra/processor/mp4.d.ts +0 -6
- package/lib/rtp/src/extra/processor/mp4.js +6 -3
- package/lib/rtp/src/extra/processor/mp4.js.map +1 -1
- package/lib/rtp/src/extra/processor/mute.js +4 -2
- package/lib/rtp/src/extra/processor/mute.js.map +1 -1
- package/lib/rtp/src/extra/processor/nack.js +4 -2
- package/lib/rtp/src/extra/processor/nack.js.map +1 -1
- package/lib/rtp/src/extra/processor/ntpTime.js +4 -6
- package/lib/rtp/src/extra/processor/ntpTime.js.map +1 -1
- package/lib/rtp/src/extra/processor/ogg.d.ts +72 -0
- package/lib/rtp/src/extra/processor/ogg.js +221 -0
- package/lib/rtp/src/extra/processor/ogg.js.map +1 -0
- package/lib/rtp/src/extra/processor/oggCallback.d.ts +21 -0
- package/lib/rtp/src/extra/processor/oggCallback.js +97 -0
- package/lib/rtp/src/extra/processor/oggCallback.js.map +1 -0
- package/lib/rtp/src/extra/processor/rtpCallback.js +2 -1
- package/lib/rtp/src/extra/processor/rtpCallback.js.map +1 -1
- package/lib/rtp/src/extra/processor/rtpStream.js +2 -1
- package/lib/rtp/src/extra/processor/rtpStream.js.map +1 -1
- package/lib/rtp/src/extra/processor/rtpTime.js +2 -1
- package/lib/rtp/src/extra/processor/rtpTime.js.map +1 -1
- package/lib/rtp/src/extra/processor/webm.js +14 -7
- package/lib/rtp/src/extra/processor/webm.js.map +1 -1
- package/lib/rtp/src/extra/processor/webmCallback.js.map +1 -1
- package/lib/rtp/src/index.d.ts +7 -0
- package/lib/rtp/src/index.js +7 -0
- package/lib/rtp/src/index.js.map +1 -1
- package/lib/rtp/src/rtcp/psfb/fullIntraRequest.d.ts +4 -0
- package/lib/rtp/src/rtcp/psfb/fullIntraRequest.js +4 -0
- package/lib/rtp/src/rtcp/psfb/fullIntraRequest.js.map +1 -1
- package/lib/rtp/src/rtcp/rtcp.js +8 -4
- package/lib/rtp/src/rtcp/rtcp.js.map +1 -1
- package/lib/rtp/src/rtcp/rtpfb/transportWideSequence.d.ts +58 -0
- package/lib/rtp/src/rtcp/rtpfb/transportWideSequence.js +143 -0
- package/lib/rtp/src/rtcp/rtpfb/transportWideSequence.js.map +1 -0
- package/lib/rtp/src/rtcp/rtpfb/twcc.d.ts +35 -13
- package/lib/rtp/src/rtcp/rtpfb/twcc.js +132 -54
- package/lib/rtp/src/rtcp/rtpfb/twcc.js.map +1 -1
- package/lib/rtp/src/rtcp/rtpfb/twccReceiveTiming.d.ts +13 -0
- package/lib/rtp/src/rtcp/rtpfb/twccReceiveTiming.js +29 -0
- package/lib/rtp/src/rtcp/rtpfb/twccReceiveTiming.js.map +1 -0
- package/lib/rtp/src/rtcp/rtpfb/twccReferenceTime.d.ts +41 -0
- package/lib/rtp/src/rtcp/rtpfb/twccReferenceTime.js +89 -0
- package/lib/rtp/src/rtcp/rtpfb/twccReferenceTime.js.map +1 -0
- package/lib/rtp/src/rtcp/sr.js +1 -0
- package/lib/rtp/src/rtcp/sr.js.map +1 -1
- package/lib/rtp/src/rtp/continuity.d.ts +36 -0
- package/lib/rtp/src/rtp/continuity.js +100 -0
- package/lib/rtp/src/rtp/continuity.js.map +1 -0
- package/lib/rtp/src/rtp/headerExtension.js +41 -21
- package/lib/rtp/src/rtp/headerExtension.js.map +1 -1
- package/lib/rtp/src/rtp/padding.d.ts +17 -0
- package/lib/rtp/src/rtp/padding.js +37 -0
- package/lib/rtp/src/rtp/padding.js.map +1 -0
- package/lib/rtp/src/rtp/red/encoder.d.ts +10 -0
- package/lib/rtp/src/rtp/red/encoder.js +14 -1
- package/lib/rtp/src/rtp/red/encoder.js.map +1 -1
- package/lib/rtp/src/rtp/red/packet.js +24 -8
- package/lib/rtp/src/rtp/red/packet.js.map +1 -1
- package/lib/rtp/src/rtp/rtp.d.ts +24 -1
- package/lib/rtp/src/rtp/rtp.js +70 -29
- package/lib/rtp/src/rtp/rtp.js.map +1 -1
- package/lib/rtp/src/rtp/rtx.js +3 -0
- package/lib/rtp/src/rtp/rtx.js.map +1 -1
- package/lib/rtp/src/rtp/sendHeaderExtensions.d.ts +36 -0
- package/lib/rtp/src/rtp/sendHeaderExtensions.js +85 -0
- package/lib/rtp/src/rtp/sendHeaderExtensions.js.map +1 -0
- package/lib/rtp/src/srtp/cipher/ctr.js +4 -2
- package/lib/rtp/src/srtp/cipher/ctr.js.map +1 -1
- package/lib/rtp/src/srtp/cipher/index.js +8 -4
- package/lib/rtp/src/srtp/cipher/index.js.map +1 -1
- package/lib/rtp/src/srtp/context/context.js +6 -3
- package/lib/rtp/src/srtp/context/context.js.map +1 -1
- package/lib/rtp/src/srtp/context/srtcp.d.ts +1 -1
- package/lib/rtp/src/srtp/context/srtcp.js +33 -0
- package/lib/rtp/src/srtp/context/srtcp.js.map +1 -1
- package/lib/rtp/src/srtp/context/srtp.d.ts +1 -1
- package/lib/rtp/src/srtp/context/srtp.js +34 -10
- package/lib/rtp/src/srtp/context/srtp.js.map +1 -1
- package/lib/rtp/src/srtp/error.d.ts +8 -0
- package/lib/rtp/src/srtp/error.js +13 -1
- package/lib/rtp/src/srtp/error.js.map +1 -1
- package/lib/rtp/src/srtp/packet.js +4 -1
- package/lib/rtp/src/srtp/packet.js.map +1 -1
- package/lib/rtp/src/srtp/replay.d.ts +24 -0
- package/lib/rtp/src/srtp/replay.js +75 -0
- package/lib/rtp/src/srtp/replay.js.map +1 -0
- package/lib/rtp/src/srtp/session.js +2 -1
- package/lib/rtp/src/srtp/session.js.map +1 -1
- package/lib/rtp/src/srtp/srtcp.js +2 -1
- package/lib/rtp/src/srtp/srtcp.js.map +1 -1
- package/lib/rtp/src/srtp/srtp.js +2 -1
- package/lib/rtp/src/srtp/srtp.js.map +1 -1
- package/lib/rtp/src/util.js +2 -1
- package/lib/rtp/src/util.js.map +1 -1
- package/lib/sctp/src/chunk.d.ts +5 -0
- package/lib/sctp/src/chunk.js +31 -8
- package/lib/sctp/src/chunk.js.map +1 -1
- package/lib/sctp/src/const.d.ts +25 -17
- package/lib/sctp/src/const.js +23 -19
- package/lib/sctp/src/const.js.map +1 -1
- package/lib/sctp/src/param.d.ts +6 -2
- package/lib/sctp/src/param.js +22 -8
- package/lib/sctp/src/param.js.map +1 -1
- package/lib/sctp/src/sctp.d.ts +80 -0
- package/lib/sctp/src/sctp.js +655 -108
- package/lib/sctp/src/sctp.js.map +1 -1
- package/lib/sctp/src/transport.js +4 -2
- package/lib/sctp/src/transport.js.map +1 -1
- package/lib/webrtc/src/api/peerConfig.d.ts +48 -5
- package/lib/webrtc/src/api/peerConfig.js +41 -0
- package/lib/webrtc/src/api/peerConfig.js.map +1 -1
- package/lib/webrtc/src/dataChannel.d.ts +10 -0
- package/lib/webrtc/src/dataChannel.js +24 -4
- package/lib/webrtc/src/dataChannel.js.map +1 -1
- package/lib/webrtc/src/media/index.d.ts +10 -0
- package/lib/webrtc/src/media/index.js +70 -0
- package/lib/webrtc/src/media/index.js.map +1 -1
- package/lib/webrtc/src/media/receiver/nack.js +2 -1
- package/lib/webrtc/src/media/receiver/nack.js.map +1 -1
- package/lib/webrtc/src/media/receiver/receiverTwcc.d.ts +61 -1
- package/lib/webrtc/src/media/receiver/receiverTwcc.js +218 -63
- package/lib/webrtc/src/media/receiver/receiverTwcc.js.map +1 -1
- package/lib/webrtc/src/media/router.d.ts +14 -1
- package/lib/webrtc/src/media/router.js +46 -2
- package/lib/webrtc/src/media/router.js.map +1 -1
- package/lib/webrtc/src/media/rtpReceiver.d.ts +30 -2
- package/lib/webrtc/src/media/rtpReceiver.js +175 -26
- package/lib/webrtc/src/media/rtpReceiver.js.map +1 -1
- package/lib/webrtc/src/media/rtpSender.d.ts +184 -70
- package/lib/webrtc/src/media/rtpSender.js +626 -449
- package/lib/webrtc/src/media/rtpSender.js.map +1 -1
- package/lib/webrtc/src/media/rtpTransceiver.d.ts +1 -3
- package/lib/webrtc/src/media/rtpTransceiver.js +10 -7
- package/lib/webrtc/src/media/rtpTransceiver.js.map +1 -1
- package/lib/webrtc/src/media/sender/bandwidthEstimator.d.ts +249 -0
- package/lib/webrtc/src/media/sender/bandwidthEstimator.js +144 -0
- package/lib/webrtc/src/media/sender/bandwidthEstimator.js.map +1 -0
- package/lib/webrtc/src/media/sender/createBandwidthEstimator.d.ts +20 -0
- package/lib/webrtc/src/media/sender/createBandwidthEstimator.js +26 -0
- package/lib/webrtc/src/media/sender/createBandwidthEstimator.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimatorBinding.d.ts +70 -0
- package/lib/webrtc/src/media/sender/estimatorBinding.js +175 -0
- package/lib/webrtc/src/media/sender/estimatorBinding.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/disabledBwe.d.ts +18 -0
- package/lib/webrtc/src/media/sender/estimators/disabledBwe.js +44 -0
- package/lib/webrtc/src/media/sender/estimators/disabledBwe.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/acknowledgedBitrateEstimator.d.ts +79 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/acknowledgedBitrateEstimator.js +289 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/acknowledgedBitrateEstimator.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/aimdRateControl.d.ts +87 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/aimdRateControl.js +429 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/aimdRateControl.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/alrDetector.d.ts +21 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/alrDetector.js +84 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/alrDetector.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/bandwidthLimitedCause.d.ts +37 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/bandwidthLimitedCause.js +74 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/bandwidthLimitedCause.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/constants.d.ts +383 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/constants.js +408 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/constants.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/gccBwe.d.ts +406 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/gccBwe.js +1391 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/gccBwe.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/index.d.ts +19 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/index.js +75 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/index.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/interArrivalDelta.d.ts +68 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/interArrivalDelta.js +201 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/interArrivalDelta.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/intervalBudget.d.ts +26 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/intervalBudget.js +72 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/intervalBudget.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/linkCapacityEstimator.d.ts +41 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/linkCapacityEstimator.js +99 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/linkCapacityEstimator.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/lossBasedBwe.d.ts +247 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/lossBasedBwe.js +1042 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/lossBasedBwe.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/overuseDetector.d.ts +26 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/overuseDetector.js +132 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/overuseDetector.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/probeController.d.ts +305 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/probeController.js +1073 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/probeController.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/rttBasedBackoff.d.ts +60 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/rttBasedBackoff.js +151 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/rttBasedBackoff.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/trendlineEstimator.d.ts +44 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/trendlineEstimator.js +246 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/trendlineEstimator.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/index.d.ts +7 -0
- package/lib/webrtc/src/media/sender/estimators/index.js +19 -0
- package/lib/webrtc/src/media/sender/estimators/index.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/lightweightBwe.d.ts +64 -0
- package/lib/webrtc/src/media/sender/estimators/lightweightBwe.js +216 -0
- package/lib/webrtc/src/media/sender/estimators/lightweightBwe.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/twccFeedbackAdapter.d.ts +117 -0
- package/lib/webrtc/src/media/sender/estimators/twccFeedbackAdapter.js +250 -0
- package/lib/webrtc/src/media/sender/estimators/twccFeedbackAdapter.js.map +1 -0
- package/lib/webrtc/src/media/sender/outgoingQueue.d.ts +40 -0
- package/lib/webrtc/src/media/sender/outgoingQueue.js +153 -0
- package/lib/webrtc/src/media/sender/outgoingQueue.js.map +1 -0
- package/lib/webrtc/src/media/sender/padding.d.ts +45 -0
- package/lib/webrtc/src/media/sender/padding.js +134 -0
- package/lib/webrtc/src/media/sender/padding.js.map +1 -0
- package/lib/webrtc/src/media/sender/pendingRtp.d.ts +35 -0
- package/lib/webrtc/src/media/sender/pendingRtp.js +120 -0
- package/lib/webrtc/src/media/sender/pendingRtp.js.map +1 -0
- package/lib/webrtc/src/media/sender/rtpWire.d.ts +13 -0
- package/lib/webrtc/src/media/sender/rtpWire.js +38 -0
- package/lib/webrtc/src/media/sender/rtpWire.js.map +1 -0
- package/lib/webrtc/src/media/sender/sendPacer.d.ts +27 -0
- package/lib/webrtc/src/media/sender/sendPacer.js +110 -0
- package/lib/webrtc/src/media/sender/sendPacer.js.map +1 -0
- package/lib/webrtc/src/media/sender/senderBWE.d.ts +8 -33
- package/lib/webrtc/src/media/sender/senderBWE.js +5 -154
- package/lib/webrtc/src/media/sender/senderBWE.js.map +1 -1
- package/lib/webrtc/src/media/sender/senderStats.d.ts +100 -0
- package/lib/webrtc/src/media/sender/senderStats.js +322 -0
- package/lib/webrtc/src/media/sender/senderStats.js.map +1 -0
- package/lib/webrtc/src/media/track.d.ts +20 -2
- package/lib/webrtc/src/media/track.js +23 -5
- package/lib/webrtc/src/media/track.js.map +1 -1
- package/lib/webrtc/src/negotiation/bundleTopology.d.ts +1 -5
- package/lib/webrtc/src/negotiation/bundleTopology.js +15 -11
- package/lib/webrtc/src/negotiation/bundleTopology.js.map +1 -1
- package/lib/webrtc/src/negotiation/descriptionValidation.js +12 -6
- package/lib/webrtc/src/negotiation/descriptionValidation.js.map +1 -1
- package/lib/webrtc/src/negotiation/negotiationNeeded.js +2 -1
- package/lib/webrtc/src/negotiation/negotiationNeeded.js.map +1 -1
- package/lib/webrtc/src/negotiation/remoteCandidates.js +10 -5
- package/lib/webrtc/src/negotiation/remoteCandidates.js.map +1 -1
- package/lib/webrtc/src/negotiation/remoteMediaApplication.d.ts +1 -1
- package/lib/webrtc/src/negotiation/remoteMediaApplication.js +22 -6
- package/lib/webrtc/src/negotiation/remoteMediaApplication.js.map +1 -1
- package/lib/webrtc/src/negotiation/transportActivation.js +19 -8
- package/lib/webrtc/src/negotiation/transportActivation.js.map +1 -1
- package/lib/webrtc/src/negotiationTransaction.d.ts +8 -1
- package/lib/webrtc/src/negotiationTransaction.js +18 -5
- package/lib/webrtc/src/negotiationTransaction.js.map +1 -1
- package/lib/webrtc/src/nonstandard/dummyMedia.js +2 -1
- package/lib/webrtc/src/nonstandard/dummyMedia.js.map +1 -1
- package/lib/webrtc/src/nonstandard/navigator.js +4 -3
- package/lib/webrtc/src/nonstandard/navigator.js.map +1 -1
- package/lib/webrtc/src/nonstandard/recorder/index.d.ts +32 -8
- package/lib/webrtc/src/nonstandard/recorder/index.js +81 -20
- package/lib/webrtc/src/nonstandard/recorder/index.js.map +1 -1
- package/lib/webrtc/src/nonstandard/recorder/writer/index.d.ts +9 -7
- package/lib/webrtc/src/nonstandard/recorder/writer/index.js +2 -1
- package/lib/webrtc/src/nonstandard/recorder/writer/index.js.map +1 -1
- package/lib/webrtc/src/nonstandard/recorder/writer/ogg.d.ts +32 -0
- package/lib/webrtc/src/nonstandard/recorder/writer/ogg.js +185 -0
- package/lib/webrtc/src/nonstandard/recorder/writer/ogg.js.map +1 -0
- package/lib/webrtc/src/nonstandard/recorder/writer/webm.js +8 -1
- package/lib/webrtc/src/nonstandard/recorder/writer/webm.js.map +1 -1
- package/lib/webrtc/src/nonstandard/userMedia.js +2 -1
- package/lib/webrtc/src/nonstandard/userMedia.js.map +1 -1
- package/lib/webrtc/src/peerConnection.d.ts +44 -1
- package/lib/webrtc/src/peerConnection.js +74 -8
- package/lib/webrtc/src/peerConnection.js.map +1 -1
- package/lib/webrtc/src/polyfill/mediaDevices.js +2 -1
- package/lib/webrtc/src/polyfill/mediaDevices.js.map +1 -1
- package/lib/webrtc/src/sctpManager.d.ts +46 -14
- package/lib/webrtc/src/sctpManager.js +88 -25
- package/lib/webrtc/src/sctpManager.js.map +1 -1
- package/lib/webrtc/src/sdp.js +12 -6
- package/lib/webrtc/src/sdp.js.map +1 -1
- package/lib/webrtc/src/secureTransportManager.d.ts +52 -4
- package/lib/webrtc/src/secureTransportManager.js +106 -23
- package/lib/webrtc/src/secureTransportManager.js.map +1 -1
- package/lib/webrtc/src/transceiverManager.js +8 -3
- package/lib/webrtc/src/transceiverManager.js.map +1 -1
- package/lib/webrtc/src/transport/dtls.d.ts +53 -1
- package/lib/webrtc/src/transport/dtls.js +131 -31
- package/lib/webrtc/src/transport/dtls.js.map +1 -1
- package/lib/webrtc/src/transport/ice.d.ts +10 -86
- package/lib/webrtc/src/transport/ice.js +70 -31
- package/lib/webrtc/src/transport/ice.js.map +1 -1
- package/lib/webrtc/src/transport/sctp.d.ts +2 -0
- package/lib/webrtc/src/transport/sctp.js +66 -20
- package/lib/webrtc/src/transport/sctp.js.map +1 -1
- package/lib/webrtc/src/utils.d.ts +36 -3
- package/lib/webrtc/src/utils.js +56 -16
- package/lib/webrtc/src/utils.js.map +1 -1
- package/package.json +8 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alrDetector.js","sourceRoot":"","sources":["../../../../../../../src/media/sender/estimators/gcc/alrDetector.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACH,2CAIqB;AACrB,qDAAkD;AAElD;;;;;;;;;GASG;AACH,MAAa,WAAW;IAAxB;QACU;;;;;WAA+B;QAC/B;;;;;WAA8B;QACrB;;;;mBAAS,IAAI,+BAAc,CAAC,IAAI,CAAC;WAAC;IA0CrD,CAAC;IAxCC,KAAK;QACH,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;IAED,WAAW,CAAC,KAAa,EAAE,MAAc;QACvC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,KAAK,GAAG,CAAC;YAAE,OAAO;QAClD,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YAClC,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC;YACzB,OAAO;QACT,CAAC;QACD,MAAM,OAAO,GAAG,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC;QACzC,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC;QACzB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC7B,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACpC,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;QACxC,IAAI,KAAK,GAAG,qCAAyB,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;YACtE,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC;QAC1B,CAAC;aAAM,IACL,KAAK,GAAG,oCAAwB;YAChC,IAAI,CAAC,SAAS,KAAK,SAAS,EAC5B,CAAC;YACD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC7B,CAAC;IACH,CAAC;IAED,mBAAmB,CAAC,GAAW;QAC7B,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC;YAAE,OAAO;QAChD,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,GAAG,GAAG,mCAAuB,CAAC,GAAG,IAAI,CAAC,CAAC;IACxE,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC;IACtC,CAAC;IAED,qEAAqE;IACrE,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;CACF;AA7CD,kCA6CC","sourcesContent":["/*!\n * Portions of this file are ported from libwebrtc\n * (https://webrtc.googlesource.com/src, commit 0fda16159e33adf59c71a7ad1173dcbe5a632102).\n * Copyright (c) 2011, The WebRTC project authors. All rights reserved.\n * Use of that source is governed by a BSD-style license and an additional\n * patent grant; both are reproduced in THIRD_PARTY_LICENSES_LIBWEBRTC.txt\n * (shipped with this package).\n */\nimport {\n kAlrBandwidthUsageRatio,\n kAlrStartBudgetLevelRatio,\n kAlrStopBudgetLevelRatio,\n} from \"./constants\";\nimport { IntervalBudget } from \"./intervalBudget\";\n\n/**\n * pin `modules/congestion_controller/goog_cc/alr_detector`.\n *\n * ALR starts when the send budget ratio exceeds\n * {@link kAlrStartBudgetLevelRatio} (underusing) and ends when it falls below\n * {@link kAlrStopBudgetLevelRatio}. Budget target is estimate ×\n * {@link kAlrBandwidthUsageRatio}.\n *\n * Start time uses the sender clock (`sendMs`), matching pin Timestamp domain.\n */\nexport class AlrDetector {\n private lastSendMs: number | undefined;\n private startedMs: number | undefined;\n private readonly budget = new IntervalBudget(true);\n\n reset() {\n this.lastSendMs = undefined;\n this.startedMs = undefined;\n this.budget.reset();\n }\n\n onBytesSent(bytes: number, sendMs: number) {\n if (!Number.isFinite(sendMs) || bytes < 0) return;\n if (this.lastSendMs === undefined) {\n this.lastSendMs = sendMs;\n return;\n }\n const deltaMs = sendMs - this.lastSendMs;\n this.lastSendMs = sendMs;\n this.budget.useBudget(bytes);\n this.budget.increaseBudget(deltaMs);\n const ratio = this.budget.budgetRatio();\n if (ratio > kAlrStartBudgetLevelRatio && this.startedMs === undefined) {\n this.startedMs = sendMs;\n } else if (\n ratio < kAlrStopBudgetLevelRatio &&\n this.startedMs !== undefined\n ) {\n this.startedMs = undefined;\n }\n }\n\n setEstimatedBitrate(bps: number) {\n if (!(bps > 0) || !Number.isFinite(bps)) return;\n this.budget.setTargetRateKbps((bps * kAlrBandwidthUsageRatio) / 1000);\n }\n\n get inAlr(): boolean {\n return this.startedMs !== undefined;\n }\n\n /** Sender-clock time when the current ALR region started, if any. */\n get startMs(): number | undefined {\n return this.startedMs;\n }\n}\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { LossBasedState } from "./lossBasedBwe";
|
|
2
|
+
import type { BandwidthUsage } from "./overuseDetector";
|
|
3
|
+
/**
|
|
4
|
+
* libwebrtc `BandwidthLimitedCause` (probe_controller.h) — reason the BWE
|
|
5
|
+
* estimate is limited. ProbeController::InitiateProbing uses this to decide
|
|
6
|
+
* whether new probes are forbidden or allowed with a scale cap.
|
|
7
|
+
*/
|
|
8
|
+
export type BandwidthLimitedCause = "loss_limited_bwe_increasing" | "loss_limited_bwe" | "delay_based_limited" | "delay_based_limited_delay_increased" | "rtt_based_back_off_high_rtt";
|
|
9
|
+
/**
|
|
10
|
+
* libwebrtc `GetBandwidthLimitedCause` (goog_cc_network_control.cc).
|
|
11
|
+
*
|
|
12
|
+
* | Delay usage | RTT high? | LossBasedState | Cause |
|
|
13
|
+
* | overuse/underuse | * | * | delay_based_limited_delay_increased |
|
|
14
|
+
* | normal | yes | * | rtt_based_back_off_high_rtt |
|
|
15
|
+
* | normal | no | decreasing / increase_using_padding | loss_limited_bwe |
|
|
16
|
+
* | normal | no | increasing | loss_limited_bwe_increasing |
|
|
17
|
+
* | normal | no | delay_based | delay_based_limited |
|
|
18
|
+
*
|
|
19
|
+
* pin maps `kIncreaseUsingPadding` to `kLossLimitedBwe` (probes forbidden).
|
|
20
|
+
* There is no `kHold` state — HOLD is `kDecreasing` + `last_hold_info_`.
|
|
21
|
+
*/
|
|
22
|
+
export declare function getBandwidthLimitedCause(usage: BandwidthUsage, isRttAboveLimit: boolean, lossState: LossBasedState): BandwidthLimitedCause;
|
|
23
|
+
/** True when InitiateProbing would return a non-empty cluster list. */
|
|
24
|
+
export declare function isProbeInitiationAllowed(cause: BandwidthLimitedCause): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Max probe target bitrate for this cause (libwebrtc InitiateProbing switch).
|
|
27
|
+
* - kLossLimitedBweIncreasing → estimated × loss_limited_probe_scale (1.5)
|
|
28
|
+
* - kDelayBasedLimited → no extra cap (only configured max)
|
|
29
|
+
* - forbid causes → 0 (caller should not probe)
|
|
30
|
+
*/
|
|
31
|
+
export declare function maxProbeBitrateBps(cause: BandwidthLimitedCause, estimatedBitrateBps: number, configuredMaxBps?: number): number;
|
|
32
|
+
/**
|
|
33
|
+
* RTT above libwebrtc RttBasedBackoff default limit (3s).
|
|
34
|
+
* Call with **CorrectedRtt / propagation RTT** (not raw max feedback RTT).
|
|
35
|
+
* Prefer {@link RttBasedBackoff.isRttAboveLimit} when the helper is available.
|
|
36
|
+
*/
|
|
37
|
+
export declare function isRttAboveLimit(rttMs: number, limitMs?: number): boolean;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBandwidthLimitedCause = getBandwidthLimitedCause;
|
|
4
|
+
exports.isProbeInitiationAllowed = isProbeInitiationAllowed;
|
|
5
|
+
exports.maxProbeBitrateBps = maxProbeBitrateBps;
|
|
6
|
+
exports.isRttAboveLimit = isRttAboveLimit;
|
|
7
|
+
/*!
|
|
8
|
+
* Portions of this file are ported from libwebrtc
|
|
9
|
+
* (https://webrtc.googlesource.com/src, commit 0fda16159e33adf59c71a7ad1173dcbe5a632102).
|
|
10
|
+
* Copyright (c) 2011, The WebRTC project authors. All rights reserved.
|
|
11
|
+
* Use of that source is governed by a BSD-style license and an additional
|
|
12
|
+
* patent grant; both are reproduced in THIRD_PARTY_LICENSES_LIBWEBRTC.txt
|
|
13
|
+
* (shipped with this package).
|
|
14
|
+
*/
|
|
15
|
+
const constants_1 = require("./constants");
|
|
16
|
+
/**
|
|
17
|
+
* libwebrtc `GetBandwidthLimitedCause` (goog_cc_network_control.cc).
|
|
18
|
+
*
|
|
19
|
+
* | Delay usage | RTT high? | LossBasedState | Cause |
|
|
20
|
+
* | overuse/underuse | * | * | delay_based_limited_delay_increased |
|
|
21
|
+
* | normal | yes | * | rtt_based_back_off_high_rtt |
|
|
22
|
+
* | normal | no | decreasing / increase_using_padding | loss_limited_bwe |
|
|
23
|
+
* | normal | no | increasing | loss_limited_bwe_increasing |
|
|
24
|
+
* | normal | no | delay_based | delay_based_limited |
|
|
25
|
+
*
|
|
26
|
+
* pin maps `kIncreaseUsingPadding` to `kLossLimitedBwe` (probes forbidden).
|
|
27
|
+
* There is no `kHold` state — HOLD is `kDecreasing` + `last_hold_info_`.
|
|
28
|
+
*/
|
|
29
|
+
function getBandwidthLimitedCause(usage, isRttAboveLimit, lossState) {
|
|
30
|
+
if (usage === "overuse" || usage === "underuse") {
|
|
31
|
+
return "delay_based_limited_delay_increased";
|
|
32
|
+
}
|
|
33
|
+
if (isRttAboveLimit) {
|
|
34
|
+
return "rtt_based_back_off_high_rtt";
|
|
35
|
+
}
|
|
36
|
+
switch (lossState) {
|
|
37
|
+
case "decreasing":
|
|
38
|
+
case "increase_using_padding":
|
|
39
|
+
return "loss_limited_bwe";
|
|
40
|
+
case "increasing":
|
|
41
|
+
return "loss_limited_bwe_increasing";
|
|
42
|
+
case "delay_based":
|
|
43
|
+
return "delay_based_limited";
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/** True when InitiateProbing would return a non-empty cluster list. */
|
|
47
|
+
function isProbeInitiationAllowed(cause) {
|
|
48
|
+
return (cause === "loss_limited_bwe_increasing" || cause === "delay_based_limited");
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Max probe target bitrate for this cause (libwebrtc InitiateProbing switch).
|
|
52
|
+
* - kLossLimitedBweIncreasing → estimated × loss_limited_probe_scale (1.5)
|
|
53
|
+
* - kDelayBasedLimited → no extra cap (only configured max)
|
|
54
|
+
* - forbid causes → 0 (caller should not probe)
|
|
55
|
+
*/
|
|
56
|
+
function maxProbeBitrateBps(cause, estimatedBitrateBps, configuredMaxBps = constants_1.kMaxBitrateBps) {
|
|
57
|
+
if (!isProbeInitiationAllowed(cause)) {
|
|
58
|
+
return 0;
|
|
59
|
+
}
|
|
60
|
+
let max = configuredMaxBps;
|
|
61
|
+
if (cause === "loss_limited_bwe_increasing") {
|
|
62
|
+
max = Math.min(max, Math.max(0, estimatedBitrateBps) * constants_1.kLossLimitedProbeScale);
|
|
63
|
+
}
|
|
64
|
+
return max;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* RTT above libwebrtc RttBasedBackoff default limit (3s).
|
|
68
|
+
* Call with **CorrectedRtt / propagation RTT** (not raw max feedback RTT).
|
|
69
|
+
* Prefer {@link RttBasedBackoff.isRttAboveLimit} when the helper is available.
|
|
70
|
+
*/
|
|
71
|
+
function isRttAboveLimit(rttMs, limitMs = constants_1.kRttBasedBackOffHighRttMs) {
|
|
72
|
+
return Number.isFinite(rttMs) && rttMs > limitMs;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=bandwidthLimitedCause.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bandwidthLimitedCause.js","sourceRoot":"","sources":["../../../../../../../src/media/sender/estimators/gcc/bandwidthLimitedCause.ts"],"names":[],"mappings":";;AAyCA,4DAoBC;AAGD,4DAMC;AAQD,gDAgBC;AAOD,0CAKC;AA1GD;;;;;;;GAOG;AACH,2CAIqB;AAgBrB;;;;;;;;;;;;GAYG;AACH,SAAgB,wBAAwB,CACtC,KAAqB,EACrB,eAAwB,EACxB,SAAyB;IAEzB,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,UAAU,EAAE,CAAC;QAChD,OAAO,qCAAqC,CAAC;IAC/C,CAAC;IACD,IAAI,eAAe,EAAE,CAAC;QACpB,OAAO,6BAA6B,CAAC;IACvC,CAAC;IACD,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,YAAY,CAAC;QAClB,KAAK,wBAAwB;YAC3B,OAAO,kBAAkB,CAAC;QAC5B,KAAK,YAAY;YACf,OAAO,6BAA6B,CAAC;QACvC,KAAK,aAAa;YAChB,OAAO,qBAAqB,CAAC;IACjC,CAAC;AACH,CAAC;AAED,uEAAuE;AACvE,SAAgB,wBAAwB,CACtC,KAA4B;IAE5B,OAAO,CACL,KAAK,KAAK,6BAA6B,IAAI,KAAK,KAAK,qBAAqB,CAC3E,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAgB,kBAAkB,CAChC,KAA4B,EAC5B,mBAA2B,EAC3B,gBAAgB,GAAG,0BAAc;IAEjC,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,CAAC;QACrC,OAAO,CAAC,CAAC;IACX,CAAC;IACD,IAAI,GAAG,GAAG,gBAAgB,CAAC;IAC3B,IAAI,KAAK,KAAK,6BAA6B,EAAE,CAAC;QAC5C,GAAG,GAAG,IAAI,CAAC,GAAG,CACZ,GAAG,EACH,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,mBAAmB,CAAC,GAAG,kCAAsB,CAC1D,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;GAIG;AACH,SAAgB,eAAe,CAC7B,KAAa,EACb,OAAO,GAAG,qCAAyB;IAEnC,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,OAAO,CAAC;AACnD,CAAC","sourcesContent":["/*!\n * Portions of this file are ported from libwebrtc\n * (https://webrtc.googlesource.com/src, commit 0fda16159e33adf59c71a7ad1173dcbe5a632102).\n * Copyright (c) 2011, The WebRTC project authors. All rights reserved.\n * Use of that source is governed by a BSD-style license and an additional\n * patent grant; both are reproduced in THIRD_PARTY_LICENSES_LIBWEBRTC.txt\n * (shipped with this package).\n */\nimport {\n kLossLimitedProbeScale,\n kMaxBitrateBps,\n kRttBasedBackOffHighRttMs,\n} from \"./constants\";\nimport type { LossBasedState } from \"./lossBasedBwe\";\nimport type { BandwidthUsage } from \"./overuseDetector\";\n\n/**\n * libwebrtc `BandwidthLimitedCause` (probe_controller.h) — reason the BWE\n * estimate is limited. ProbeController::InitiateProbing uses this to decide\n * whether new probes are forbidden or allowed with a scale cap.\n */\nexport type BandwidthLimitedCause =\n | \"loss_limited_bwe_increasing\"\n | \"loss_limited_bwe\"\n | \"delay_based_limited\"\n | \"delay_based_limited_delay_increased\"\n | \"rtt_based_back_off_high_rtt\";\n\n/**\n * libwebrtc `GetBandwidthLimitedCause` (goog_cc_network_control.cc).\n *\n * | Delay usage | RTT high? | LossBasedState | Cause |\n * | overuse/underuse | * | * | delay_based_limited_delay_increased |\n * | normal | yes | * | rtt_based_back_off_high_rtt |\n * | normal | no | decreasing / increase_using_padding | loss_limited_bwe |\n * | normal | no | increasing | loss_limited_bwe_increasing |\n * | normal | no | delay_based | delay_based_limited |\n *\n * pin maps `kIncreaseUsingPadding` to `kLossLimitedBwe` (probes forbidden).\n * There is no `kHold` state — HOLD is `kDecreasing` + `last_hold_info_`.\n */\nexport function getBandwidthLimitedCause(\n usage: BandwidthUsage,\n isRttAboveLimit: boolean,\n lossState: LossBasedState,\n): BandwidthLimitedCause {\n if (usage === \"overuse\" || usage === \"underuse\") {\n return \"delay_based_limited_delay_increased\";\n }\n if (isRttAboveLimit) {\n return \"rtt_based_back_off_high_rtt\";\n }\n switch (lossState) {\n case \"decreasing\":\n case \"increase_using_padding\":\n return \"loss_limited_bwe\";\n case \"increasing\":\n return \"loss_limited_bwe_increasing\";\n case \"delay_based\":\n return \"delay_based_limited\";\n }\n}\n\n/** True when InitiateProbing would return a non-empty cluster list. */\nexport function isProbeInitiationAllowed(\n cause: BandwidthLimitedCause,\n): boolean {\n return (\n cause === \"loss_limited_bwe_increasing\" || cause === \"delay_based_limited\"\n );\n}\n\n/**\n * Max probe target bitrate for this cause (libwebrtc InitiateProbing switch).\n * - kLossLimitedBweIncreasing → estimated × loss_limited_probe_scale (1.5)\n * - kDelayBasedLimited → no extra cap (only configured max)\n * - forbid causes → 0 (caller should not probe)\n */\nexport function maxProbeBitrateBps(\n cause: BandwidthLimitedCause,\n estimatedBitrateBps: number,\n configuredMaxBps = kMaxBitrateBps,\n): number {\n if (!isProbeInitiationAllowed(cause)) {\n return 0;\n }\n let max = configuredMaxBps;\n if (cause === \"loss_limited_bwe_increasing\") {\n max = Math.min(\n max,\n Math.max(0, estimatedBitrateBps) * kLossLimitedProbeScale,\n );\n }\n return max;\n}\n\n/**\n * RTT above libwebrtc RttBasedBackoff default limit (3s).\n * Call with **CorrectedRtt / propagation RTT** (not raw max feedback RTT).\n * Prefer {@link RttBasedBackoff.isRttAboveLimit} when the helper is available.\n */\nexport function isRttAboveLimit(\n rttMs: number,\n limitMs = kRttBasedBackOffHighRttMs,\n): boolean {\n return Number.isFinite(rttMs) && rttMs > limitMs;\n}\n"]}
|
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Portions of this file are ported from libwebrtc
|
|
3
|
+
* (https://webrtc.googlesource.com/src, commit 0fda16159e33adf59c71a7ad1173dcbe5a632102).
|
|
4
|
+
* Copyright (c) 2011, The WebRTC project authors. All rights reserved.
|
|
5
|
+
* Use of that source is governed by a BSD-style license and an additional
|
|
6
|
+
* patent grant; both are reproduced in THIRD_PARTY_LICENSES_LIBWEBRTC.txt
|
|
7
|
+
* (shipped with this package).
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Named constants for Google Congestion Control (GCC).
|
|
11
|
+
*
|
|
12
|
+
* Prefer **libwebrtc goog_cc** runtime defaults when draft-ietf-rmcat-gcc and
|
|
13
|
+
* Chromium diverge.
|
|
14
|
+
*
|
|
15
|
+
* Known intentional differences: {@link GCC_KNOWN_DIFFERENCES}.
|
|
16
|
+
*/
|
|
17
|
+
/** Initial / fallback start bitrate (libwebrtc default ~300 kbps). */
|
|
18
|
+
export declare const kDefaultStartBitrateBps = 300000;
|
|
19
|
+
/**
|
|
20
|
+
* pin `SendSideBandwidthEstimation` `kStartPhase` = 2s.
|
|
21
|
+
* Startup delay/REMB trust (`last_fraction_loss_ == 0`) lasts until this
|
|
22
|
+
* window after the first {@link GccBandwidthEstimator.updatePacketsLost}
|
|
23
|
+
* (RTCP TransportLossReport). With no RR, first_report_time stays infinite
|
|
24
|
+
* and the start phase remains open until LossBasedV2 is ready.
|
|
25
|
+
*/
|
|
26
|
+
export declare const kStartPhaseMs = 2000;
|
|
27
|
+
/**
|
|
28
|
+
* pin `UpdatePacketsLost` `kLimitNumPackets` = 20.
|
|
29
|
+
* Fraction-loss is not published until this many packets accumulate.
|
|
30
|
+
*/
|
|
31
|
+
export declare const kStartPhaseLossReportMinPackets = 20;
|
|
32
|
+
/**
|
|
33
|
+
* pin `kCongestionControllerMinBitrate` (bwe_defines.h) = 5 kbps.
|
|
34
|
+
* Auditable via third_party/libwebrtc-ref snapshot.
|
|
35
|
+
*/
|
|
36
|
+
export declare const kMinBitrateBps = 5000;
|
|
37
|
+
export declare const kMaxBitrateBps = 1000000000;
|
|
38
|
+
/** Burst grouping window for inter-arrival pre-filter (ms). */
|
|
39
|
+
export declare const kBurstTimeMs = 5;
|
|
40
|
+
/**
|
|
41
|
+
* Delay-based stream idle timeout (ms).
|
|
42
|
+
* libwebrtc `DelayBasedBwe::kStreamTimeOut` = 2s — reset InterArrivalDelta +
|
|
43
|
+
* TrendlineEstimator when no packet feedback arrives for this long.
|
|
44
|
+
*/
|
|
45
|
+
export declare const kStreamTimeOutMs = 2000;
|
|
46
|
+
/**
|
|
47
|
+
* Default window size in packets
|
|
48
|
+
* (`TrendlineEstimatorSettings::kDefaultTrendlineWindowSize` = 20).
|
|
49
|
+
* Slope is only recomputed when the window is full.
|
|
50
|
+
*/
|
|
51
|
+
export declare const kTrendlineWindowSize = 20;
|
|
52
|
+
/** Exponential smoothing coefficient for accumulated delay. */
|
|
53
|
+
export declare const kTrendlineSmoothingCoeff = 0.9;
|
|
54
|
+
/**
|
|
55
|
+
* Gain applied as `min(num_deltas, kMinNumDeltas) * trend * gain`
|
|
56
|
+
* before comparing to the adaptive threshold.
|
|
57
|
+
*/
|
|
58
|
+
export declare const kTrendlineThresholdGain = 4;
|
|
59
|
+
/**
|
|
60
|
+
* Cap used in modified_trend: `min(num_of_deltas, kMinNumDeltas)`.
|
|
61
|
+
* libwebrtc: kMinNumDeltas = 60.
|
|
62
|
+
*/
|
|
63
|
+
export declare const kTrendlineMinNumDeltas = 60;
|
|
64
|
+
/** libwebrtc caps num_of_deltas_ at this value. */
|
|
65
|
+
export declare const kTrendlineDeltaCounterMax = 1000;
|
|
66
|
+
export declare const kInitialThresholdMs = 12.5;
|
|
67
|
+
export declare const kMinThresholdMs = 6;
|
|
68
|
+
export declare const kMaxThresholdMs = 600;
|
|
69
|
+
export declare const kOveruseTimeThresholdMs = 10;
|
|
70
|
+
/** libwebrtc k_up_ / k_down_ for adaptive threshold (not draft K_u / K_d). */
|
|
71
|
+
export declare const kThresholdGainUp = 0.0087;
|
|
72
|
+
export declare const kThresholdGainDown = 0.039;
|
|
73
|
+
export declare const kMaxAdaptOffsetMs = 15;
|
|
74
|
+
/** Multiplicative decrease factor (pin kDefaultBackoffFactor / beta_ = 0.85). */
|
|
75
|
+
export declare const kBeta = 0.85;
|
|
76
|
+
/** Multiplicative increase base per second (pin alpha = 1.08). */
|
|
77
|
+
export declare const kMultiplicativeIncreaseFactor = 1.08;
|
|
78
|
+
/**
|
|
79
|
+
* Extra delay added to RTT for near-max additive response time
|
|
80
|
+
* (pin: response_time = (rtt + 100ms) * 2).
|
|
81
|
+
*/
|
|
82
|
+
export declare const kReactionTimeMs = 100;
|
|
83
|
+
export declare const kBitrateWindowMs = 1000;
|
|
84
|
+
/**
|
|
85
|
+
* pin `kDefaultRtt` = 200ms. AIMD RTT is **not** TWCC propagation RTT;
|
|
86
|
+
* only OnRoundTripTimeUpdate / RTCP RR path updates it via setRtt.
|
|
87
|
+
*/
|
|
88
|
+
export declare const kDefaultRttMs = 200;
|
|
89
|
+
/**
|
|
90
|
+
* TimeToReduceFurther throughput check: estimated_throughput < 0.5 * estimate.
|
|
91
|
+
*/
|
|
92
|
+
export declare const kThroughputLowerFraction = 0.5;
|
|
93
|
+
/**
|
|
94
|
+
* Subtracted from beta * throughput on overuse when result > 5 kbps
|
|
95
|
+
* (pin: decreased_bitrate -= 5 kbps).
|
|
96
|
+
*/
|
|
97
|
+
export declare const kAimdDecreaseOffsetBps = 5000;
|
|
98
|
+
/**
|
|
99
|
+
* Additive increase floor (pin kMinIncreaseRateBpsPerSecond = 4000).
|
|
100
|
+
*/
|
|
101
|
+
export declare const kAimdMinIncreaseRateBpsPerSecond = 4000;
|
|
102
|
+
/**
|
|
103
|
+
* Multiplicative increase floor per update (pin BitsPerSec(1000)).
|
|
104
|
+
*/
|
|
105
|
+
export declare const kAimdMinMultiplicativeIncreaseBps = 1000;
|
|
106
|
+
/**
|
|
107
|
+
* Throughput upper bound offset on increase (pin + 10 kbps).
|
|
108
|
+
*/
|
|
109
|
+
export declare const kAimdThroughputUpperOffsetBps = 10000;
|
|
110
|
+
/** Min packets to form a window (window_packets = 20). */
|
|
111
|
+
export declare const kRobustWindowPackets = 20;
|
|
112
|
+
/** Hard cap on packets retained (max_window_packets = 500). */
|
|
113
|
+
export declare const kRobustMaxWindowPackets = 500;
|
|
114
|
+
/** Min window duration once packet count is met (min_window_duration = 1s). */
|
|
115
|
+
export declare const kRobustMinWindowDurationMs = 1000;
|
|
116
|
+
/** Max window duration (max_window_duration = 5s). */
|
|
117
|
+
export declare const kRobustMaxWindowDurationMs = 5000;
|
|
118
|
+
/** Min packets before producing an estimate (required_packets = 10). */
|
|
119
|
+
export declare const kRobustRequiredPackets = 10;
|
|
120
|
+
/** ObservationWindowSize default 15. */
|
|
121
|
+
export declare const kLossBasedObservationWindow = 15;
|
|
122
|
+
/**
|
|
123
|
+
* Min observation duration before a partial window is committed (ms).
|
|
124
|
+
* libwebrtc `ObservationDurationLowerBound` default 250ms.
|
|
125
|
+
*/
|
|
126
|
+
export declare const kLossBasedObservationDurationLowerBoundMs = 250;
|
|
127
|
+
/**
|
|
128
|
+
* Min committed observations before estimates are used.
|
|
129
|
+
* libwebrtc readiness uses delayed start after several observations (3).
|
|
130
|
+
*/
|
|
131
|
+
export declare const kLossBasedMinNumObservations = 3;
|
|
132
|
+
/**
|
|
133
|
+
* pin LossBasedBweV2 `UseInStartPhase` FieldTrial default (`true`).
|
|
134
|
+
* When ready, LossBased replaces the 2s delay-based startup ramp.
|
|
135
|
+
*/
|
|
136
|
+
export declare const kLossBasedUseInStartPhase = true;
|
|
137
|
+
/** CandidateFactors default {1.02, 1.0, 0.95}. */
|
|
138
|
+
export declare const kLossBasedCandidateFactors: readonly [1.02, 1, 0.95];
|
|
139
|
+
export declare const kLossBasedInherentLossLowerBound = 0.001;
|
|
140
|
+
export declare const kLossBasedInherentLossUpperBoundOffset = 0.05;
|
|
141
|
+
/** InherentLossUpperBoundBwBalance default 100 kbps. */
|
|
142
|
+
export declare const kLossBasedInherentLossUpperBoundBwBalanceBps = 100000;
|
|
143
|
+
export declare const kLossBasedInitialInherentLoss = 0.01;
|
|
144
|
+
export declare const kLossBasedNewtonIterations = 1;
|
|
145
|
+
/** NewtonStepSize default 0.75. */
|
|
146
|
+
export declare const kLossBasedNewtonStepSize = 0.75;
|
|
147
|
+
/** HigherBandwidthBiasFactor default 0.0002. */
|
|
148
|
+
export declare const kLossBasedHigherBwBiasFactor = 0.0002;
|
|
149
|
+
/** HigherLogBandwidthBiasFactor default 0.02. */
|
|
150
|
+
export declare const kLossBasedHigherLogBwBiasFactor = 0.02;
|
|
151
|
+
/** TemporalWeightFactor default 0.9. */
|
|
152
|
+
export declare const kLossBasedTemporalWeightFactor = 0.9;
|
|
153
|
+
/** BwRampupUpperBoundFactor default 1.5. */
|
|
154
|
+
export declare const kLossBasedRampupUpperBoundFactor = 1.5;
|
|
155
|
+
/**
|
|
156
|
+
* When acknowledged rate has not yet recovered past holdRate × threshold,
|
|
157
|
+
* use a more cautious ramp-up (libwebrtc BwRampupUpperBoundInHoldFactor).
|
|
158
|
+
*/
|
|
159
|
+
export declare const kLossBasedRampupUpperBoundInHoldFactor = 1.2;
|
|
160
|
+
/** BwRampupUpperBoundHoldThreshold default 1.3. */
|
|
161
|
+
export declare const kLossBasedRampupUpperBoundHoldThreshold = 1.3;
|
|
162
|
+
/**
|
|
163
|
+
* UseByteLossRate default true — objective/derivative use lost/received **bytes**.
|
|
164
|
+
*/
|
|
165
|
+
export declare const kLossBasedUseByteLossRate = true;
|
|
166
|
+
/** LossThresholdOfHighBandwidthPreference default 0.2. */
|
|
167
|
+
export declare const kLossBasedLossThresholdOfHighBandwidthPreference = 0.2;
|
|
168
|
+
/** BandwidthPreferenceSmoothingFactor default 0.002. */
|
|
169
|
+
export declare const kLossBasedBandwidthPreferenceSmoothingFactor = 0.002;
|
|
170
|
+
/** InstantUpperBoundBwBalance default 100 kbps. */
|
|
171
|
+
export declare const kLossBasedInstantUpperBoundBwBalanceBps = 100000;
|
|
172
|
+
/** InstantUpperBoundLossOffset default 0.05. */
|
|
173
|
+
export declare const kLossBasedInstantUpperBoundLossOffset = 0.05;
|
|
174
|
+
/** InstantUpperBoundTemporalWeightFactor default 0.9. */
|
|
175
|
+
export declare const kLossBasedInstantUpperBoundTemporalWeightFactor = 0.9;
|
|
176
|
+
/** LowerBoundByAckedRateFactor default 1.0. */
|
|
177
|
+
export declare const kLossBasedLowerBoundByAckedRateFactor = 1;
|
|
178
|
+
/** SendingRateSmoothingFactor default 0.0 — no smoothing. */
|
|
179
|
+
export declare const kLossBasedSendingRateSmoothingFactor = 0;
|
|
180
|
+
/**
|
|
181
|
+
* BwBackoffLowerBoundFactor default 1.0.
|
|
182
|
+
* Applied to the acknowledged-rate candidate in GetCandidates.
|
|
183
|
+
*/
|
|
184
|
+
export declare const kLossBasedBandwidthBackoffLowerBoundFactor = 1;
|
|
185
|
+
/** DelayedIncreaseWindow default 300ms. */
|
|
186
|
+
export declare const kLossBasedDelayedIncreaseWindowMs = 300;
|
|
187
|
+
/** MaxIncreaseFactor default 1.3. */
|
|
188
|
+
export declare const kLossBasedMaxIncreaseFactor = 1.3;
|
|
189
|
+
/** HoldDurationFactor default 3.0 in some builds; field trial default 2.0. */
|
|
190
|
+
export declare const kLossBasedHoldDurationFactor = 2;
|
|
191
|
+
/** Initial HOLD duration (ms). libwebrtc kInitHoldDuration = 300ms. */
|
|
192
|
+
export declare const kLossBasedInitHoldDurationMs = 300;
|
|
193
|
+
/** Max HOLD duration (ms). libwebrtc kMaxHoldDuration = 60s. */
|
|
194
|
+
export declare const kLossBasedMaxHoldDurationMs = 60000;
|
|
195
|
+
/** BoundBestCandidate default true. */
|
|
196
|
+
export declare const kLossBasedBoundBestCandidate = true;
|
|
197
|
+
/** NotIncreaseIfInherentLossLessThanAverageLoss default true. */
|
|
198
|
+
export declare const kLossBasedNotIncreaseIfInherentLessThanAverage = true;
|
|
199
|
+
/** NotUseAckedRateInAlr default true. */
|
|
200
|
+
export declare const kLossBasedNotUseAckedRateInAlr = true;
|
|
201
|
+
/** MedianSendingRateFactor default 2.0 (byte-loss spike filter). */
|
|
202
|
+
export declare const kLossBasedMedianSendingRateFactor = 2;
|
|
203
|
+
/** Legacy names kept for tests. */
|
|
204
|
+
export declare const kLossIncreaseThreshold = 0.02;
|
|
205
|
+
export declare const kLossDecreaseThreshold = 0.1;
|
|
206
|
+
export declare const kLossBasedIncreaseFactor = 1.02;
|
|
207
|
+
export declare const kLossBasedBackoffFactor = 0.5;
|
|
208
|
+
export declare const kLossIncreaseFactor = 1.02;
|
|
209
|
+
/**
|
|
210
|
+
* pin `kDefaultPaceMultiplier` — used until the first transport feedback
|
|
211
|
+
* (`first_transport_feedback_received_ == false`).
|
|
212
|
+
*/
|
|
213
|
+
export declare const kDefaultPaceMultiplier = 2.5;
|
|
214
|
+
/**
|
|
215
|
+
* pin `kDefaultPaceMultiplierWithSendSideBwe` — after first TWCC
|
|
216
|
+
* (send-side BWE is active).
|
|
217
|
+
*/
|
|
218
|
+
export declare const kDefaultPaceMultiplierWithSendSideBwe = 1.1;
|
|
219
|
+
/**
|
|
220
|
+
* pin ProbeControllerConfig `min_probe_delta` default (2ms).
|
|
221
|
+
* Inter-burst spacing after the initial exponential session.
|
|
222
|
+
*/
|
|
223
|
+
export declare const kMinProbeDeltaMs = 2;
|
|
224
|
+
/**
|
|
225
|
+
* pin ProbeControllerConfig `initial_min_probe_delta` default (20ms).
|
|
226
|
+
* Used for the first 3x/6x exponential clusters.
|
|
227
|
+
*/
|
|
228
|
+
export declare const kInitialMinProbeDeltaMs = 20;
|
|
229
|
+
/**
|
|
230
|
+
* pin BitrateProberConfig `max_probe_delay` default (10ms).
|
|
231
|
+
* An active cluster whose next_probe_time is this late is discarded.
|
|
232
|
+
*/
|
|
233
|
+
export declare const kMaxProbeDelayMs = 10;
|
|
234
|
+
/**
|
|
235
|
+
* pin BitrateProber `kMaxPendingProbeClusters`.
|
|
236
|
+
*/
|
|
237
|
+
export declare const kMaxPendingProbeClusters = 5;
|
|
238
|
+
/** Initial exponential probe steps: start×3, start×6. */
|
|
239
|
+
export declare const kProbeBitrateMultipliers: readonly [3, 6];
|
|
240
|
+
/** Further probes after success use ×2 (libwebrtc further probe step). */
|
|
241
|
+
export declare const kFurtherProbeStepMultiplier = 2;
|
|
242
|
+
export declare const kFurtherProbeThreshold = 0.7;
|
|
243
|
+
export declare const kProbeMinDurationMs = 15;
|
|
244
|
+
export declare const kProbeMinPackets = 5;
|
|
245
|
+
/**
|
|
246
|
+
* pin BitrateProber `kProbeClusterTimeout` (5s).
|
|
247
|
+
* Drops **queued** (not yet activated) clusters whose `requested_at` is
|
|
248
|
+
* older than this. Not an active-packet scheduling budget — late active
|
|
249
|
+
* clusters are discarded via {@link kMaxProbeDelayMs} instead.
|
|
250
|
+
*/
|
|
251
|
+
export declare const kProbePacingTimeoutMs = 5000;
|
|
252
|
+
/**
|
|
253
|
+
* ProbeController result-wait timeout (ms).
|
|
254
|
+
* After send-fill, waiting for TWCC/result validation uses this (libwebrtc ≈ 1s).
|
|
255
|
+
* Also used as ProbeBitrateEstimator cluster history horizon.
|
|
256
|
+
*/
|
|
257
|
+
export declare const kProbeResultTimeoutMs = 1000;
|
|
258
|
+
/** libwebrtc ProbeBitrateEstimator: min % of probes that must be ACKed. */
|
|
259
|
+
export declare const kProbeMinReceivedProbesPercent = 80;
|
|
260
|
+
/** libwebrtc ProbeBitrateEstimator: min % of bytes that must be ACKed. */
|
|
261
|
+
export declare const kProbeMinReceivedBytesPercent = 80;
|
|
262
|
+
/** Reject estimate if receive/send rate ratio exceeds this. */
|
|
263
|
+
export declare const kProbeMaxValidRatio = 2;
|
|
264
|
+
/** If receive < this × send, treat link as capacity-limited. */
|
|
265
|
+
export declare const kProbeMinRatioForUnsaturated = 0.9;
|
|
266
|
+
/** Target utilization when capacity-limited (slightly under receive rate). */
|
|
267
|
+
export declare const kProbeTargetUtilization = 0.95;
|
|
268
|
+
/** Max send/receive interval for a valid probe cluster (ms). */
|
|
269
|
+
export declare const kProbeMaxIntervalMs = 1000;
|
|
270
|
+
/**
|
|
271
|
+
* Min interval between recovery / further probe sessions (ms).
|
|
272
|
+
* Recovery is requested only on underuse → normal (not while still underusing);
|
|
273
|
+
* this cooldown still spaces further/recovery sessions near capacity.
|
|
274
|
+
*/
|
|
275
|
+
export declare const kProbeMinIntervalMs = 5000;
|
|
276
|
+
/**
|
|
277
|
+
* pin `kDefaultMaxProbingBitrate` (5 Mbps). Used when the application did
|
|
278
|
+
* not configure a lower max (ensureProbing default).
|
|
279
|
+
*/
|
|
280
|
+
export declare const kDefaultMaxProbingBitrateBps = 5000000;
|
|
281
|
+
/** pin `kBitrateDropThreshold` — record a large drop at this fraction. */
|
|
282
|
+
export declare const kBitrateDropThreshold = 0.66;
|
|
283
|
+
/** pin `kBitrateDropTimeout` (5s). */
|
|
284
|
+
export declare const kBitrateDropTimeoutMs = 5000;
|
|
285
|
+
/** pin `kProbeFractionAfterDrop` (0.85 × bitrate_before_last_large_drop). */
|
|
286
|
+
export declare const kProbeFractionAfterDrop = 0.85;
|
|
287
|
+
/** pin `kAlrEndedTimeout` (3s). */
|
|
288
|
+
export declare const kAlrEndedTimeoutMs = 3000;
|
|
289
|
+
/** pin `kMinTimeBetweenAlrProbes` (5s). */
|
|
290
|
+
export declare const kMinTimeBetweenAlrProbesMs = 5000;
|
|
291
|
+
/** pin `kProbeUncertainty` (0.05). Skip recovery if estimate is already close. */
|
|
292
|
+
export declare const kProbeUncertainty = 0.05;
|
|
293
|
+
/** @deprecated further-step only; recovery uses {@link kProbeFractionAfterDrop}. */
|
|
294
|
+
export declare const kProbeRecoveryScale = 1.5;
|
|
295
|
+
/** Cap further/uncapped step (not pin RequestProbe). */
|
|
296
|
+
export declare const kProbeRecoveryMaxScale = 2;
|
|
297
|
+
/**
|
|
298
|
+
* libwebrtc ProbeControllerConfig `loss_limited_probe_scale` default (1.5).
|
|
299
|
+
* When BandwidthLimitedCause is kLossLimitedBweIncreasing, InitiateProbing
|
|
300
|
+
* caps max_probe_bitrate at estimated × this scale.
|
|
301
|
+
*/
|
|
302
|
+
export declare const kLossLimitedProbeScale = 1.5;
|
|
303
|
+
/** pin AlrDetectorConfig `bandwidth_usage_ratio` (0.65). */
|
|
304
|
+
export declare const kAlrBandwidthUsageRatio = 0.65;
|
|
305
|
+
/** pin AlrDetectorConfig `start_budget_level_ratio` (0.80). */
|
|
306
|
+
export declare const kAlrStartBudgetLevelRatio = 0.8;
|
|
307
|
+
/** pin AlrDetectorConfig `stop_budget_level_ratio` (0.50). */
|
|
308
|
+
export declare const kAlrStopBudgetLevelRatio = 0.5;
|
|
309
|
+
/** pin ProbeControllerConfig `alr_interval` (5s). */
|
|
310
|
+
export declare const kAlrProbingIntervalMs = 5000;
|
|
311
|
+
/** pin ProbeControllerConfig `alr_scale` (2). */
|
|
312
|
+
export declare const kAlrProbeScale = 2;
|
|
313
|
+
/**
|
|
314
|
+
* pin ProbeControllerConfig `network_state_interval` default (+∞).
|
|
315
|
+
* Periodic NSE probes stay idle until an interval is configured.
|
|
316
|
+
*/
|
|
317
|
+
export declare const kNetworkStateEstimateProbingIntervalMs: number;
|
|
318
|
+
/** pin `est_lower_than_network_ratio` default (0). */
|
|
319
|
+
export declare const kEstimateLowerThanNetworkStateRatio = 0;
|
|
320
|
+
/** pin `est_lower_than_network_interval` default (3s). */
|
|
321
|
+
export declare const kEstimateLowerThanNetworkStateIntervalMs = 3000;
|
|
322
|
+
/** pin `network_state_scale` default (1.0). */
|
|
323
|
+
export declare const kNetworkStateProbeScale = 1;
|
|
324
|
+
/**
|
|
325
|
+
* pin LossBasedBweV2 `PaddingDuration` FieldTrial default (`Seconds(2)`).
|
|
326
|
+
* Non-zero enables `increase_using_padding` instead of `increasing`.
|
|
327
|
+
*/
|
|
328
|
+
export declare const kLossBasedPaddingDurationMs = 2000;
|
|
329
|
+
/**
|
|
330
|
+
* RTT threshold for RttBasedBackoff::IsRttAboveLimit (pin
|
|
331
|
+
* send_side_bandwidth_estimation + goog_cc_network_control):
|
|
332
|
+
* when CorrectedRtt (timeout_correction + **propagation** RTT) exceeds this,
|
|
333
|
+
* GetBandwidthLimitedCause becomes kRttBasedBackOffHighRtt and
|
|
334
|
+
* ProbeController::InitiateProbing returns no clusters.
|
|
335
|
+
* Default 3s = WebRTC-Bwe-MaxRttLimit field-trial default (`limit`).
|
|
336
|
+
* Raw max_feedback_rtt is **not** used for probe cause (CWND only in pin).
|
|
337
|
+
* SendSideBandwidthEstimation::UpdateEstimate also multiplies the target by
|
|
338
|
+
* {@link kRttBasedBackOffDropFraction} every {@link kRttBasedBackOffDropIntervalMs}
|
|
339
|
+
* down to {@link kRttBasedBackOffBandwidthFloorBps}.
|
|
340
|
+
*/
|
|
341
|
+
export declare const kRttBasedBackOffHighRttMs = 3000;
|
|
342
|
+
/** pin RttBasedBackoff `drop_fraction` default (0.8). */
|
|
343
|
+
export declare const kRttBasedBackOffDropFraction = 0.8;
|
|
344
|
+
/** pin RttBasedBackoff `drop_interval` default (1s). */
|
|
345
|
+
export declare const kRttBasedBackOffDropIntervalMs = 1000;
|
|
346
|
+
/** pin RttBasedBackoff `bandwidth_floor` default (5 kbps). */
|
|
347
|
+
export declare const kRttBasedBackOffBandwidthFloorBps = 5000;
|
|
348
|
+
/**
|
|
349
|
+
* pin kProbeDropThroughputFraction: when a valid probe result is **below** the
|
|
350
|
+
* current delay estimate, floor at acked×this so a single glitchy probe cannot
|
|
351
|
+
* crash the estimate far below observed throughput. **No matching upward cap**
|
|
352
|
+
* in pin production path — rising probes pass through to Aimd SetEstimate.
|
|
353
|
+
*/
|
|
354
|
+
export declare const kProbeDropThroughputFraction = 0.85;
|
|
355
|
+
/**
|
|
356
|
+
* RTP padding size (bytes) when RTCRtpSender injects probe padding.
|
|
357
|
+
* Must fit in a single octet (RFC 3550 last padding byte = length), so ≤255.
|
|
358
|
+
*/
|
|
359
|
+
export declare const kProbePaddingPacketBytes = 224;
|
|
360
|
+
/**
|
|
361
|
+
* Max probe padding packets per inner burst (outer loop drains remaining).
|
|
362
|
+
* Keeps event-loop responsive while still completing large clusters.
|
|
363
|
+
*/
|
|
364
|
+
export declare const kProbePaddingMaxBurst = 16;
|
|
365
|
+
/**
|
|
366
|
+
* pin `TransportFeedbackAdapter` `kSendTimeHistoryWindow` = 60s.
|
|
367
|
+
* Sent packet history (and never-ACK probe estimator maps) live this long
|
|
368
|
+
* so late TWCC can still match. Not a 2048-sequence cap.
|
|
369
|
+
*/
|
|
370
|
+
export declare const kSendTimeHistoryWindowMs = 60000;
|
|
371
|
+
/** @deprecated Use {@link kSendTimeHistoryWindowMs}. */
|
|
372
|
+
export declare const kSentInfoMaxAgeMs = 60000;
|
|
373
|
+
/**
|
|
374
|
+
* pin `GoogCcNetworkControllerFactory::GetProcessInterval`
|
|
375
|
+
* `kUpdateIntervalMs` = 25.
|
|
376
|
+
*/
|
|
377
|
+
export declare const kGoogCcProcessIntervalMs = 25;
|
|
378
|
+
/**
|
|
379
|
+
* Intentional differences vs Chromium libwebrtc goog_cc.
|
|
380
|
+
* Acceptable under the ticket's pure-TypeScript / no C++ binding constraint;
|
|
381
|
+
* algorithm structure and control response match the reference.
|
|
382
|
+
*/
|
|
383
|
+
export declare const GCC_KNOWN_DIFFERENCES: readonly ["LossBasedBweV2: byte-loss objective/derivative (UseByteLossRate), bias adjustment by loss ratio, instant upper/lower bounds, delayed-increase window, current_best_estimate_ vs loss_based_result_ (HOLD publishes min(holdRate, bounded) without rewriting the candidate model), HOLD is kDecreasing + last_hold_info_ timer (no kHold state; arm only when entering decreasing), acked-rate ramp-up cap applied after best-candidate selection (not in GetCandidates) plus 1bps decreasing→increasing nudge, state vs configured max_bitrate_ (not the 1 Gbps default); GetCandidates does not pre-clamp to configured max (Newton/objective see the window upper; final bound uses InstantUpperBound/max); bandwidth_limit_in_current_window_ starts +∞ (IsValid = Number.isFinite); IncreaseUsingPadding + CanKeepIncreasingState (pin PaddingDuration default 2s — stay in increase_using_padding while last_padding+2s >= last_send or padding_rate < estimate); GetCandidates(in_alr) skips acked-rate in ALR (NotUseAckedRateInAlr) unless padding window still open; CalculateAverageReportedByteLossRatio excludes min/max loss-rate observations when n>3 unless max-loss send rate ≥ median×2; PushBackObservation increments num_packets/size on every feedback appearance (lost map is seq-keyed); late lost→received unmarks only the current partial observation (committed observations are not rewritten); Newton/state run only after a committed observation; current_best starts uninitialized and copies delay_based_estimate_ on the first commit; GetLossBasedResult stays kDelayBasedEstimate until IsReady and returns +Infinity (not current-best) when delay is unset; SendSide UpdateEstimate (receiveTWCC / process / UpdatePacketsLost): RTT branch first; then last_fraction_loss==0 && IsInStartPhase (2s after first TransportLossReport; remains open until RR) && !ReadyToUseInStartPhase (IsReady && UseInStartPhase=true) → max(current, delay_based_limit) then return; then adopt LossBased only when IsReady; else ApplyTargetLimits. V1 RTCP-RR 8%/50% loss ramp is not ported (TWCC-only + LossBasedV2)", "No REMB integration; TWCC-only send-side mode (ticket non-goal; future work)", "Media pacing uses a lightweight token bucket at pin GetPacingRates (2.5× before first TWCC, 1.1× after); probe packets use BitrateProber next_probe_time = started_at + sent_bytes/send_bitrate (min_probe_delta 20ms initial / 2ms further; max_probe_delay 10ms discards late active clusters). 5s kProbeClusterTimeout drops queued clusters only. RTP padding injection replaces PacedSender. ProbeBitrateEstimator does not clamp to configured max (target layer does). Probe cluster id is reserved before send (PacedPacketInfo). 3x/6x queued FIFO — pacing advances on send-fill (minBytes AND minPackets), not on ACK; ProbeController result-wait (sender clock 1s) is separate from ProbeBitrateEstimator history (receive timeline 1s + sender-side kSendTimeHistoryWindowMs=60s cap matching pin TransportFeedbackAdapter) so late TWCC after controller complete can still yield estimates within the window; further after 80% still refines pending estimate; SetEstimatedBitrate further only while waiting_for_result (pin); session complete (timeout/empty queue/abort) sets min_bitrate_to_probe_further=+∞ so further cannot re-open after complete; when uncapped further/recovery/initial target ≥ max_bitrate (or cause max_probe), clamp and stop further (probe_further=false, min=+inf); SetBitrates in kProbingComplete starts a single probe at the new max when max increases and estimate < new max (pin); probe_further=false → kProbingComplete (pacing FIFO continues); unset target max is 1 Gbps and probe max is 5 Mbps; setBitrates is pin ResetConstraints — each call replaces min/max (min=0 floors at 5 kbps, non-finite/≤0 max clears the app cap; start=0 leaves current_target); ClampConstraints: min floor 5 kbps, max raised to min, start raised to min when start>0 — same triple to AIMD / LossBased / ProbeController / ApplyTargetLimits; delay_based_limit_ is +∞ until a delay-path result (all-lost TWCC does not install the start bitrate as a delay cap); SetSendBitrate(start>0) clears that limit; ProbeController.reset keeps periodic ALR / network-available / alr_start and sets last_bwe_drop_probing_time_ / time_of_last_large_drop_ to at_time (RequestProbe time_since_probe>5s and time_since_drop<5s); active clusters are never aborted mid-send by TWCC loss/overuse — update order matches pin DelayBasedBwe::MaybeUpdateEstimate: while overusing ignore probe_bitrate entirely (AIMD TimeToReduceFurther only); when not overusing apply probe SetEstimate on delay path **without upward caps** (lower results floored with acked×0.85 only); recovered_from_overuse only when no probe_bitrate this feedback and not overusing; then LossBasedBwe.update(post-probe delay) → GetBandwidthLimitedCause from **post-loss** state; underuse/overuse → forbid; CorrectedRtt (propagation + timeout) > 3s → forbid; loss decreasing/increase_using_padding → forbid; loss increasing → allow with max_probe = estimated × 1.5; delay_based → allow uncapped; recovery via pin RequestProbe (ALR or ALR-ended <3s + large drop <5s → 0.85×bitrate_before_last_large_drop, probe_further=false, 5s min between drop probes) latched on per-packet underuse→normal; AlrDetector + periodic ALR probing (alr_interval=5s, alr_scale=2) is **opt-in** (`periodicAlrProbing` constructor / EnablePeriodicAlrProbing; pin default false — not auto-enabled after first TWCC); network-state estimate path (SetNetworkStateEstimate + Process TimeForNetworkStateProbe; default interval +∞ so idle until configured); default max probe 5 Mbps (pin kDefaultMaxProbingBitrate) when the app does not set a lower cap", "AIMD ported from pin aimd_rate_control: ChangeState/ChangeBitrate, decrease = throughput×β then −5kbps if >5kbps, increase limit 1.5×throughput+10kbps, multiplicative 1.08^Δt (min +1000bps), additive via GetNearMaxIncreaseRate ((rtt+100ms)×2, min 4000bps/s), LinkCapacityEstimator (pin Reset clears estimate only; full resetAll on estimator reset); TimeToReduceFurther clamps RTT to [10,200]ms; default RTT 200ms; AIMD RTT only via RoundTripTimeConsumer.setRoundTripTime with **raw** RTCP RR RTT (pin discards smoothed updates; stats EWMA is separate) — RttBasedBackoff propagation RTT is separate (IsRttAboveLimit + ×0.8 drop then GetUpperLimit=delay/max and min_bitrate 5kbps via BandwidthEstimatorProcessor.process at pin 25ms ProcessInterval / TWCC; rtpPacketSent is pin OnSentPacket only — ALR OnBytesSent, history, first-packet UpdatePropagationRtt(send,0), OnSentPacket, probe send-fill — no UpdateEstimate / ProbeController::Process); receiveTWCC is pin OnTransportPacketsFeedback — ALR-ended first, delay only when SortedByReceiveTime is non-empty, no ProbeController::Process; ensureProbing / SetBitrates only on first ProcessInterval (not rtpPacketSent / shouldTag / padding queries); ProbeController network_available_ starts false — OnNetworkAvailability(true) from DTLS connected (or already-connected setBandwidthEstimator) starts 3x/6x; receiveTWCC MaybeTrigger only when DelayBasedBwe Result.updated (all-lost / no-timing / overuse without TimeToReduceFurther wait for ProcessInterval; probes below last delay estimate and NSE link_capacity_lower are ignored); process() first tick ensureProbing then UpdateEstimate → SetAlrStartTime → ProbeController::Process → MaybeTriggerOnNetworkChanged; high-RTT UpdateEstimate never adopts LossBased result; NetworkStateEstimate upper/lower applied in AIMD ClampBitrate when set; DelayBasedBwe kStreamTimeOut (2s) resets InterArrivalDelta + TrendlineEstimator; send history lives in the shared TwccFeedbackAdapter (pin TransportFeedbackAdapter): keyed by extended transport-wide seq, feedback unwrapped against the previous feedback (seeded by the latest sent seq), received packets leave history so re-reports are ignored, lost packets stay for a later received report; history ages out on process() as well as send (60s window) and is additionally capped to a span below 32768 sequences so a 16-bit feedback number has at most one candidate; probe seq maps key by the same extended seq", "Acknowledged bitrate uses RobustThroughputEstimator defaults (window_packets=20, min_duration=1s, required_packets=10, largest-gap replace); Bayesian BitrateEstimator kept as utility; SetAlr/SetAlrEndedTime are no-ops on the Robust path (pin RobustThroughputEstimator)", "TWCC 24-bit reference_time is unwrapped across feedbacks in TwccFeedbackAdapter (continuous ms timeline); packetResults alone still report raw wrap-relative times; ReceiverTWCC is a dumb receiver without libwebrtc RemoteEstimatorProxy re-send on reordering (a packet arriving after its sequence was reported stays reported as lost)", "Probe / loss padding is padding-only RTP on the negotiated RTX SSRC / payload type (RTX sequence space). Without RTX no padding is sent at all (libwebrtc can fall back to media-SSRC padding): probe clusters are then filled by media only and loss-based increase_using_padding has no padding to send. Media sequence numbers are never shifted by padding", "Floating-point / wall-clock differences may cause sub-bps numerical drift vs C++ (not bit-identical to libwebrtc public test vectors)", "InterArrivalDelta: reordered-reset / arrival−system offset (>=3000ms) ported; production passes feedback_time as system_time", "Transport-wide sequence is a monotonic extended counter on the DTLS transport (wire is 16-bit). ReceiverTWCC and TWCC RTCP fan-out are per DTLS transport; BWE instances remain per RTCRtpSender (each estimator matches only its own SentInfo, keyed by extended TSN). Transport-level GCC/pacer allocation is a non-goal", "OveruseDetector class is unused at runtime (TrendlineEstimator::Detect owns hypothesis); BandwidthUsage type is shared"];
|