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,408 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* Portions of this file are ported from libwebrtc
|
|
4
|
+
* (https://webrtc.googlesource.com/src, commit 0fda16159e33adf59c71a7ad1173dcbe5a632102).
|
|
5
|
+
* Copyright (c) 2011, The WebRTC project authors. All rights reserved.
|
|
6
|
+
* Use of that source is governed by a BSD-style license and an additional
|
|
7
|
+
* patent grant; both are reproduced in THIRD_PARTY_LICENSES_LIBWEBRTC.txt
|
|
8
|
+
* (shipped with this package).
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Named constants for Google Congestion Control (GCC).
|
|
12
|
+
*
|
|
13
|
+
* Prefer **libwebrtc goog_cc** runtime defaults when draft-ietf-rmcat-gcc and
|
|
14
|
+
* Chromium diverge.
|
|
15
|
+
*
|
|
16
|
+
* Known intentional differences: {@link GCC_KNOWN_DIFFERENCES}.
|
|
17
|
+
*/
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.kLossBasedRampupUpperBoundInHoldFactor = exports.kLossBasedRampupUpperBoundFactor = exports.kLossBasedTemporalWeightFactor = exports.kLossBasedHigherLogBwBiasFactor = exports.kLossBasedHigherBwBiasFactor = exports.kLossBasedNewtonStepSize = exports.kLossBasedNewtonIterations = exports.kLossBasedInitialInherentLoss = exports.kLossBasedInherentLossUpperBoundBwBalanceBps = exports.kLossBasedInherentLossUpperBoundOffset = exports.kLossBasedInherentLossLowerBound = exports.kLossBasedCandidateFactors = exports.kLossBasedUseInStartPhase = exports.kLossBasedMinNumObservations = exports.kLossBasedObservationDurationLowerBoundMs = exports.kLossBasedObservationWindow = exports.kRobustRequiredPackets = exports.kRobustMaxWindowDurationMs = exports.kRobustMinWindowDurationMs = exports.kRobustMaxWindowPackets = exports.kRobustWindowPackets = exports.kAimdThroughputUpperOffsetBps = exports.kAimdMinMultiplicativeIncreaseBps = exports.kAimdMinIncreaseRateBpsPerSecond = exports.kAimdDecreaseOffsetBps = exports.kThroughputLowerFraction = exports.kDefaultRttMs = exports.kBitrateWindowMs = exports.kReactionTimeMs = exports.kMultiplicativeIncreaseFactor = exports.kBeta = exports.kMaxAdaptOffsetMs = exports.kThresholdGainDown = exports.kThresholdGainUp = exports.kOveruseTimeThresholdMs = exports.kMaxThresholdMs = exports.kMinThresholdMs = exports.kInitialThresholdMs = exports.kTrendlineDeltaCounterMax = exports.kTrendlineMinNumDeltas = exports.kTrendlineThresholdGain = exports.kTrendlineSmoothingCoeff = exports.kTrendlineWindowSize = exports.kStreamTimeOutMs = exports.kBurstTimeMs = exports.kMaxBitrateBps = exports.kMinBitrateBps = exports.kStartPhaseLossReportMinPackets = exports.kStartPhaseMs = exports.kDefaultStartBitrateBps = void 0;
|
|
20
|
+
exports.kMinTimeBetweenAlrProbesMs = exports.kAlrEndedTimeoutMs = exports.kProbeFractionAfterDrop = exports.kBitrateDropTimeoutMs = exports.kBitrateDropThreshold = exports.kDefaultMaxProbingBitrateBps = exports.kProbeMinIntervalMs = exports.kProbeMaxIntervalMs = exports.kProbeTargetUtilization = exports.kProbeMinRatioForUnsaturated = exports.kProbeMaxValidRatio = exports.kProbeMinReceivedBytesPercent = exports.kProbeMinReceivedProbesPercent = exports.kProbeResultTimeoutMs = exports.kProbePacingTimeoutMs = exports.kProbeMinPackets = exports.kProbeMinDurationMs = exports.kFurtherProbeThreshold = exports.kFurtherProbeStepMultiplier = exports.kProbeBitrateMultipliers = exports.kMaxPendingProbeClusters = exports.kMaxProbeDelayMs = exports.kInitialMinProbeDeltaMs = exports.kMinProbeDeltaMs = exports.kDefaultPaceMultiplierWithSendSideBwe = exports.kDefaultPaceMultiplier = exports.kLossIncreaseFactor = exports.kLossBasedBackoffFactor = exports.kLossBasedIncreaseFactor = exports.kLossDecreaseThreshold = exports.kLossIncreaseThreshold = exports.kLossBasedMedianSendingRateFactor = exports.kLossBasedNotUseAckedRateInAlr = exports.kLossBasedNotIncreaseIfInherentLessThanAverage = exports.kLossBasedBoundBestCandidate = exports.kLossBasedMaxHoldDurationMs = exports.kLossBasedInitHoldDurationMs = exports.kLossBasedHoldDurationFactor = exports.kLossBasedMaxIncreaseFactor = exports.kLossBasedDelayedIncreaseWindowMs = exports.kLossBasedBandwidthBackoffLowerBoundFactor = exports.kLossBasedSendingRateSmoothingFactor = exports.kLossBasedLowerBoundByAckedRateFactor = exports.kLossBasedInstantUpperBoundTemporalWeightFactor = exports.kLossBasedInstantUpperBoundLossOffset = exports.kLossBasedInstantUpperBoundBwBalanceBps = exports.kLossBasedBandwidthPreferenceSmoothingFactor = exports.kLossBasedLossThresholdOfHighBandwidthPreference = exports.kLossBasedUseByteLossRate = exports.kLossBasedRampupUpperBoundHoldThreshold = void 0;
|
|
21
|
+
exports.GCC_KNOWN_DIFFERENCES = exports.kGoogCcProcessIntervalMs = exports.kSentInfoMaxAgeMs = exports.kSendTimeHistoryWindowMs = exports.kProbePaddingMaxBurst = exports.kProbePaddingPacketBytes = exports.kProbeDropThroughputFraction = exports.kRttBasedBackOffBandwidthFloorBps = exports.kRttBasedBackOffDropIntervalMs = exports.kRttBasedBackOffDropFraction = exports.kRttBasedBackOffHighRttMs = exports.kLossBasedPaddingDurationMs = exports.kNetworkStateProbeScale = exports.kEstimateLowerThanNetworkStateIntervalMs = exports.kEstimateLowerThanNetworkStateRatio = exports.kNetworkStateEstimateProbingIntervalMs = exports.kAlrProbeScale = exports.kAlrProbingIntervalMs = exports.kAlrStopBudgetLevelRatio = exports.kAlrStartBudgetLevelRatio = exports.kAlrBandwidthUsageRatio = exports.kLossLimitedProbeScale = exports.kProbeRecoveryMaxScale = exports.kProbeRecoveryScale = exports.kProbeUncertainty = void 0;
|
|
22
|
+
/** Initial / fallback start bitrate (libwebrtc default ~300 kbps). */
|
|
23
|
+
exports.kDefaultStartBitrateBps = 300000;
|
|
24
|
+
/**
|
|
25
|
+
* pin `SendSideBandwidthEstimation` `kStartPhase` = 2s.
|
|
26
|
+
* Startup delay/REMB trust (`last_fraction_loss_ == 0`) lasts until this
|
|
27
|
+
* window after the first {@link GccBandwidthEstimator.updatePacketsLost}
|
|
28
|
+
* (RTCP TransportLossReport). With no RR, first_report_time stays infinite
|
|
29
|
+
* and the start phase remains open until LossBasedV2 is ready.
|
|
30
|
+
*/
|
|
31
|
+
exports.kStartPhaseMs = 2000;
|
|
32
|
+
/**
|
|
33
|
+
* pin `UpdatePacketsLost` `kLimitNumPackets` = 20.
|
|
34
|
+
* Fraction-loss is not published until this many packets accumulate.
|
|
35
|
+
*/
|
|
36
|
+
exports.kStartPhaseLossReportMinPackets = 20;
|
|
37
|
+
/**
|
|
38
|
+
* pin `kCongestionControllerMinBitrate` (bwe_defines.h) = 5 kbps.
|
|
39
|
+
* Auditable via third_party/libwebrtc-ref snapshot.
|
|
40
|
+
*/
|
|
41
|
+
exports.kMinBitrateBps = 5000;
|
|
42
|
+
exports.kMaxBitrateBps = 1000000000;
|
|
43
|
+
/** Burst grouping window for inter-arrival pre-filter (ms). */
|
|
44
|
+
exports.kBurstTimeMs = 5;
|
|
45
|
+
/**
|
|
46
|
+
* Delay-based stream idle timeout (ms).
|
|
47
|
+
* libwebrtc `DelayBasedBwe::kStreamTimeOut` = 2s — reset InterArrivalDelta +
|
|
48
|
+
* TrendlineEstimator when no packet feedback arrives for this long.
|
|
49
|
+
*/
|
|
50
|
+
exports.kStreamTimeOutMs = 2000;
|
|
51
|
+
// --- TrendlineEstimator (libwebrtc trendline_estimator.cc) ---
|
|
52
|
+
/**
|
|
53
|
+
* Default window size in packets
|
|
54
|
+
* (`TrendlineEstimatorSettings::kDefaultTrendlineWindowSize` = 20).
|
|
55
|
+
* Slope is only recomputed when the window is full.
|
|
56
|
+
*/
|
|
57
|
+
exports.kTrendlineWindowSize = 20;
|
|
58
|
+
/** Exponential smoothing coefficient for accumulated delay. */
|
|
59
|
+
exports.kTrendlineSmoothingCoeff = 0.9;
|
|
60
|
+
/**
|
|
61
|
+
* Gain applied as `min(num_deltas, kMinNumDeltas) * trend * gain`
|
|
62
|
+
* before comparing to the adaptive threshold.
|
|
63
|
+
*/
|
|
64
|
+
exports.kTrendlineThresholdGain = 4.0;
|
|
65
|
+
/**
|
|
66
|
+
* Cap used in modified_trend: `min(num_of_deltas, kMinNumDeltas)`.
|
|
67
|
+
* libwebrtc: kMinNumDeltas = 60.
|
|
68
|
+
*/
|
|
69
|
+
exports.kTrendlineMinNumDeltas = 60;
|
|
70
|
+
/** libwebrtc caps num_of_deltas_ at this value. */
|
|
71
|
+
exports.kTrendlineDeltaCounterMax = 1000;
|
|
72
|
+
// --- Overuse detector (libwebrtc TrendlineEstimator::Detect / UpdateThreshold) ---
|
|
73
|
+
exports.kInitialThresholdMs = 12.5;
|
|
74
|
+
exports.kMinThresholdMs = 6;
|
|
75
|
+
exports.kMaxThresholdMs = 600;
|
|
76
|
+
exports.kOveruseTimeThresholdMs = 10;
|
|
77
|
+
/** libwebrtc k_up_ / k_down_ for adaptive threshold (not draft K_u / K_d). */
|
|
78
|
+
exports.kThresholdGainUp = 0.0087;
|
|
79
|
+
exports.kThresholdGainDown = 0.039;
|
|
80
|
+
exports.kMaxAdaptOffsetMs = 15;
|
|
81
|
+
// --- AIMD (pin aimd_rate_control.cc) ---
|
|
82
|
+
/** Multiplicative decrease factor (pin kDefaultBackoffFactor / beta_ = 0.85). */
|
|
83
|
+
exports.kBeta = 0.85;
|
|
84
|
+
/** Multiplicative increase base per second (pin alpha = 1.08). */
|
|
85
|
+
exports.kMultiplicativeIncreaseFactor = 1.08;
|
|
86
|
+
/**
|
|
87
|
+
* Extra delay added to RTT for near-max additive response time
|
|
88
|
+
* (pin: response_time = (rtt + 100ms) * 2).
|
|
89
|
+
*/
|
|
90
|
+
exports.kReactionTimeMs = 100;
|
|
91
|
+
exports.kBitrateWindowMs = 1000;
|
|
92
|
+
/**
|
|
93
|
+
* pin `kDefaultRtt` = 200ms. AIMD RTT is **not** TWCC propagation RTT;
|
|
94
|
+
* only OnRoundTripTimeUpdate / RTCP RR path updates it via setRtt.
|
|
95
|
+
*/
|
|
96
|
+
exports.kDefaultRttMs = 200;
|
|
97
|
+
/**
|
|
98
|
+
* TimeToReduceFurther throughput check: estimated_throughput < 0.5 * estimate.
|
|
99
|
+
*/
|
|
100
|
+
exports.kThroughputLowerFraction = 0.5;
|
|
101
|
+
/**
|
|
102
|
+
* Subtracted from beta * throughput on overuse when result > 5 kbps
|
|
103
|
+
* (pin: decreased_bitrate -= 5 kbps).
|
|
104
|
+
*/
|
|
105
|
+
exports.kAimdDecreaseOffsetBps = 5000;
|
|
106
|
+
/**
|
|
107
|
+
* Additive increase floor (pin kMinIncreaseRateBpsPerSecond = 4000).
|
|
108
|
+
*/
|
|
109
|
+
exports.kAimdMinIncreaseRateBpsPerSecond = 4000;
|
|
110
|
+
/**
|
|
111
|
+
* Multiplicative increase floor per update (pin BitsPerSec(1000)).
|
|
112
|
+
*/
|
|
113
|
+
exports.kAimdMinMultiplicativeIncreaseBps = 1000;
|
|
114
|
+
/**
|
|
115
|
+
* Throughput upper bound offset on increase (pin + 10 kbps).
|
|
116
|
+
*/
|
|
117
|
+
exports.kAimdThroughputUpperOffsetBps = 10000;
|
|
118
|
+
// --- Acknowledged bitrate (libwebrtc RobustThroughputEstimator defaults) ---
|
|
119
|
+
// Pin: RobustThroughputEstimatorSettings.enabled = true
|
|
120
|
+
/** Min packets to form a window (window_packets = 20). */
|
|
121
|
+
exports.kRobustWindowPackets = 20;
|
|
122
|
+
/** Hard cap on packets retained (max_window_packets = 500). */
|
|
123
|
+
exports.kRobustMaxWindowPackets = 500;
|
|
124
|
+
/** Min window duration once packet count is met (min_window_duration = 1s). */
|
|
125
|
+
exports.kRobustMinWindowDurationMs = 1000;
|
|
126
|
+
/** Max window duration (max_window_duration = 5s). */
|
|
127
|
+
exports.kRobustMaxWindowDurationMs = 5000;
|
|
128
|
+
/** Min packets before producing an estimate (required_packets = 10). */
|
|
129
|
+
exports.kRobustRequiredPackets = 10;
|
|
130
|
+
// --- Loss-based (libwebrtc LossBasedBweV2 field-trial defaults, lkgr) ---
|
|
131
|
+
/** ObservationWindowSize default 15. */
|
|
132
|
+
exports.kLossBasedObservationWindow = 15;
|
|
133
|
+
/**
|
|
134
|
+
* Min observation duration before a partial window is committed (ms).
|
|
135
|
+
* libwebrtc `ObservationDurationLowerBound` default 250ms.
|
|
136
|
+
*/
|
|
137
|
+
exports.kLossBasedObservationDurationLowerBoundMs = 250;
|
|
138
|
+
/**
|
|
139
|
+
* Min committed observations before estimates are used.
|
|
140
|
+
* libwebrtc readiness uses delayed start after several observations (3).
|
|
141
|
+
*/
|
|
142
|
+
exports.kLossBasedMinNumObservations = 3;
|
|
143
|
+
/**
|
|
144
|
+
* pin LossBasedBweV2 `UseInStartPhase` FieldTrial default (`true`).
|
|
145
|
+
* When ready, LossBased replaces the 2s delay-based startup ramp.
|
|
146
|
+
*/
|
|
147
|
+
exports.kLossBasedUseInStartPhase = true;
|
|
148
|
+
/** CandidateFactors default {1.02, 1.0, 0.95}. */
|
|
149
|
+
exports.kLossBasedCandidateFactors = [1.02, 1.0, 0.95];
|
|
150
|
+
exports.kLossBasedInherentLossLowerBound = 1e-3;
|
|
151
|
+
exports.kLossBasedInherentLossUpperBoundOffset = 0.05;
|
|
152
|
+
/** InherentLossUpperBoundBwBalance default 100 kbps. */
|
|
153
|
+
exports.kLossBasedInherentLossUpperBoundBwBalanceBps = 100000;
|
|
154
|
+
exports.kLossBasedInitialInherentLoss = 0.01;
|
|
155
|
+
exports.kLossBasedNewtonIterations = 1;
|
|
156
|
+
/** NewtonStepSize default 0.75. */
|
|
157
|
+
exports.kLossBasedNewtonStepSize = 0.75;
|
|
158
|
+
/** HigherBandwidthBiasFactor default 0.0002. */
|
|
159
|
+
exports.kLossBasedHigherBwBiasFactor = 0.0002;
|
|
160
|
+
/** HigherLogBandwidthBiasFactor default 0.02. */
|
|
161
|
+
exports.kLossBasedHigherLogBwBiasFactor = 0.02;
|
|
162
|
+
/** TemporalWeightFactor default 0.9. */
|
|
163
|
+
exports.kLossBasedTemporalWeightFactor = 0.9;
|
|
164
|
+
/** BwRampupUpperBoundFactor default 1.5. */
|
|
165
|
+
exports.kLossBasedRampupUpperBoundFactor = 1.5;
|
|
166
|
+
/**
|
|
167
|
+
* When acknowledged rate has not yet recovered past holdRate × threshold,
|
|
168
|
+
* use a more cautious ramp-up (libwebrtc BwRampupUpperBoundInHoldFactor).
|
|
169
|
+
*/
|
|
170
|
+
exports.kLossBasedRampupUpperBoundInHoldFactor = 1.2;
|
|
171
|
+
/** BwRampupUpperBoundHoldThreshold default 1.3. */
|
|
172
|
+
exports.kLossBasedRampupUpperBoundHoldThreshold = 1.3;
|
|
173
|
+
/**
|
|
174
|
+
* UseByteLossRate default true — objective/derivative use lost/received **bytes**.
|
|
175
|
+
*/
|
|
176
|
+
exports.kLossBasedUseByteLossRate = true;
|
|
177
|
+
/** LossThresholdOfHighBandwidthPreference default 0.2. */
|
|
178
|
+
exports.kLossBasedLossThresholdOfHighBandwidthPreference = 0.2;
|
|
179
|
+
/** BandwidthPreferenceSmoothingFactor default 0.002. */
|
|
180
|
+
exports.kLossBasedBandwidthPreferenceSmoothingFactor = 0.002;
|
|
181
|
+
/** InstantUpperBoundBwBalance default 100 kbps. */
|
|
182
|
+
exports.kLossBasedInstantUpperBoundBwBalanceBps = 100000;
|
|
183
|
+
/** InstantUpperBoundLossOffset default 0.05. */
|
|
184
|
+
exports.kLossBasedInstantUpperBoundLossOffset = 0.05;
|
|
185
|
+
/** InstantUpperBoundTemporalWeightFactor default 0.9. */
|
|
186
|
+
exports.kLossBasedInstantUpperBoundTemporalWeightFactor = 0.9;
|
|
187
|
+
/** LowerBoundByAckedRateFactor default 1.0. */
|
|
188
|
+
exports.kLossBasedLowerBoundByAckedRateFactor = 1.0;
|
|
189
|
+
/** SendingRateSmoothingFactor default 0.0 — no smoothing. */
|
|
190
|
+
exports.kLossBasedSendingRateSmoothingFactor = 0;
|
|
191
|
+
/**
|
|
192
|
+
* BwBackoffLowerBoundFactor default 1.0.
|
|
193
|
+
* Applied to the acknowledged-rate candidate in GetCandidates.
|
|
194
|
+
*/
|
|
195
|
+
exports.kLossBasedBandwidthBackoffLowerBoundFactor = 1;
|
|
196
|
+
/** DelayedIncreaseWindow default 300ms. */
|
|
197
|
+
exports.kLossBasedDelayedIncreaseWindowMs = 300;
|
|
198
|
+
/** MaxIncreaseFactor default 1.3. */
|
|
199
|
+
exports.kLossBasedMaxIncreaseFactor = 1.3;
|
|
200
|
+
/** HoldDurationFactor default 3.0 in some builds; field trial default 2.0. */
|
|
201
|
+
exports.kLossBasedHoldDurationFactor = 2.0;
|
|
202
|
+
/** Initial HOLD duration (ms). libwebrtc kInitHoldDuration = 300ms. */
|
|
203
|
+
exports.kLossBasedInitHoldDurationMs = 300;
|
|
204
|
+
/** Max HOLD duration (ms). libwebrtc kMaxHoldDuration = 60s. */
|
|
205
|
+
exports.kLossBasedMaxHoldDurationMs = 60000;
|
|
206
|
+
/** BoundBestCandidate default true. */
|
|
207
|
+
exports.kLossBasedBoundBestCandidate = true;
|
|
208
|
+
/** NotIncreaseIfInherentLossLessThanAverageLoss default true. */
|
|
209
|
+
exports.kLossBasedNotIncreaseIfInherentLessThanAverage = true;
|
|
210
|
+
/** NotUseAckedRateInAlr default true. */
|
|
211
|
+
exports.kLossBasedNotUseAckedRateInAlr = true;
|
|
212
|
+
/** MedianSendingRateFactor default 2.0 (byte-loss spike filter). */
|
|
213
|
+
exports.kLossBasedMedianSendingRateFactor = 2;
|
|
214
|
+
/** Legacy names kept for tests. */
|
|
215
|
+
exports.kLossIncreaseThreshold = 0.02;
|
|
216
|
+
exports.kLossDecreaseThreshold = 0.1;
|
|
217
|
+
exports.kLossBasedIncreaseFactor = 1.02;
|
|
218
|
+
exports.kLossBasedBackoffFactor = 0.5;
|
|
219
|
+
exports.kLossIncreaseFactor = exports.kLossBasedIncreaseFactor;
|
|
220
|
+
// --- ProbeController ---
|
|
221
|
+
/**
|
|
222
|
+
* pin `kDefaultPaceMultiplier` — used until the first transport feedback
|
|
223
|
+
* (`first_transport_feedback_received_ == false`).
|
|
224
|
+
*/
|
|
225
|
+
exports.kDefaultPaceMultiplier = 2.5;
|
|
226
|
+
/**
|
|
227
|
+
* pin `kDefaultPaceMultiplierWithSendSideBwe` — after first TWCC
|
|
228
|
+
* (send-side BWE is active).
|
|
229
|
+
*/
|
|
230
|
+
exports.kDefaultPaceMultiplierWithSendSideBwe = 1.1;
|
|
231
|
+
/**
|
|
232
|
+
* pin ProbeControllerConfig `min_probe_delta` default (2ms).
|
|
233
|
+
* Inter-burst spacing after the initial exponential session.
|
|
234
|
+
*/
|
|
235
|
+
exports.kMinProbeDeltaMs = 2;
|
|
236
|
+
/**
|
|
237
|
+
* pin ProbeControllerConfig `initial_min_probe_delta` default (20ms).
|
|
238
|
+
* Used for the first 3x/6x exponential clusters.
|
|
239
|
+
*/
|
|
240
|
+
exports.kInitialMinProbeDeltaMs = 20;
|
|
241
|
+
/**
|
|
242
|
+
* pin BitrateProberConfig `max_probe_delay` default (10ms).
|
|
243
|
+
* An active cluster whose next_probe_time is this late is discarded.
|
|
244
|
+
*/
|
|
245
|
+
exports.kMaxProbeDelayMs = 10;
|
|
246
|
+
/**
|
|
247
|
+
* pin BitrateProber `kMaxPendingProbeClusters`.
|
|
248
|
+
*/
|
|
249
|
+
exports.kMaxPendingProbeClusters = 5;
|
|
250
|
+
/** Initial exponential probe steps: start×3, start×6. */
|
|
251
|
+
exports.kProbeBitrateMultipliers = [3, 6];
|
|
252
|
+
/** Further probes after success use ×2 (libwebrtc further probe step). */
|
|
253
|
+
exports.kFurtherProbeStepMultiplier = 2;
|
|
254
|
+
exports.kFurtherProbeThreshold = 0.7;
|
|
255
|
+
exports.kProbeMinDurationMs = 15;
|
|
256
|
+
exports.kProbeMinPackets = 5;
|
|
257
|
+
/**
|
|
258
|
+
* pin BitrateProber `kProbeClusterTimeout` (5s).
|
|
259
|
+
* Drops **queued** (not yet activated) clusters whose `requested_at` is
|
|
260
|
+
* older than this. Not an active-packet scheduling budget — late active
|
|
261
|
+
* clusters are discarded via {@link kMaxProbeDelayMs} instead.
|
|
262
|
+
*/
|
|
263
|
+
exports.kProbePacingTimeoutMs = 5000;
|
|
264
|
+
/**
|
|
265
|
+
* ProbeController result-wait timeout (ms).
|
|
266
|
+
* After send-fill, waiting for TWCC/result validation uses this (libwebrtc ≈ 1s).
|
|
267
|
+
* Also used as ProbeBitrateEstimator cluster history horizon.
|
|
268
|
+
*/
|
|
269
|
+
exports.kProbeResultTimeoutMs = 1000;
|
|
270
|
+
/** libwebrtc ProbeBitrateEstimator: min % of probes that must be ACKed. */
|
|
271
|
+
exports.kProbeMinReceivedProbesPercent = 80;
|
|
272
|
+
/** libwebrtc ProbeBitrateEstimator: min % of bytes that must be ACKed. */
|
|
273
|
+
exports.kProbeMinReceivedBytesPercent = 80;
|
|
274
|
+
/** Reject estimate if receive/send rate ratio exceeds this. */
|
|
275
|
+
exports.kProbeMaxValidRatio = 2.0;
|
|
276
|
+
/** If receive < this × send, treat link as capacity-limited. */
|
|
277
|
+
exports.kProbeMinRatioForUnsaturated = 0.9;
|
|
278
|
+
/** Target utilization when capacity-limited (slightly under receive rate). */
|
|
279
|
+
exports.kProbeTargetUtilization = 0.95;
|
|
280
|
+
/** Max send/receive interval for a valid probe cluster (ms). */
|
|
281
|
+
exports.kProbeMaxIntervalMs = 1000;
|
|
282
|
+
/**
|
|
283
|
+
* Min interval between recovery / further probe sessions (ms).
|
|
284
|
+
* Recovery is requested only on underuse → normal (not while still underusing);
|
|
285
|
+
* this cooldown still spaces further/recovery sessions near capacity.
|
|
286
|
+
*/
|
|
287
|
+
exports.kProbeMinIntervalMs = 5000;
|
|
288
|
+
/**
|
|
289
|
+
* pin `kDefaultMaxProbingBitrate` (5 Mbps). Used when the application did
|
|
290
|
+
* not configure a lower max (ensureProbing default).
|
|
291
|
+
*/
|
|
292
|
+
exports.kDefaultMaxProbingBitrateBps = 5000000;
|
|
293
|
+
/** pin `kBitrateDropThreshold` — record a large drop at this fraction. */
|
|
294
|
+
exports.kBitrateDropThreshold = 0.66;
|
|
295
|
+
/** pin `kBitrateDropTimeout` (5s). */
|
|
296
|
+
exports.kBitrateDropTimeoutMs = 5000;
|
|
297
|
+
/** pin `kProbeFractionAfterDrop` (0.85 × bitrate_before_last_large_drop). */
|
|
298
|
+
exports.kProbeFractionAfterDrop = 0.85;
|
|
299
|
+
/** pin `kAlrEndedTimeout` (3s). */
|
|
300
|
+
exports.kAlrEndedTimeoutMs = 3000;
|
|
301
|
+
/** pin `kMinTimeBetweenAlrProbes` (5s). */
|
|
302
|
+
exports.kMinTimeBetweenAlrProbesMs = 5000;
|
|
303
|
+
/** pin `kProbeUncertainty` (0.05). Skip recovery if estimate is already close. */
|
|
304
|
+
exports.kProbeUncertainty = 0.05;
|
|
305
|
+
/** @deprecated further-step only; recovery uses {@link kProbeFractionAfterDrop}. */
|
|
306
|
+
exports.kProbeRecoveryScale = 1.5;
|
|
307
|
+
/** Cap further/uncapped step (not pin RequestProbe). */
|
|
308
|
+
exports.kProbeRecoveryMaxScale = 2.0;
|
|
309
|
+
/**
|
|
310
|
+
* libwebrtc ProbeControllerConfig `loss_limited_probe_scale` default (1.5).
|
|
311
|
+
* When BandwidthLimitedCause is kLossLimitedBweIncreasing, InitiateProbing
|
|
312
|
+
* caps max_probe_bitrate at estimated × this scale.
|
|
313
|
+
*/
|
|
314
|
+
exports.kLossLimitedProbeScale = 1.5;
|
|
315
|
+
/** pin AlrDetectorConfig `bandwidth_usage_ratio` (0.65). */
|
|
316
|
+
exports.kAlrBandwidthUsageRatio = 0.65;
|
|
317
|
+
/** pin AlrDetectorConfig `start_budget_level_ratio` (0.80). */
|
|
318
|
+
exports.kAlrStartBudgetLevelRatio = 0.8;
|
|
319
|
+
/** pin AlrDetectorConfig `stop_budget_level_ratio` (0.50). */
|
|
320
|
+
exports.kAlrStopBudgetLevelRatio = 0.5;
|
|
321
|
+
/** pin ProbeControllerConfig `alr_interval` (5s). */
|
|
322
|
+
exports.kAlrProbingIntervalMs = 5000;
|
|
323
|
+
/** pin ProbeControllerConfig `alr_scale` (2). */
|
|
324
|
+
exports.kAlrProbeScale = 2;
|
|
325
|
+
/**
|
|
326
|
+
* pin ProbeControllerConfig `network_state_interval` default (+∞).
|
|
327
|
+
* Periodic NSE probes stay idle until an interval is configured.
|
|
328
|
+
*/
|
|
329
|
+
exports.kNetworkStateEstimateProbingIntervalMs = Number.POSITIVE_INFINITY;
|
|
330
|
+
/** pin `est_lower_than_network_ratio` default (0). */
|
|
331
|
+
exports.kEstimateLowerThanNetworkStateRatio = 0;
|
|
332
|
+
/** pin `est_lower_than_network_interval` default (3s). */
|
|
333
|
+
exports.kEstimateLowerThanNetworkStateIntervalMs = 3000;
|
|
334
|
+
/** pin `network_state_scale` default (1.0). */
|
|
335
|
+
exports.kNetworkStateProbeScale = 1;
|
|
336
|
+
/**
|
|
337
|
+
* pin LossBasedBweV2 `PaddingDuration` FieldTrial default (`Seconds(2)`).
|
|
338
|
+
* Non-zero enables `increase_using_padding` instead of `increasing`.
|
|
339
|
+
*/
|
|
340
|
+
exports.kLossBasedPaddingDurationMs = 2000;
|
|
341
|
+
/**
|
|
342
|
+
* RTT threshold for RttBasedBackoff::IsRttAboveLimit (pin
|
|
343
|
+
* send_side_bandwidth_estimation + goog_cc_network_control):
|
|
344
|
+
* when CorrectedRtt (timeout_correction + **propagation** RTT) exceeds this,
|
|
345
|
+
* GetBandwidthLimitedCause becomes kRttBasedBackOffHighRtt and
|
|
346
|
+
* ProbeController::InitiateProbing returns no clusters.
|
|
347
|
+
* Default 3s = WebRTC-Bwe-MaxRttLimit field-trial default (`limit`).
|
|
348
|
+
* Raw max_feedback_rtt is **not** used for probe cause (CWND only in pin).
|
|
349
|
+
* SendSideBandwidthEstimation::UpdateEstimate also multiplies the target by
|
|
350
|
+
* {@link kRttBasedBackOffDropFraction} every {@link kRttBasedBackOffDropIntervalMs}
|
|
351
|
+
* down to {@link kRttBasedBackOffBandwidthFloorBps}.
|
|
352
|
+
*/
|
|
353
|
+
exports.kRttBasedBackOffHighRttMs = 3000;
|
|
354
|
+
/** pin RttBasedBackoff `drop_fraction` default (0.8). */
|
|
355
|
+
exports.kRttBasedBackOffDropFraction = 0.8;
|
|
356
|
+
/** pin RttBasedBackoff `drop_interval` default (1s). */
|
|
357
|
+
exports.kRttBasedBackOffDropIntervalMs = 1000;
|
|
358
|
+
/** pin RttBasedBackoff `bandwidth_floor` default (5 kbps). */
|
|
359
|
+
exports.kRttBasedBackOffBandwidthFloorBps = 5000;
|
|
360
|
+
/**
|
|
361
|
+
* pin kProbeDropThroughputFraction: when a valid probe result is **below** the
|
|
362
|
+
* current delay estimate, floor at acked×this so a single glitchy probe cannot
|
|
363
|
+
* crash the estimate far below observed throughput. **No matching upward cap**
|
|
364
|
+
* in pin production path — rising probes pass through to Aimd SetEstimate.
|
|
365
|
+
*/
|
|
366
|
+
exports.kProbeDropThroughputFraction = 0.85;
|
|
367
|
+
/**
|
|
368
|
+
* RTP padding size (bytes) when RTCRtpSender injects probe padding.
|
|
369
|
+
* Must fit in a single octet (RFC 3550 last padding byte = length), so ≤255.
|
|
370
|
+
*/
|
|
371
|
+
exports.kProbePaddingPacketBytes = 224;
|
|
372
|
+
/**
|
|
373
|
+
* Max probe padding packets per inner burst (outer loop drains remaining).
|
|
374
|
+
* Keeps event-loop responsive while still completing large clusters.
|
|
375
|
+
*/
|
|
376
|
+
exports.kProbePaddingMaxBurst = 16;
|
|
377
|
+
/**
|
|
378
|
+
* pin `TransportFeedbackAdapter` `kSendTimeHistoryWindow` = 60s.
|
|
379
|
+
* Sent packet history (and never-ACK probe estimator maps) live this long
|
|
380
|
+
* so late TWCC can still match. Not a 2048-sequence cap.
|
|
381
|
+
*/
|
|
382
|
+
exports.kSendTimeHistoryWindowMs = 60000;
|
|
383
|
+
/** @deprecated Use {@link kSendTimeHistoryWindowMs}. */
|
|
384
|
+
exports.kSentInfoMaxAgeMs = exports.kSendTimeHistoryWindowMs;
|
|
385
|
+
/**
|
|
386
|
+
* pin `GoogCcNetworkControllerFactory::GetProcessInterval`
|
|
387
|
+
* `kUpdateIntervalMs` = 25.
|
|
388
|
+
*/
|
|
389
|
+
exports.kGoogCcProcessIntervalMs = 25;
|
|
390
|
+
/**
|
|
391
|
+
* Intentional differences vs Chromium libwebrtc goog_cc.
|
|
392
|
+
* Acceptable under the ticket's pure-TypeScript / no C++ binding constraint;
|
|
393
|
+
* algorithm structure and control response match the reference.
|
|
394
|
+
*/
|
|
395
|
+
exports.GCC_KNOWN_DIFFERENCES = [
|
|
396
|
+
"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)",
|
|
397
|
+
"No REMB integration; TWCC-only send-side mode (ticket non-goal; future work)",
|
|
398
|
+
"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",
|
|
399
|
+
"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",
|
|
400
|
+
"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)",
|
|
401
|
+
"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)",
|
|
402
|
+
"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",
|
|
403
|
+
"Floating-point / wall-clock differences may cause sub-bps numerical drift vs C++ (not bit-identical to libwebrtc public test vectors)",
|
|
404
|
+
"InterArrivalDelta: reordered-reset / arrival−system offset (>=3000ms) ported; production passes feedback_time as system_time",
|
|
405
|
+
"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",
|
|
406
|
+
"OveruseDetector class is unused at runtime (TrendlineEstimator::Detect owns hypothesis); BandwidthUsage type is shared",
|
|
407
|
+
];
|
|
408
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../../src/media/sender/estimators/gcc/constants.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;AACH;;;;;;;GAOG;;;;;AAEH,sEAAsE;AACzD,QAAA,uBAAuB,GAAG,MAAO,CAAC;AAE/C;;;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GAKG;AACU,QAAA,4BAA4B,GAAG,IAAI,CAAC;AAEjD;;;GAGG;AACU,QAAA,wBAAwB,GAAG,GAAG,CAAC;AAE5C;;;GAGG;AACU,QAAA,qBAAqB,GAAG,EAAE,CAAC;AAExC;;;;GAIG;AACU,QAAA,wBAAwB,GAAG,KAAM,CAAC;AAC/C,wDAAwD;AAC3C,QAAA,iBAAiB,GAAG,gCAAwB,CAAC;AAE1D;;;GAGG;AACU,QAAA,wBAAwB,GAAG,EAAE,CAAC;AAE3C;;;;GAIG;AACU,QAAA,qBAAqB,GAAG;IACnC,ohEAAohE;IACphE,8EAA8E;IAC9E,49GAA49G;IAC59G,84EAA84E;IAC94E,8QAA8Q;IAC9Q,6UAA6U;IAC7U,gWAAgW;IAChW,uIAAuI;IACvI,8HAA8H;IAC9H,4TAA4T;IAC5T,wHAAwH;CAChH,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 */\n/**\n * Named constants for Google Congestion Control (GCC).\n *\n * Prefer **libwebrtc goog_cc** runtime defaults when draft-ietf-rmcat-gcc and\n * Chromium diverge.\n *\n * Known intentional differences: {@link GCC_KNOWN_DIFFERENCES}.\n */\n\n/** Initial / fallback start bitrate (libwebrtc default ~300 kbps). */\nexport const kDefaultStartBitrateBps = 300_000;\n\n/**\n * pin `SendSideBandwidthEstimation` `kStartPhase` = 2s.\n * Startup delay/REMB trust (`last_fraction_loss_ == 0`) lasts until this\n * window after the first {@link GccBandwidthEstimator.updatePacketsLost}\n * (RTCP TransportLossReport). With no RR, first_report_time stays infinite\n * and the start phase remains open until LossBasedV2 is ready.\n */\nexport const kStartPhaseMs = 2_000;\n\n/**\n * pin `UpdatePacketsLost` `kLimitNumPackets` = 20.\n * Fraction-loss is not published until this many packets accumulate.\n */\nexport const kStartPhaseLossReportMinPackets = 20;\n\n/**\n * pin `kCongestionControllerMinBitrate` (bwe_defines.h) = 5 kbps.\n * Auditable via third_party/libwebrtc-ref snapshot.\n */\nexport const kMinBitrateBps = 5_000;\nexport const kMaxBitrateBps = 1_000_000_000;\n\n/** Burst grouping window for inter-arrival pre-filter (ms). */\nexport const kBurstTimeMs = 5;\n\n/**\n * Delay-based stream idle timeout (ms).\n * libwebrtc `DelayBasedBwe::kStreamTimeOut` = 2s — reset InterArrivalDelta +\n * TrendlineEstimator when no packet feedback arrives for this long.\n */\nexport const kStreamTimeOutMs = 2_000;\n\n// --- TrendlineEstimator (libwebrtc trendline_estimator.cc) ---\n\n/**\n * Default window size in packets\n * (`TrendlineEstimatorSettings::kDefaultTrendlineWindowSize` = 20).\n * Slope is only recomputed when the window is full.\n */\nexport const kTrendlineWindowSize = 20;\n\n/** Exponential smoothing coefficient for accumulated delay. */\nexport const kTrendlineSmoothingCoeff = 0.9;\n\n/**\n * Gain applied as `min(num_deltas, kMinNumDeltas) * trend * gain`\n * before comparing to the adaptive threshold.\n */\nexport const kTrendlineThresholdGain = 4.0;\n\n/**\n * Cap used in modified_trend: `min(num_of_deltas, kMinNumDeltas)`.\n * libwebrtc: kMinNumDeltas = 60.\n */\nexport const kTrendlineMinNumDeltas = 60;\n\n/** libwebrtc caps num_of_deltas_ at this value. */\nexport const kTrendlineDeltaCounterMax = 1000;\n\n// --- Overuse detector (libwebrtc TrendlineEstimator::Detect / UpdateThreshold) ---\n\nexport const kInitialThresholdMs = 12.5;\nexport const kMinThresholdMs = 6;\nexport const kMaxThresholdMs = 600;\nexport const kOveruseTimeThresholdMs = 10;\n\n/** libwebrtc k_up_ / k_down_ for adaptive threshold (not draft K_u / K_d). */\nexport const kThresholdGainUp = 0.0087;\nexport const kThresholdGainDown = 0.039;\n\nexport const kMaxAdaptOffsetMs = 15;\n\n// --- AIMD (pin aimd_rate_control.cc) ---\n\n/** Multiplicative decrease factor (pin kDefaultBackoffFactor / beta_ = 0.85). */\nexport const kBeta = 0.85;\n/** Multiplicative increase base per second (pin alpha = 1.08). */\nexport const kMultiplicativeIncreaseFactor = 1.08;\n/**\n * Extra delay added to RTT for near-max additive response time\n * (pin: response_time = (rtt + 100ms) * 2).\n */\nexport const kReactionTimeMs = 100;\nexport const kBitrateWindowMs = 1000;\n/**\n * pin `kDefaultRtt` = 200ms. AIMD RTT is **not** TWCC propagation RTT;\n * only OnRoundTripTimeUpdate / RTCP RR path updates it via setRtt.\n */\nexport const kDefaultRttMs = 200;\n/**\n * TimeToReduceFurther throughput check: estimated_throughput < 0.5 * estimate.\n */\nexport const kThroughputLowerFraction = 0.5;\n/**\n * Subtracted from beta * throughput on overuse when result > 5 kbps\n * (pin: decreased_bitrate -= 5 kbps).\n */\nexport const kAimdDecreaseOffsetBps = 5_000;\n/**\n * Additive increase floor (pin kMinIncreaseRateBpsPerSecond = 4000).\n */\nexport const kAimdMinIncreaseRateBpsPerSecond = 4_000;\n/**\n * Multiplicative increase floor per update (pin BitsPerSec(1000)).\n */\nexport const kAimdMinMultiplicativeIncreaseBps = 1_000;\n/**\n * Throughput upper bound offset on increase (pin + 10 kbps).\n */\nexport const kAimdThroughputUpperOffsetBps = 10_000;\n\n// --- Acknowledged bitrate (libwebrtc RobustThroughputEstimator defaults) ---\n// Pin: RobustThroughputEstimatorSettings.enabled = true\n\n/** Min packets to form a window (window_packets = 20). */\nexport const kRobustWindowPackets = 20;\n/** Hard cap on packets retained (max_window_packets = 500). */\nexport const kRobustMaxWindowPackets = 500;\n/** Min window duration once packet count is met (min_window_duration = 1s). */\nexport const kRobustMinWindowDurationMs = 1000;\n/** Max window duration (max_window_duration = 5s). */\nexport const kRobustMaxWindowDurationMs = 5000;\n/** Min packets before producing an estimate (required_packets = 10). */\nexport const kRobustRequiredPackets = 10;\n\n// --- Loss-based (libwebrtc LossBasedBweV2 field-trial defaults, lkgr) ---\n\n/** ObservationWindowSize default 15. */\nexport const kLossBasedObservationWindow = 15;\n\n/**\n * Min observation duration before a partial window is committed (ms).\n * libwebrtc `ObservationDurationLowerBound` default 250ms.\n */\nexport const kLossBasedObservationDurationLowerBoundMs = 250;\n\n/**\n * Min committed observations before estimates are used.\n * libwebrtc readiness uses delayed start after several observations (3).\n */\nexport const kLossBasedMinNumObservations = 3;\n\n/**\n * pin LossBasedBweV2 `UseInStartPhase` FieldTrial default (`true`).\n * When ready, LossBased replaces the 2s delay-based startup ramp.\n */\nexport const kLossBasedUseInStartPhase = true;\n\n/** CandidateFactors default {1.02, 1.0, 0.95}. */\nexport const kLossBasedCandidateFactors = [1.02, 1.0, 0.95] as const;\n\nexport const kLossBasedInherentLossLowerBound = 1e-3;\nexport const kLossBasedInherentLossUpperBoundOffset = 0.05;\n/** InherentLossUpperBoundBwBalance default 100 kbps. */\nexport const kLossBasedInherentLossUpperBoundBwBalanceBps = 100_000;\nexport const kLossBasedInitialInherentLoss = 0.01;\nexport const kLossBasedNewtonIterations = 1;\n/** NewtonStepSize default 0.75. */\nexport const kLossBasedNewtonStepSize = 0.75;\n/** HigherBandwidthBiasFactor default 0.0002. */\nexport const kLossBasedHigherBwBiasFactor = 0.0002;\n/** HigherLogBandwidthBiasFactor default 0.02. */\nexport const kLossBasedHigherLogBwBiasFactor = 0.02;\n/** TemporalWeightFactor default 0.9. */\nexport const kLossBasedTemporalWeightFactor = 0.9;\n/** BwRampupUpperBoundFactor default 1.5. */\nexport const kLossBasedRampupUpperBoundFactor = 1.5;\n/**\n * When acknowledged rate has not yet recovered past holdRate × threshold,\n * use a more cautious ramp-up (libwebrtc BwRampupUpperBoundInHoldFactor).\n */\nexport const kLossBasedRampupUpperBoundInHoldFactor = 1.2;\n/** BwRampupUpperBoundHoldThreshold default 1.3. */\nexport const kLossBasedRampupUpperBoundHoldThreshold = 1.3;\n\n/**\n * UseByteLossRate default true — objective/derivative use lost/received **bytes**.\n */\nexport const kLossBasedUseByteLossRate = true;\n\n/** LossThresholdOfHighBandwidthPreference default 0.2. */\nexport const kLossBasedLossThresholdOfHighBandwidthPreference = 0.2;\n/** BandwidthPreferenceSmoothingFactor default 0.002. */\nexport const kLossBasedBandwidthPreferenceSmoothingFactor = 0.002;\n\n/** InstantUpperBoundBwBalance default 100 kbps. */\nexport const kLossBasedInstantUpperBoundBwBalanceBps = 100_000;\n/** InstantUpperBoundLossOffset default 0.05. */\nexport const kLossBasedInstantUpperBoundLossOffset = 0.05;\n/** InstantUpperBoundTemporalWeightFactor default 0.9. */\nexport const kLossBasedInstantUpperBoundTemporalWeightFactor = 0.9;\n\n/** LowerBoundByAckedRateFactor default 1.0. */\nexport const kLossBasedLowerBoundByAckedRateFactor = 1.0;\n/** SendingRateSmoothingFactor default 0.0 — no smoothing. */\nexport const kLossBasedSendingRateSmoothingFactor = 0;\n/**\n * BwBackoffLowerBoundFactor default 1.0.\n * Applied to the acknowledged-rate candidate in GetCandidates.\n */\nexport const kLossBasedBandwidthBackoffLowerBoundFactor = 1;\n\n/** DelayedIncreaseWindow default 300ms. */\nexport const kLossBasedDelayedIncreaseWindowMs = 300;\n/** MaxIncreaseFactor default 1.3. */\nexport const kLossBasedMaxIncreaseFactor = 1.3;\n\n/** HoldDurationFactor default 3.0 in some builds; field trial default 2.0. */\nexport const kLossBasedHoldDurationFactor = 2.0;\n/** Initial HOLD duration (ms). libwebrtc kInitHoldDuration = 300ms. */\nexport const kLossBasedInitHoldDurationMs = 300;\n/** Max HOLD duration (ms). libwebrtc kMaxHoldDuration = 60s. */\nexport const kLossBasedMaxHoldDurationMs = 60_000;\n\n/** BoundBestCandidate default true. */\nexport const kLossBasedBoundBestCandidate = true;\n/** NotIncreaseIfInherentLossLessThanAverageLoss default true. */\nexport const kLossBasedNotIncreaseIfInherentLessThanAverage = true;\n/** NotUseAckedRateInAlr default true. */\nexport const kLossBasedNotUseAckedRateInAlr = true;\n/** MedianSendingRateFactor default 2.0 (byte-loss spike filter). */\nexport const kLossBasedMedianSendingRateFactor = 2;\n\n/** Legacy names kept for tests. */\nexport const kLossIncreaseThreshold = 0.02;\nexport const kLossDecreaseThreshold = 0.1;\nexport const kLossBasedIncreaseFactor = 1.02;\nexport const kLossBasedBackoffFactor = 0.5;\nexport const kLossIncreaseFactor = kLossBasedIncreaseFactor;\n\n// --- ProbeController ---\n\n/**\n * pin `kDefaultPaceMultiplier` — used until the first transport feedback\n * (`first_transport_feedback_received_ == false`).\n */\nexport const kDefaultPaceMultiplier = 2.5;\n/**\n * pin `kDefaultPaceMultiplierWithSendSideBwe` — after first TWCC\n * (send-side BWE is active).\n */\nexport const kDefaultPaceMultiplierWithSendSideBwe = 1.1;\n\n/**\n * pin ProbeControllerConfig `min_probe_delta` default (2ms).\n * Inter-burst spacing after the initial exponential session.\n */\nexport const kMinProbeDeltaMs = 2;\n/**\n * pin ProbeControllerConfig `initial_min_probe_delta` default (20ms).\n * Used for the first 3x/6x exponential clusters.\n */\nexport const kInitialMinProbeDeltaMs = 20;\n/**\n * pin BitrateProberConfig `max_probe_delay` default (10ms).\n * An active cluster whose next_probe_time is this late is discarded.\n */\nexport const kMaxProbeDelayMs = 10;\n/**\n * pin BitrateProber `kMaxPendingProbeClusters`.\n */\nexport const kMaxPendingProbeClusters = 5;\n\n/** Initial exponential probe steps: start×3, start×6. */\nexport const kProbeBitrateMultipliers = [3, 6] as const;\n/** Further probes after success use ×2 (libwebrtc further probe step). */\nexport const kFurtherProbeStepMultiplier = 2;\nexport const kFurtherProbeThreshold = 0.7;\nexport const kProbeMinDurationMs = 15;\nexport const kProbeMinPackets = 5;\n/**\n * pin BitrateProber `kProbeClusterTimeout` (5s).\n * Drops **queued** (not yet activated) clusters whose `requested_at` is\n * older than this. Not an active-packet scheduling budget — late active\n * clusters are discarded via {@link kMaxProbeDelayMs} instead.\n */\nexport const kProbePacingTimeoutMs = 5_000;\n/**\n * ProbeController result-wait timeout (ms).\n * After send-fill, waiting for TWCC/result validation uses this (libwebrtc ≈ 1s).\n * Also used as ProbeBitrateEstimator cluster history horizon.\n */\nexport const kProbeResultTimeoutMs = 1_000;\n/** libwebrtc ProbeBitrateEstimator: min % of probes that must be ACKed. */\nexport const kProbeMinReceivedProbesPercent = 80;\n/** libwebrtc ProbeBitrateEstimator: min % of bytes that must be ACKed. */\nexport const kProbeMinReceivedBytesPercent = 80;\n/** Reject estimate if receive/send rate ratio exceeds this. */\nexport const kProbeMaxValidRatio = 2.0;\n/** If receive < this × send, treat link as capacity-limited. */\nexport const kProbeMinRatioForUnsaturated = 0.9;\n/** Target utilization when capacity-limited (slightly under receive rate). */\nexport const kProbeTargetUtilization = 0.95;\n/** Max send/receive interval for a valid probe cluster (ms). */\nexport const kProbeMaxIntervalMs = 1000;\n/**\n * Min interval between recovery / further probe sessions (ms).\n * Recovery is requested only on underuse → normal (not while still underusing);\n * this cooldown still spaces further/recovery sessions near capacity.\n */\nexport const kProbeMinIntervalMs = 5_000;\n/**\n * pin `kDefaultMaxProbingBitrate` (5 Mbps). Used when the application did\n * not configure a lower max (ensureProbing default).\n */\nexport const kDefaultMaxProbingBitrateBps = 5_000_000;\n/** pin `kBitrateDropThreshold` — record a large drop at this fraction. */\nexport const kBitrateDropThreshold = 0.66;\n/** pin `kBitrateDropTimeout` (5s). */\nexport const kBitrateDropTimeoutMs = 5_000;\n/** pin `kProbeFractionAfterDrop` (0.85 × bitrate_before_last_large_drop). */\nexport const kProbeFractionAfterDrop = 0.85;\n/** pin `kAlrEndedTimeout` (3s). */\nexport const kAlrEndedTimeoutMs = 3_000;\n/** pin `kMinTimeBetweenAlrProbes` (5s). */\nexport const kMinTimeBetweenAlrProbesMs = 5_000;\n/** pin `kProbeUncertainty` (0.05). Skip recovery if estimate is already close. */\nexport const kProbeUncertainty = 0.05;\n/** @deprecated further-step only; recovery uses {@link kProbeFractionAfterDrop}. */\nexport const kProbeRecoveryScale = 1.5;\n/** Cap further/uncapped step (not pin RequestProbe). */\nexport const kProbeRecoveryMaxScale = 2.0;\n/**\n * libwebrtc ProbeControllerConfig `loss_limited_probe_scale` default (1.5).\n * When BandwidthLimitedCause is kLossLimitedBweIncreasing, InitiateProbing\n * caps max_probe_bitrate at estimated × this scale.\n */\nexport const kLossLimitedProbeScale = 1.5;\n\n/** pin AlrDetectorConfig `bandwidth_usage_ratio` (0.65). */\nexport const kAlrBandwidthUsageRatio = 0.65;\n/** pin AlrDetectorConfig `start_budget_level_ratio` (0.80). */\nexport const kAlrStartBudgetLevelRatio = 0.8;\n/** pin AlrDetectorConfig `stop_budget_level_ratio` (0.50). */\nexport const kAlrStopBudgetLevelRatio = 0.5;\n/** pin ProbeControllerConfig `alr_interval` (5s). */\nexport const kAlrProbingIntervalMs = 5_000;\n/** pin ProbeControllerConfig `alr_scale` (2). */\nexport const kAlrProbeScale = 2;\n/**\n * pin ProbeControllerConfig `network_state_interval` default (+∞).\n * Periodic NSE probes stay idle until an interval is configured.\n */\nexport const kNetworkStateEstimateProbingIntervalMs = Number.POSITIVE_INFINITY;\n/** pin `est_lower_than_network_ratio` default (0). */\nexport const kEstimateLowerThanNetworkStateRatio = 0;\n/** pin `est_lower_than_network_interval` default (3s). */\nexport const kEstimateLowerThanNetworkStateIntervalMs = 3_000;\n/** pin `network_state_scale` default (1.0). */\nexport const kNetworkStateProbeScale = 1;\n/**\n * pin LossBasedBweV2 `PaddingDuration` FieldTrial default (`Seconds(2)`).\n * Non-zero enables `increase_using_padding` instead of `increasing`.\n */\nexport const kLossBasedPaddingDurationMs = 2_000;\n/**\n * RTT threshold for RttBasedBackoff::IsRttAboveLimit (pin\n * send_side_bandwidth_estimation + goog_cc_network_control):\n * when CorrectedRtt (timeout_correction + **propagation** RTT) exceeds this,\n * GetBandwidthLimitedCause becomes kRttBasedBackOffHighRtt and\n * ProbeController::InitiateProbing returns no clusters.\n * Default 3s = WebRTC-Bwe-MaxRttLimit field-trial default (`limit`).\n * Raw max_feedback_rtt is **not** used for probe cause (CWND only in pin).\n * SendSideBandwidthEstimation::UpdateEstimate also multiplies the target by\n * {@link kRttBasedBackOffDropFraction} every {@link kRttBasedBackOffDropIntervalMs}\n * down to {@link kRttBasedBackOffBandwidthFloorBps}.\n */\nexport const kRttBasedBackOffHighRttMs = 3_000;\n/** pin RttBasedBackoff `drop_fraction` default (0.8). */\nexport const kRttBasedBackOffDropFraction = 0.8;\n/** pin RttBasedBackoff `drop_interval` default (1s). */\nexport const kRttBasedBackOffDropIntervalMs = 1_000;\n/** pin RttBasedBackoff `bandwidth_floor` default (5 kbps). */\nexport const kRttBasedBackOffBandwidthFloorBps = 5_000;\n/**\n * pin kProbeDropThroughputFraction: when a valid probe result is **below** the\n * current delay estimate, floor at acked×this so a single glitchy probe cannot\n * crash the estimate far below observed throughput. **No matching upward cap**\n * in pin production path — rising probes pass through to Aimd SetEstimate.\n */\nexport const kProbeDropThroughputFraction = 0.85;\n\n/**\n * RTP padding size (bytes) when RTCRtpSender injects probe padding.\n * Must fit in a single octet (RFC 3550 last padding byte = length), so ≤255.\n */\nexport const kProbePaddingPacketBytes = 224;\n\n/**\n * Max probe padding packets per inner burst (outer loop drains remaining).\n * Keeps event-loop responsive while still completing large clusters.\n */\nexport const kProbePaddingMaxBurst = 16;\n\n/**\n * pin `TransportFeedbackAdapter` `kSendTimeHistoryWindow` = 60s.\n * Sent packet history (and never-ACK probe estimator maps) live this long\n * so late TWCC can still match. Not a 2048-sequence cap.\n */\nexport const kSendTimeHistoryWindowMs = 60_000;\n/** @deprecated Use {@link kSendTimeHistoryWindowMs}. */\nexport const kSentInfoMaxAgeMs = kSendTimeHistoryWindowMs;\n\n/**\n * pin `GoogCcNetworkControllerFactory::GetProcessInterval`\n * `kUpdateIntervalMs` = 25.\n */\nexport const kGoogCcProcessIntervalMs = 25;\n\n/**\n * Intentional differences vs Chromium libwebrtc goog_cc.\n * Acceptable under the ticket's pure-TypeScript / no C++ binding constraint;\n * algorithm structure and control response match the reference.\n */\nexport const GCC_KNOWN_DIFFERENCES = [\n \"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)\",\n \"No REMB integration; TWCC-only send-side mode (ticket non-goal; future work)\",\n \"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\",\n \"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\",\n \"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)\",\n \"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)\",\n \"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\",\n \"Floating-point / wall-clock differences may cause sub-bps numerical drift vs C++ (not bit-identical to libwebrtc public test vectors)\",\n \"InterArrivalDelta: reordered-reset / arrival−system offset (>=3000ms) ported; production passes feedback_time as system_time\",\n \"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\",\n \"OveruseDetector class is unused at runtime (TrendlineEstimator::Detect owns hypothesis); BandwidthUsage type is shared\",\n] as const;\n"]}
|