werift 0.26.0 → 0.28.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 +182 -8
- 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/event.d.ts +26 -0
- package/lib/common/src/event.js +87 -2
- package/lib/common/src/event.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/network.d.ts +6 -1
- package/lib/common/src/network.js +8 -2
- package/lib/common/src/network.js.map +1 -1
- package/lib/common/src/transport.d.ts +12 -5
- package/lib/common/src/transport.js +13 -7
- package/lib/common/src/transport.js.map +1 -1
- package/lib/dtls/src/alert.d.ts +49 -0
- package/lib/dtls/src/alert.js +103 -0
- package/lib/dtls/src/alert.js.map +1 -0
- package/lib/dtls/src/client.js +15 -1
- package/lib/dtls/src/client.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.d.ts +2 -0
- package/lib/dtls/src/context/dtls.js +11 -2
- package/lib/dtls/src/context/dtls.js.map +1 -1
- package/lib/dtls/src/context/transport.d.ts +17 -1
- package/lib/dtls/src/context/transport.js +40 -3
- 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 +8 -3
- package/lib/dtls/src/flight/client/flight5.js.map +1 -1
- package/lib/dtls/src/flight/flight.d.ts +6 -1
- package/lib/dtls/src/flight/flight.js +18 -5
- 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 +6 -2
- 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/index.d.ts +3 -1
- package/lib/dtls/src/index.js +10 -1
- package/lib/dtls/src/index.js.map +1 -1
- package/lib/dtls/src/record/const.d.ts +52 -33
- package/lib/dtls/src/record/const.js +51 -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.d.ts +6 -0
- package/lib/dtls/src/record/receive.js +50 -19
- package/lib/dtls/src/record/receive.js.map +1 -1
- package/lib/dtls/src/server.js +19 -1
- package/lib/dtls/src/server.js.map +1 -1
- package/lib/dtls/src/socket.d.ts +134 -2
- package/lib/dtls/src/socket.js +326 -8
- 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/candidateError.d.ts +155 -0
- package/lib/ice/src/candidateError.js +246 -0
- package/lib/ice/src/candidateError.js.map +1 -0
- package/lib/ice/src/candidateGatherer.d.ts +127 -0
- package/lib/ice/src/candidateGatherer.js +745 -0
- package/lib/ice/src/candidateGatherer.js.map +1 -0
- package/lib/ice/src/consent.d.ts +49 -0
- package/lib/ice/src/consent.js +258 -0
- package/lib/ice/src/consent.js.map +1 -0
- 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 +254 -58
- package/lib/ice/src/ice.js +979 -945
- package/lib/ice/src/ice.js.map +1 -1
- package/lib/ice/src/iceBase.d.ts +328 -14
- package/lib/ice/src/iceBase.js +254 -38
- package/lib/ice/src/iceBase.js.map +1 -1
- package/lib/ice/src/index.d.ts +1 -0
- package/lib/ice/src/index.js +1 -0
- package/lib/ice/src/index.js.map +1 -1
- package/lib/ice/src/internal/checkMessages.d.ts +41 -0
- package/lib/ice/src/internal/checkMessages.js +63 -0
- package/lib/ice/src/internal/checkMessages.js.map +1 -0
- package/lib/ice/src/internal/defaultRoute.d.ts +20 -0
- package/lib/ice/src/internal/defaultRoute.js +134 -0
- package/lib/ice/src/internal/defaultRoute.js.map +1 -0
- package/lib/ice/src/internal/hostInterfaces.d.ts +17 -0
- package/lib/ice/src/internal/hostInterfaces.js +77 -0
- package/lib/ice/src/internal/hostInterfaces.js.map +1 -0
- package/lib/ice/src/internal/hostPreference.d.ts +24 -0
- package/lib/ice/src/internal/hostPreference.js +38 -0
- package/lib/ice/src/internal/hostPreference.js.map +1 -0
- package/lib/ice/src/internal/resolveHostAddresses.d.ts +56 -8
- package/lib/ice/src/internal/resolveHostAddresses.js +127 -24
- package/lib/ice/src/internal/resolveHostAddresses.js.map +1 -1
- package/lib/ice/src/internal/selectAddresses.d.ts +27 -0
- package/lib/ice/src/internal/selectAddresses.js +37 -18
- package/lib/ice/src/internal/selectAddresses.js.map +1 -1
- package/lib/ice/src/nomination/regularNomination.d.ts +200 -0
- package/lib/ice/src/nomination/regularNomination.js +311 -0
- package/lib/ice/src/nomination/regularNomination.js.map +1 -0
- package/lib/ice/src/nomination/selectionReplacement.d.ts +138 -0
- package/lib/ice/src/nomination/selectionReplacement.js +371 -0
- package/lib/ice/src/nomination/selectionReplacement.js.map +1 -0
- package/lib/ice/src/provisional.d.ts +139 -0
- package/lib/ice/src/provisional.js +468 -0
- package/lib/ice/src/provisional.js.map +1 -0
- package/lib/ice/src/stun/protocol.d.ts +9 -2
- package/lib/ice/src/stun/protocol.js +16 -17
- package/lib/ice/src/stun/protocol.js.map +1 -1
- package/lib/ice/src/stun/tcpProtocol.d.ts +1 -1
- package/lib/ice/src/stun/tcpProtocol.js +7 -7
- package/lib/ice/src/stun/tcpProtocol.js.map +1 -1
- package/lib/ice/src/stun/transaction.d.ts +30 -1
- package/lib/ice/src/stun/transaction.js +90 -19
- 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 +31 -10
- package/lib/ice/src/turn/protocol.js +127 -51
- package/lib/ice/src/turn/protocol.js.map +1 -1
- package/lib/ice/src/types/model.d.ts +16 -5
- package/lib/ice/src/types/model.js.map +1 -1
- package/lib/ice-server/src/stun/attributes.d.ts +2 -0
- package/lib/ice-server/src/stun/attributes.js +11 -1
- package/lib/ice-server/src/stun/attributes.js.map +1 -1
- package/lib/ice-server/src/stun/const.d.ts +44 -17
- package/lib/ice-server/src/stun/const.js +31 -19
- package/lib/ice-server/src/stun/const.js.map +1 -1
- package/lib/ice-server/src/stun/message.d.ts +29 -4
- package/lib/ice-server/src/stun/message.js +115 -24
- package/lib/ice-server/src/stun/message.js.map +1 -1
- package/lib/index.mjs +35121 -22337
- package/lib/nonstandard/index.mjs +3169 -1399
- package/lib/polyfill/dom.mjs +24650 -12365
- package/lib/polyfill/index.mjs +24650 -12365
- 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 +8 -0
- package/lib/rtp/src/index.js +8 -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 +49 -0
- package/lib/rtp/src/rtp/continuity.js +120 -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/rtp/timelineRewriter.d.ts +178 -0
- package/lib/rtp/src/rtp/timelineRewriter.js +417 -0
- package/lib/rtp/src/rtp/timelineRewriter.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 +85 -0
- package/lib/sctp/src/sctp.js +707 -126
- 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/compatibilityOptions.d.ts +33 -0
- package/lib/webrtc/src/api/compatibilityOptions.js +33 -0
- package/lib/webrtc/src/api/compatibilityOptions.js.map +1 -0
- package/lib/webrtc/src/api/peerConfig.d.ts +385 -28
- package/lib/webrtc/src/api/peerConfig.js +121 -14
- package/lib/webrtc/src/api/peerConfig.js.map +1 -1
- package/lib/webrtc/src/api/peerConnectionEvents.d.ts +77 -1
- package/lib/webrtc/src/api/peerConnectionEvents.js +105 -1
- package/lib/webrtc/src/api/peerConnectionEvents.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/helper.d.ts +8 -0
- package/lib/webrtc/src/helper.js +40 -4
- package/lib/webrtc/src/helper.js.map +1 -1
- package/lib/webrtc/src/media/codecCompatibility.d.ts +87 -1
- package/lib/webrtc/src/media/codecCompatibility.js +338 -12
- package/lib/webrtc/src/media/codecCompatibility.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.d.ts +43 -10
- package/lib/webrtc/src/media/receiver/nack.js +246 -88
- 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 +241 -40
- package/lib/webrtc/src/media/router.js +676 -205
- package/lib/webrtc/src/media/router.js.map +1 -1
- package/lib/webrtc/src/media/routing/pendingRoutes.d.ts +26 -0
- package/lib/webrtc/src/media/routing/pendingRoutes.js +48 -0
- package/lib/webrtc/src/media/routing/pendingRoutes.js.map +1 -0
- package/lib/webrtc/src/media/routing/ridRouting.d.ts +37 -0
- package/lib/webrtc/src/media/routing/ridRouting.js +74 -0
- package/lib/webrtc/src/media/routing/ridRouting.js.map +1 -0
- package/lib/webrtc/src/media/routing/routeTable.d.ts +60 -0
- package/lib/webrtc/src/media/routing/routeTable.js +95 -0
- package/lib/webrtc/src/media/routing/routeTable.js.map +1 -0
- package/lib/webrtc/src/media/routing/rtcpRouting.d.ts +34 -0
- package/lib/webrtc/src/media/routing/rtcpRouting.js +165 -0
- package/lib/webrtc/src/media/routing/rtcpRouting.js.map +1 -0
- package/lib/webrtc/src/media/routing/unknownSsrc.d.ts +55 -0
- package/lib/webrtc/src/media/routing/unknownSsrc.js +117 -0
- package/lib/webrtc/src/media/routing/unknownSsrc.js.map +1 -0
- package/lib/webrtc/src/media/rtpReceiver.d.ts +252 -2
- package/lib/webrtc/src/media/rtpReceiver.js +833 -44
- package/lib/webrtc/src/media/rtpReceiver.js.map +1 -1
- package/lib/webrtc/src/media/rtpSender.d.ts +191 -70
- package/lib/webrtc/src/media/rtpSender.js +631 -448
- package/lib/webrtc/src/media/rtpSender.js.map +1 -1
- package/lib/webrtc/src/media/rtpTransceiver.d.ts +19 -3
- package/lib/webrtc/src/media/rtpTransceiver.js +74 -9
- 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/senderReportHistory.d.ts +51 -0
- package/lib/webrtc/src/media/sender/senderReportHistory.js +111 -0
- package/lib/webrtc/src/media/sender/senderReportHistory.js.map +1 -0
- package/lib/webrtc/src/media/sender/senderStats.d.ts +101 -0
- package/lib/webrtc/src/media/sender/senderStats.js +317 -0
- package/lib/webrtc/src/media/sender/senderStats.js.map +1 -0
- package/lib/webrtc/src/media/track.d.ts +29 -2
- package/lib/webrtc/src/media/track.js +32 -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 +24 -7
- package/lib/webrtc/src/negotiation/remoteMediaApplication.js +67 -27
- package/lib/webrtc/src/negotiation/remoteMediaApplication.js.map +1 -1
- package/lib/webrtc/src/negotiation/transceiverPairing.d.ts +1 -0
- package/lib/webrtc/src/negotiation/transceiverPairing.js +62 -0
- package/lib/webrtc/src/negotiation/transceiverPairing.js.map +1 -0
- package/lib/webrtc/src/negotiation/transportActivation.d.ts +8 -1
- package/lib/webrtc/src/negotiation/transportActivation.js +40 -8
- package/lib/webrtc/src/negotiation/transportActivation.js.map +1 -1
- package/lib/webrtc/src/negotiationTransaction.d.ts +43 -5
- package/lib/webrtc/src/negotiationTransaction.js +129 -13
- 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 +108 -6
- package/lib/webrtc/src/peerConnection.js +357 -36
- package/lib/webrtc/src/peerConnection.js.map +1 -1
- package/lib/webrtc/src/polyfill/globals.d.ts +2 -1
- package/lib/webrtc/src/polyfill/globals.js.map +1 -1
- package/lib/webrtc/src/polyfill/install.js +2 -0
- package/lib/webrtc/src/polyfill/install.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 +92 -25
- package/lib/webrtc/src/sctpManager.js.map +1 -1
- package/lib/webrtc/src/sdp.d.ts +69 -0
- package/lib/webrtc/src/sdp.js +151 -20
- package/lib/webrtc/src/sdp.js.map +1 -1
- package/lib/webrtc/src/sdpManager.d.ts +85 -4
- package/lib/webrtc/src/sdpManager.js +214 -14
- package/lib/webrtc/src/sdpManager.js.map +1 -1
- package/lib/webrtc/src/secureTransportManager.d.ts +89 -4
- package/lib/webrtc/src/secureTransportManager.js +184 -26
- package/lib/webrtc/src/secureTransportManager.js.map +1 -1
- package/lib/webrtc/src/transceiverManager.d.ts +82 -4
- package/lib/webrtc/src/transceiverManager.js +239 -41
- package/lib/webrtc/src/transceiverManager.js.map +1 -1
- package/lib/webrtc/src/transport/dtls.d.ts +147 -1
- package/lib/webrtc/src/transport/dtls.js +446 -50
- package/lib/webrtc/src/transport/dtls.js.map +1 -1
- package/lib/webrtc/src/transport/ice.d.ts +71 -90
- package/lib/webrtc/src/transport/ice.js +250 -42
- package/lib/webrtc/src/transport/ice.js.map +1 -1
- package/lib/webrtc/src/transport/sctp.d.ts +25 -0
- package/lib/webrtc/src/transport/sctp.js +153 -22
- package/lib/webrtc/src/transport/sctp.js.map +1 -1
- package/lib/webrtc/src/utils.d.ts +69 -3
- package/lib/webrtc/src/utils.js +105 -16
- package/lib/webrtc/src/utils.js.map +1 -1
- package/package.json +9 -6
|
@@ -24,16 +24,18 @@ import { FullIntraRequest, GenericNack, RedEncoder, type RtcpPacket, type RtpHea
|
|
|
24
24
|
import type { RTCDtlsTransport } from "../transport/dtls";
|
|
25
25
|
import type { Kind } from "../types/domain";
|
|
26
26
|
import type { RTCRtpCodecParameters, RTCRtpHeaderExtensionParameters, RTCRtpSendParameters } from "./parameters";
|
|
27
|
-
import {
|
|
27
|
+
import { type BandwidthEstimator, type CongestionEventsCompatibility, type ProbeClusterConfig } from "./sender/bandwidthEstimator";
|
|
28
|
+
import { type PendingRtpOptions } from "./sender/pendingRtp";
|
|
28
29
|
import { type RTCStats, type RTCStatsReport } from "./stats";
|
|
29
30
|
import { type MediaStream, type MediaStreamTrack } from "./track";
|
|
30
|
-
export type PendingRtpOptions
|
|
31
|
-
/** Queue RTP until DTLS is connected and a codec is set. Default true when this object is passed. */
|
|
32
|
-
enabled?: boolean;
|
|
33
|
-
/** Max queued packets when enabled. Oldest packets are dropped. Default 256. */
|
|
34
|
-
maxLength?: number;
|
|
35
|
-
};
|
|
31
|
+
export type { PendingRtpOptions } from "./sender/pendingRtp";
|
|
36
32
|
export type RTCRtpSenderOptions = {
|
|
33
|
+
/**
|
|
34
|
+
* Initial send-side bandwidth estimator. When omitted, the default is
|
|
35
|
+
* {@link LightweightBandwidthEstimator}. {@link RTCPeerConnection} passes the
|
|
36
|
+
* instance created from {@link PeerConfig.bandwidthEstimator}.
|
|
37
|
+
*/
|
|
38
|
+
bandwidthEstimator?: BandwidthEstimator;
|
|
37
39
|
/** Pending RTP cache. Disabled by default. Pass `true` or `{ maxLength }` to enable. */
|
|
38
40
|
pendingRtp?: boolean | PendingRtpOptions;
|
|
39
41
|
};
|
|
@@ -48,6 +50,62 @@ export declare class RTCRtpSender {
|
|
|
48
50
|
readonly onRtcp: Event<[RtcpPacket]>;
|
|
49
51
|
readonly onPictureLossIndication: Event<[]>;
|
|
50
52
|
readonly onGenericNack: Event<[GenericNack]>;
|
|
53
|
+
/**
|
|
54
|
+
* Active send-side bandwidth estimator (TWCC-driven) with its generation
|
|
55
|
+
* and process timer. Replaced only via {@link setBandwidthEstimator}.
|
|
56
|
+
*/
|
|
57
|
+
private readonly bwe;
|
|
58
|
+
/**
|
|
59
|
+
* Active send-side bandwidth estimator (TWCC-driven).
|
|
60
|
+
*
|
|
61
|
+
* Default is {@link LightweightBandwidthEstimator} (lightweight cumulative algorithm).
|
|
62
|
+
* Replace only with {@link setBandwidthEstimator} (e.g. `new GccBandwidthEstimator()`).
|
|
63
|
+
*
|
|
64
|
+
* Prefer {@link onAvailableBitrate} on this sender for bitrate notifications that
|
|
65
|
+
* survive estimator swaps. Algorithm-specific events remain on concrete instances.
|
|
66
|
+
*
|
|
67
|
+
* **TypeScript compatibility:** {@link CongestionEventsCompatibility} fields
|
|
68
|
+
* (`onCongestion` / `onCongestionScore`) are present on every estimator so
|
|
69
|
+
* existing `sender.senderBWE.onCongestion.subscribe(...)` still type-checks.
|
|
70
|
+
* They fire only on {@link LightweightBandwidthEstimator}; GCC / disabled are no-ops.
|
|
71
|
+
* Prefer `sender.senderBWE as LightweightBandwidthEstimator` (or
|
|
72
|
+
* {@link isLightweightBandwidthEstimator}) for lightweight-only APIs.
|
|
73
|
+
*/
|
|
74
|
+
get senderBWE(): BandwidthEstimator & CongestionEventsCompatibility;
|
|
75
|
+
/**
|
|
76
|
+
* Stable recommended send bitrate event (**bps**, change-only).
|
|
77
|
+
* Bridged from the active {@link BandwidthEstimator}; subscriptions survive
|
|
78
|
+
* {@link setBandwidthEstimator} without re-subscribing.
|
|
79
|
+
*
|
|
80
|
+
* Prefer this over `senderBWE.onAvailableBitrate` for application adaptation.
|
|
81
|
+
*/
|
|
82
|
+
readonly onAvailableBitrate: Event<[number]>;
|
|
83
|
+
/**
|
|
84
|
+
* Probe cluster configs (target bps / min packets). Bridged from the active
|
|
85
|
+
* {@link BandwidthEstimator}; GCC fires this, lightweight / disabled never do.
|
|
86
|
+
*/
|
|
87
|
+
readonly onProbeClusterConfig: Event<[ProbeClusterConfig]>;
|
|
88
|
+
/** Token-bucket pacer for **media** (not probe) rate enforcement. */
|
|
89
|
+
private readonly pacer;
|
|
90
|
+
/**
|
|
91
|
+
* pin `pending_untracked_size_` — bytes sent without TWCC tracking,
|
|
92
|
+
* attached to the next tracked packet as `priorUnackedBytes`.
|
|
93
|
+
*/
|
|
94
|
+
private pendingUntrackedBytes;
|
|
95
|
+
/**
|
|
96
|
+
* GCC send FIFO: reservation → pacing wait → seq / TSN assignment → DTLS write.
|
|
97
|
+
* Probe padding may call {@link sendRtpInternal} on this stack only after
|
|
98
|
+
* the current packet's DTLS write ({@link nestOutgoingPadding}); timer /
|
|
99
|
+
* cluster events always enqueue so they cannot share a DTLS write.
|
|
100
|
+
*/
|
|
101
|
+
private readonly outgoing;
|
|
102
|
+
/**
|
|
103
|
+
* Set only around post-DTLS {@link maybeInjectProbePadding} so padding can
|
|
104
|
+
* drain on the same FIFO task without deadlock. Must stay false during
|
|
105
|
+
* probe/pacing wait, or a cluster event would send in parallel.
|
|
106
|
+
*/
|
|
107
|
+
private nestOutgoingPadding;
|
|
108
|
+
private readonly padding;
|
|
51
109
|
/** Fires for a FIR addressed to this sender with a new sequence number (RFC 5104 4.3.1). */
|
|
52
110
|
readonly onFullIntraRequest: Event<[FullIntraRequest]>;
|
|
53
111
|
/**
|
|
@@ -55,7 +113,6 @@ export declare class RTCRtpSender {
|
|
|
55
113
|
* that is not a retransmission. Fires in addition to onPictureLossIndication / onFullIntraRequest.
|
|
56
114
|
*/
|
|
57
115
|
readonly onKeyFrameRequest: Event<["fir" | "pli"]>;
|
|
58
|
-
readonly senderBWE: SenderBandwidthEstimator;
|
|
59
116
|
private cname?;
|
|
60
117
|
private mid?;
|
|
61
118
|
private rtpStreamId?;
|
|
@@ -68,40 +125,26 @@ export declare class RTCRtpSender {
|
|
|
68
125
|
private headerExtensions;
|
|
69
126
|
private disposeTrack?;
|
|
70
127
|
private sendEncodings;
|
|
71
|
-
private
|
|
72
|
-
private lastSentSRTimestamp?;
|
|
73
|
-
private ntpTimestamp;
|
|
74
|
-
private rtpTimestamp;
|
|
75
|
-
private octetCount;
|
|
76
|
-
private packetCount;
|
|
77
|
-
private headerBytesSent;
|
|
78
|
-
private rtt?;
|
|
79
|
-
private totalRoundTripTime;
|
|
80
|
-
private roundTripTimeMeasurements;
|
|
81
|
-
private retransmittedPacketsSent;
|
|
82
|
-
private retransmittedBytesSent;
|
|
83
|
-
private nackCount;
|
|
84
|
-
private pliCount;
|
|
85
|
-
private firCount;
|
|
128
|
+
private readonly stats;
|
|
86
129
|
/**
|
|
87
130
|
* Last FIR sequence number per (FIR sender SSRC, FCI target SSRC): RFC 5104
|
|
88
131
|
* 4.3.1.1 keeps one sequence number space per pair.
|
|
89
132
|
*/
|
|
90
133
|
private lastFirSequenceNumbers;
|
|
91
|
-
private remotePacketsLost?;
|
|
92
|
-
private remoteFractionLost?;
|
|
93
134
|
receiverEstimatedMaxBitrate: bigint;
|
|
94
|
-
private
|
|
95
|
-
private timestamp?;
|
|
96
|
-
private timestampOffset;
|
|
97
|
-
private seqOffset;
|
|
98
|
-
private rtpContinuityPending;
|
|
99
|
-
private pendingTimestampStep;
|
|
135
|
+
private readonly continuity;
|
|
100
136
|
private rtpCache;
|
|
101
|
-
private pendingRtp;
|
|
102
|
-
|
|
137
|
+
private readonly pendingRtp;
|
|
138
|
+
/**
|
|
139
|
+
* Bumped on replaceTrack / detachTrack / onSourceChanged. Media accepted
|
|
140
|
+
* under an older epoch is dropped before it can allocate seq/timestamp, so
|
|
141
|
+
* it neither consumes the new source's continuity offset nor leaks out
|
|
142
|
+
* after `replaceTrack(null)`.
|
|
143
|
+
*/
|
|
144
|
+
private sourceEpoch;
|
|
145
|
+
/** Aborted on every source epoch bump to wake probe / pacing waits. */
|
|
146
|
+
private sourceEpochCancel;
|
|
103
147
|
private readonly pendingRtpEnabled;
|
|
104
|
-
private readonly pendingRtpMaxLength;
|
|
105
148
|
codec?: RTCRtpCodecParameters;
|
|
106
149
|
private negotiatedCodecs;
|
|
107
150
|
private sendPrimaryCodec?;
|
|
@@ -122,6 +165,44 @@ export declare class RTCRtpSender {
|
|
|
122
165
|
get streamId(): string | undefined;
|
|
123
166
|
set streamId(value: string | undefined);
|
|
124
167
|
setDtlsTransport(dtlsTransport: RTCDtlsTransport): void;
|
|
168
|
+
/**
|
|
169
|
+
* Replace the send-side bandwidth estimator used for TWCC-driven BWE.
|
|
170
|
+
*
|
|
171
|
+
* Default is the lightweight {@link LightweightBandwidthEstimator}. Pass e.g.
|
|
172
|
+
* `new GccBandwidthEstimator()` to use Google Congestion Control.
|
|
173
|
+
*
|
|
174
|
+
* Behavior on swap:
|
|
175
|
+
* 1. Bumps the estimator generation so in-flight sends discard
|
|
176
|
+
* `rtpPacketSent` delivery and in-flight {@link maybeInjectProbePadding}
|
|
177
|
+
* loops exit (cancelled — no packets to disposed / previous estimator).
|
|
178
|
+
* 2. Stops delivering `rtpPacketSent` / `receiveTWCC` to the previous instance.
|
|
179
|
+
* 3. Unbinds the stable {@link onAvailableBitrate} bridge, then `dispose()`/`reset()` the old instance.
|
|
180
|
+
* 4. **Always** `reset()` the injected `impl` so a previously used instance
|
|
181
|
+
* starts clean (no implicit state merge), then rebinds the bridge.
|
|
182
|
+
* 5. Clears {@link pendingUntrackedBytes} and pacing credit so the next
|
|
183
|
+
* estimator's first `SentInfo.priorUnackedBytes` is 0.
|
|
184
|
+
*
|
|
185
|
+
* Subscriptions to {@link onAvailableBitrate} on this sender are preserved.
|
|
186
|
+
* Re-subscribe algorithm-specific events on the new concrete instance.
|
|
187
|
+
*/
|
|
188
|
+
setBandwidthEstimator(impl: BandwidthEstimator): void;
|
|
189
|
+
/**
|
|
190
|
+
* A new DTLS transport has its own transport-wide sequence space and path:
|
|
191
|
+
* drop the estimator's path state ({@link EstimatorBinding.resetForNewRoute},
|
|
192
|
+
* which also bumps the generation so in-flight sends on the old transport
|
|
193
|
+
* do not report their old TSN) and the pacing / unacked leftovers.
|
|
194
|
+
*/
|
|
195
|
+
private resetBweForNewTransport;
|
|
196
|
+
/** Drop pacing leftover and unacked bytes that belonged to the previous BWE generation. */
|
|
197
|
+
private resetBweSendTransientState;
|
|
198
|
+
/** Initial probes wait until DTLS can send; also on a swap onto a connected sender. */
|
|
199
|
+
private syncNetworkAvailability;
|
|
200
|
+
/**
|
|
201
|
+
* Effective send pacing rate (bps): estimator estimate, raised to the active
|
|
202
|
+
* probe target while probing. 0 when unknown. Lightweight returns 0 from
|
|
203
|
+
* {@link BandwidthEstimator.getPacingBitrateBps} so media is unpaced.
|
|
204
|
+
*/
|
|
205
|
+
get pacingBitrateBps(): number;
|
|
125
206
|
get redDistance(): number;
|
|
126
207
|
set redDistance(n: number);
|
|
127
208
|
/** Internal: the negotiated send parameters, for a negotiation baseline. */
|
|
@@ -148,25 +229,10 @@ export declare class RTCRtpSender {
|
|
|
148
229
|
/** Internal: return to a negotiation baseline's send parameters. */
|
|
149
230
|
restoreSendParams(snapshot: ReturnType<RTCRtpSender["snapshotSendParams"]>): void;
|
|
150
231
|
prepareSend(params: RTCRtpSendParameters): void;
|
|
151
|
-
/**
|
|
152
|
-
* The negotiated direction in effect (the answer's, or a pranswer's while
|
|
153
|
-
* it is pending) does not include sending: RTP is dropped, not queued.
|
|
154
|
-
* @internal
|
|
155
|
-
*/
|
|
156
|
-
sendSuppressed: boolean;
|
|
157
|
-
/** @internal Follow the transceiver's currentDirection. */
|
|
158
|
-
setSendSuppressed(suppressed: boolean): void;
|
|
159
232
|
private canSendRtp;
|
|
160
|
-
private settlePendingRtp;
|
|
161
|
-
private discardPendingRtp;
|
|
162
|
-
private enqueuePendingRtp;
|
|
163
233
|
/**
|
|
164
|
-
* Send queued RTP once DTLS is connected and a codec is set.
|
|
165
|
-
*
|
|
166
|
-
* completes; dropping those packets would lose the start of a media source.
|
|
167
|
-
* `drainingPendingRtp` blocks re-entry while `dispatchRtp` is awaited;
|
|
168
|
-
* packets enqueued during that wait are drained by the recursive call after
|
|
169
|
-
* the flag is cleared.
|
|
234
|
+
* Send queued RTP once DTLS is connected and a codec is set.
|
|
235
|
+
* Drain uses {@link sendRtpInternal} so GCC pacing / TWCC stay on the send path.
|
|
170
236
|
*/
|
|
171
237
|
private drainPendingRtp;
|
|
172
238
|
registerTrack(track: MediaStreamTrack): void;
|
|
@@ -182,31 +248,89 @@ export declare class RTCRtpSender {
|
|
|
182
248
|
keepTrack?: boolean;
|
|
183
249
|
}): void;
|
|
184
250
|
runRtcp(): Promise<void>;
|
|
185
|
-
/**
|
|
186
|
-
|
|
187
|
-
* written immediately if DTLS is connected and a codec is set, otherwise
|
|
188
|
-
* dropped.
|
|
189
|
-
*
|
|
190
|
-
* When pending RTP is enabled, the packet is queued until it can be sent.
|
|
191
|
-
* The returned promise then settles for this packet only:
|
|
192
|
-
* - resolve: DTLS send completed, or the packet was dropped by `stop()`,
|
|
193
|
-
* `replaceTrack(null)`, or pending-queue overflow
|
|
194
|
-
* - reject: DTLS send threw while writing this packet
|
|
195
|
-
*
|
|
196
|
-
* Later `sendRtp()` calls stay pending until their own packet is sent or
|
|
197
|
-
* dropped, even if a drain is already in progress.
|
|
198
|
-
*/
|
|
199
|
-
sendRtp(rtp: Buffer | RtpPacket): Promise<void>;
|
|
251
|
+
/** Sender Report for the instant `nowMonotonicMs` ({@link SenderStatistics.buildSenderReport}). */
|
|
252
|
+
private buildSenderReport;
|
|
200
253
|
/**
|
|
201
254
|
* Schedule RTP continuity rewrite for the next packet that is actually sent.
|
|
202
255
|
* The header argument is kept for API compatibility and is not used to compute
|
|
203
256
|
* offsets. `discontinuity` does not change sequence or timestamp mapping.
|
|
204
257
|
* `timestampStep` (default 1) is the only way to choose the timestamp increment
|
|
205
258
|
* at the source-switch boundary.
|
|
259
|
+
*
|
|
260
|
+
* Use this (or `MediaStreamTrack.notifySourceChanged`) when the RTP written
|
|
261
|
+
* into this sender's track switches to another upstream source: the next
|
|
262
|
+
* packet continues from the last sent one (`seq + 1`, `timestamp + step`)
|
|
263
|
+
* and queued packets of the old source are dropped. Apps that send RTP
|
|
264
|
+
* without `RTCRtpSender` (for example through `SrtpSession`) can use
|
|
265
|
+
* `RtpTimelineRewriter` from werift-rtp instead.
|
|
206
266
|
*/
|
|
207
267
|
replaceRTP(header: Pick<RtpHeader, "sequenceNumber" | "timestamp">, discontinuity?: boolean, timestampStep?: number): void;
|
|
268
|
+
/**
|
|
269
|
+
* Start a new source epoch and drop queued media of the previous source.
|
|
270
|
+
* A packet already past sequence allocation (in its DTLS write) completes;
|
|
271
|
+
* one still waiting on pacing/probe is dropped by {@link sendRtpInternal}.
|
|
272
|
+
*/
|
|
273
|
+
private invalidateQueuedSource;
|
|
274
|
+
private isStaleSource;
|
|
275
|
+
/**
|
|
276
|
+
* Abort signal for a send wait: sender stop, estimator swap, plus source
|
|
277
|
+
* switch for media.
|
|
278
|
+
*/
|
|
279
|
+
private sendWaitSignal;
|
|
280
|
+
/** A waiting send may still go out: not stopped, same estimator, same source. */
|
|
281
|
+
private isSendAlive;
|
|
208
282
|
private scheduleRtpContinuity;
|
|
209
|
-
private
|
|
283
|
+
private dispatchMedia;
|
|
284
|
+
/**
|
|
285
|
+
* Lightweight / disabled estimators neither pace nor probe, so RTP is written
|
|
286
|
+
* straight through as before the BWE abstraction: no FIFO, no queue limit,
|
|
287
|
+
* and no wait before the DTLS write. Pacing estimators (GCC) go through
|
|
288
|
+
* {@link outgoing}. A FIFO still draining after an estimator swap
|
|
289
|
+
* keeps its order by queuing behind it.
|
|
290
|
+
*/
|
|
291
|
+
private dispatchOutgoing;
|
|
292
|
+
/**
|
|
293
|
+
* Send immediately by default or queue until DTLS is ready when pending RTP
|
|
294
|
+
* is enabled. Each call settles only after its own packet is sent or dropped.
|
|
295
|
+
*/
|
|
296
|
+
sendRtp(rtp: Buffer | RtpPacket): Promise<void>;
|
|
297
|
+
/** True when transport-wide CC header extension is negotiated. */
|
|
298
|
+
private isTransportCcNegotiated;
|
|
299
|
+
/**
|
|
300
|
+
* Padding needs an estimator that asks for it, TWCC so feedback can see it,
|
|
301
|
+
* and a negotiated RTX stream to carry it. Without RTX no padding is sent
|
|
302
|
+
* (see `GCC_KNOWN_DIFFERENCES`): media sequence numbers stay untouched.
|
|
303
|
+
*/
|
|
304
|
+
private canSendPadding;
|
|
305
|
+
/**
|
|
306
|
+
* Inject RTP padding packets while a GCC probe cluster is active and media
|
|
307
|
+
* alone has not yet filled min packets / min bitrate×duration.
|
|
308
|
+
*
|
|
309
|
+
* Responsibility split:
|
|
310
|
+
* - Estimator (`ProbeController` / `pendingProbePaddingPackets`) decides need
|
|
311
|
+
* - Sender generates padding-only RTP on the RTX SSRC with a TWCC seq +
|
|
312
|
+
* `isProbation` and paces them
|
|
313
|
+
*/
|
|
314
|
+
maybeInjectProbePadding(): Promise<number>;
|
|
315
|
+
/**
|
|
316
|
+
* pin padding_rate while LossBased is `kIncreaseUsingPadding`.
|
|
317
|
+
* Regular RTP padding (not probe/probation). Probe padding takes priority.
|
|
318
|
+
*/
|
|
319
|
+
maybeInjectLossPadding(): Promise<number>;
|
|
320
|
+
private createPaddingInjector;
|
|
321
|
+
/** Padding-only RTP on the RTX SSRC / payload type ({@link createRtxPaddingPacket}). */
|
|
322
|
+
private createPaddingRtpPacket;
|
|
323
|
+
private sendRtpInternal;
|
|
324
|
+
/** pin BitrateProber next_probe_time wait ({@link waitForProbeSendTime}). */
|
|
325
|
+
private awaitProbeSendTime;
|
|
326
|
+
/**
|
|
327
|
+
* Token-bucket wait against {@link pacingBitrateBps} for **media**.
|
|
328
|
+
* Probe packets use {@link awaitProbeSendTime} instead.
|
|
329
|
+
* Returns false if the sender is stopped, the estimator is swapped
|
|
330
|
+
* (`generation` changes), or the packet's source is replaced/detached while
|
|
331
|
+
* waiting (budget is not consumed then).
|
|
332
|
+
*/
|
|
333
|
+
private awaitPacingBudget;
|
|
210
334
|
/**
|
|
211
335
|
* @param firEntries Internal: the FCI entries of a FIR the router resolved to
|
|
212
336
|
* this sender (see `KeyFrameRequestRouting`). Defaults to the entries for
|
|
@@ -221,9 +345,6 @@ export declare class RTCRtpSender {
|
|
|
221
345
|
setParameters(params: {
|
|
222
346
|
encodings?: Array<Record<string, unknown>>;
|
|
223
347
|
}): void;
|
|
224
|
-
private get outboundRtpStatsId();
|
|
225
|
-
private get mediaSourceStatsId();
|
|
226
|
-
private get remoteInboundRtpStatsId();
|
|
227
348
|
getStatsRootIds(): string[];
|
|
228
349
|
collectStats(timestamp: number): RTCStats[];
|
|
229
350
|
getStats(): Promise<RTCStatsReport>;
|