werift 0.25.1 → 0.26.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/lib/common/src/asn1.d.ts +42 -0
- package/lib/common/src/asn1.js +163 -0
- package/lib/common/src/asn1.js.map +1 -0
- package/lib/common/src/binaryData.js.map +1 -1
- package/lib/common/src/index.d.ts +6 -5
- package/lib/common/src/index.js +6 -5
- package/lib/common/src/index.js.map +1 -1
- package/lib/common/src/log.d.ts +12 -1
- package/lib/common/src/log.js +137 -5
- package/lib/common/src/log.js.map +1 -1
- package/lib/common/src/network.js.map +1 -1
- package/lib/common/src/queue.d.ts +41 -0
- package/lib/common/src/queue.js +146 -0
- package/lib/common/src/queue.js.map +1 -0
- package/lib/common/src/transport.d.ts +15 -2
- package/lib/common/src/transport.js +98 -14
- package/lib/common/src/transport.js.map +1 -1
- package/lib/dtls/src/cipher/create.js.map +1 -1
- package/lib/dtls/src/cipher/ec.js +8 -8
- package/lib/dtls/src/cipher/ec.js.map +1 -1
- package/lib/dtls/src/cipher/namedCurve.js +6 -7
- package/lib/dtls/src/cipher/namedCurve.js.map +1 -1
- package/lib/dtls/src/cipher/prf.d.ts +2 -2
- package/lib/dtls/src/cipher/prf.js +29 -8
- package/lib/dtls/src/cipher/prf.js.map +1 -1
- package/lib/dtls/src/cipher/suites/aead.d.ts +1 -1
- package/lib/dtls/src/context/certificate.d.ts +32 -0
- package/lib/dtls/src/context/certificate.js +54 -0
- package/lib/dtls/src/context/certificate.js.map +1 -0
- package/lib/dtls/src/context/cipher.d.ts +12 -6
- package/lib/dtls/src/context/cipher.js +52 -103
- package/lib/dtls/src/context/cipher.js.map +1 -1
- package/lib/dtls/src/context/transport.d.ts +4 -0
- package/lib/dtls/src/context/transport.js +14 -0
- package/lib/dtls/src/context/transport.js.map +1 -1
- package/lib/dtls/src/flight/client/flight5.js.map +1 -1
- package/lib/dtls/src/flight/flight.js +8 -1
- package/lib/dtls/src/flight/flight.js.map +1 -1
- package/lib/dtls/src/flight/server/flight2.js.map +1 -1
- package/lib/dtls/src/flight/server/flight4.d.ts +2 -1
- package/lib/dtls/src/flight/server/flight4.js +8 -2
- package/lib/dtls/src/flight/server/flight4.js.map +1 -1
- package/lib/dtls/src/handshake/extensions/signature.d.ts +1 -1
- package/lib/dtls/src/handshake/extensions/signature.js.map +1 -1
- package/lib/dtls/src/handshake/message/alert.js +1 -1
- package/lib/dtls/src/handshake/message/alert.js.map +1 -1
- package/lib/dtls/src/handshake/message/certificate.js +1 -1
- package/lib/dtls/src/handshake/message/certificate.js.map +1 -1
- package/lib/dtls/src/handshake/message/changeCipherSpec.js +2 -3
- package/lib/dtls/src/handshake/message/changeCipherSpec.js.map +1 -1
- package/lib/dtls/src/handshake/message/client/certificateVerify.d.ts +1 -1
- package/lib/dtls/src/handshake/message/client/certificateVerify.js +1 -1
- package/lib/dtls/src/handshake/message/client/certificateVerify.js.map +1 -1
- package/lib/dtls/src/handshake/message/client/hello.js +1 -1
- package/lib/dtls/src/handshake/message/client/hello.js.map +1 -1
- package/lib/dtls/src/handshake/message/client/keyExchange.js +1 -1
- package/lib/dtls/src/handshake/message/client/keyExchange.js.map +1 -1
- package/lib/dtls/src/handshake/message/server/certificateRequest.d.ts +1 -1
- package/lib/dtls/src/handshake/message/server/certificateRequest.js +1 -1
- package/lib/dtls/src/handshake/message/server/certificateRequest.js.map +1 -1
- package/lib/dtls/src/handshake/message/server/hello.d.ts +1 -1
- package/lib/dtls/src/handshake/message/server/hello.js +2 -2
- package/lib/dtls/src/handshake/message/server/hello.js.map +1 -1
- package/lib/dtls/src/handshake/message/server/helloDone.js +1 -1
- package/lib/dtls/src/handshake/message/server/helloDone.js.map +1 -1
- package/lib/dtls/src/handshake/message/server/helloVerifyRequest.js +1 -1
- package/lib/dtls/src/handshake/message/server/helloVerifyRequest.js.map +1 -1
- package/lib/dtls/src/handshake/message/server/keyExchange.d.ts +1 -1
- package/lib/dtls/src/handshake/message/server/keyExchange.js +1 -1
- 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 +2 -2
- package/lib/dtls/src/handshake/random.js.map +1 -1
- package/lib/dtls/src/imports/common.d.ts +1 -0
- package/lib/dtls/src/imports/common.js +1 -0
- package/lib/dtls/src/imports/common.js.map +1 -1
- package/lib/dtls/src/index.d.ts +2 -2
- package/lib/dtls/src/index.js +2 -2
- package/lib/dtls/src/index.js.map +1 -1
- package/lib/dtls/src/record/message/fragment.d.ts +1 -1
- package/lib/dtls/src/record/message/fragment.js +3 -3
- package/lib/dtls/src/record/message/fragment.js.map +1 -1
- package/lib/dtls/src/record/message/header.js +2 -2
- package/lib/dtls/src/record/message/header.js.map +1 -1
- package/lib/dtls/src/server.js +1 -1
- package/lib/dtls/src/server.js.map +1 -1
- package/lib/dtls/src/socket.d.ts +2 -2
- package/lib/dtls/src/socket.js +2 -2
- package/lib/dtls/src/socket.js.map +1 -1
- package/lib/ice/src/exceptions.d.ts +30 -0
- package/lib/ice/src/exceptions.js +43 -1
- package/lib/ice/src/exceptions.js.map +1 -1
- package/lib/ice/src/helper.d.ts +1 -1
- package/lib/ice/src/ice.d.ts +142 -0
- package/lib/ice/src/ice.js +809 -53
- package/lib/ice/src/ice.js.map +1 -1
- package/lib/ice/src/iceBase.d.ts +49 -0
- package/lib/ice/src/iceBase.js.map +1 -1
- package/lib/ice/src/index.d.ts +5 -5
- package/lib/ice/src/index.js +5 -5
- package/lib/ice/src/index.js.map +1 -1
- package/lib/ice/src/internal/resolveHostAddresses.d.ts +26 -0
- package/lib/ice/src/internal/resolveHostAddresses.js +45 -0
- package/lib/ice/src/internal/resolveHostAddresses.js.map +1 -0
- package/lib/ice/src/stun/protocol.d.ts +3 -1
- package/lib/ice/src/stun/protocol.js +16 -0
- package/lib/ice/src/stun/protocol.js.map +1 -1
- package/lib/ice/src/stun/tcpProtocol.d.ts +2 -0
- package/lib/ice/src/stun/tcpProtocol.js +16 -1
- package/lib/ice/src/stun/tcpProtocol.js.map +1 -1
- package/lib/ice/src/stun/transaction.d.ts +5 -0
- package/lib/ice/src/stun/transaction.js +7 -1
- package/lib/ice/src/stun/transaction.js.map +1 -1
- package/lib/ice/src/turn/protocol.d.ts +73 -4
- package/lib/ice/src/turn/protocol.js +241 -12
- package/lib/ice/src/turn/protocol.js.map +1 -1
- package/lib/ice/src/utils.js.map +1 -1
- package/lib/ice-server/src/stun/message.d.ts +5 -1
- package/lib/ice-server/src/stun/message.js +33 -2
- package/lib/ice-server/src/stun/message.js.map +1 -1
- package/lib/ice-server/src/turn/auth.d.ts +1 -1
- package/lib/index.mjs +24263 -16477
- package/lib/nonstandard/index.mjs +9272 -6178
- package/lib/polyfill/dom.mjs +24872 -20543
- package/lib/polyfill/index.mjs +24872 -20543
- package/lib/rtp/src/codec/av1.d.ts +61 -1
- package/lib/rtp/src/codec/av1.js +332 -33
- package/lib/rtp/src/codec/av1.js.map +1 -1
- package/lib/rtp/src/codec/base.d.ts +49 -1
- package/lib/rtp/src/codec/base.js +81 -1
- package/lib/rtp/src/codec/base.js.map +1 -1
- package/lib/rtp/src/codec/g711.d.ts +37 -0
- package/lib/rtp/src/codec/g711.js +109 -0
- package/lib/rtp/src/codec/g711.js.map +1 -0
- package/lib/rtp/src/codec/g722.d.ts +31 -0
- package/lib/rtp/src/codec/g722.js +82 -0
- package/lib/rtp/src/codec/g722.js.map +1 -0
- package/lib/rtp/src/codec/h264.d.ts +81 -7
- package/lib/rtp/src/codec/h264.js +382 -21
- package/lib/rtp/src/codec/h264.js.map +1 -1
- package/lib/rtp/src/codec/h265.d.ts +101 -0
- package/lib/rtp/src/codec/h265.js +615 -0
- package/lib/rtp/src/codec/h265.js.map +1 -0
- package/lib/rtp/src/codec/index.d.ts +6 -1
- package/lib/rtp/src/codec/index.js +25 -0
- package/lib/rtp/src/codec/index.js.map +1 -1
- package/lib/rtp/src/codec/mp4a.d.ts +88 -0
- package/lib/rtp/src/codec/mp4a.js +386 -0
- package/lib/rtp/src/codec/mp4a.js.map +1 -0
- package/lib/rtp/src/codec/opus.d.ts +14 -2
- package/lib/rtp/src/codec/opus.js +32 -2
- package/lib/rtp/src/codec/opus.js.map +1 -1
- package/lib/rtp/src/codec/telephoneEvent.d.ts +102 -0
- package/lib/rtp/src/codec/telephoneEvent.js +176 -0
- package/lib/rtp/src/codec/telephoneEvent.js.map +1 -0
- package/lib/rtp/src/codec/vp8.d.ts +26 -1
- package/lib/rtp/src/codec/vp8.js +76 -2
- package/lib/rtp/src/codec/vp8.js.map +1 -1
- package/lib/rtp/src/codec/vp9.d.ts +25 -1
- package/lib/rtp/src/codec/vp9.js +64 -2
- package/lib/rtp/src/codec/vp9.js.map +1 -1
- package/lib/rtp/src/const.d.ts +1 -0
- package/lib/rtp/src/const.js +5 -0
- package/lib/rtp/src/const.js.map +1 -0
- package/lib/rtp/src/extra/container/mp4/container.js +4 -1
- package/lib/rtp/src/extra/container/mp4/container.js.map +1 -1
- package/lib/rtp/src/extra/container/mp4/h264.d.ts +26 -0
- package/lib/rtp/src/extra/container/mp4/h264.js +54 -0
- package/lib/rtp/src/extra/container/mp4/h264.js.map +1 -1
- package/lib/rtp/src/extra/container/webm/container.d.ts +1 -1
- package/lib/rtp/src/extra/container/webm/ebml/ebml.d.ts +6 -0
- package/lib/rtp/src/extra/container/webm/ebml/ebml.js +20 -1
- package/lib/rtp/src/extra/container/webm/ebml/ebml.js.map +1 -1
- package/lib/rtp/src/extra/processor/depacketizer.d.ts +1 -1
- package/lib/rtp/src/extra/processor/depacketizer.js +1 -1
- package/lib/rtp/src/extra/processor/depacketizer.js.map +1 -1
- package/lib/rtp/src/extra/processor/depacketizerCallback.d.ts +1 -11
- package/lib/rtp/src/extra/processor/depacketizerTransformer.d.ts +1 -1
- package/lib/rtp/src/extra/processor/dtxCallback.d.ts +1 -11
- package/lib/rtp/src/extra/processor/interface.d.ts +16 -11
- package/lib/rtp/src/extra/processor/interface.js.map +1 -1
- package/lib/rtp/src/extra/processor/jitterBufferCallback.d.ts +1 -11
- package/lib/rtp/src/extra/processor/jitterBufferTransformer.d.ts +1 -1
- package/lib/rtp/src/extra/processor/mp4.d.ts +16 -0
- package/lib/rtp/src/extra/processor/mp4.js +55 -21
- package/lib/rtp/src/extra/processor/mp4.js.map +1 -1
- package/lib/rtp/src/extra/processor/nack.d.ts +1 -1
- package/lib/rtp/src/extra/processor/nack.js +1 -1
- package/lib/rtp/src/extra/processor/nack.js.map +1 -1
- package/lib/rtp/src/extra/processor/nackHandlerCallback.d.ts +1 -11
- package/lib/rtp/src/extra/processor/ntpTime.js.map +1 -1
- package/lib/rtp/src/extra/processor/ntpTimeCallback.d.ts +1 -11
- package/lib/rtp/src/extra/processor/rtcpCallback.d.ts +1 -1
- package/lib/rtp/src/extra/processor/rtcpCallback.js.map +1 -1
- package/lib/rtp/src/extra/processor/rtpCallback.d.ts +1 -1
- package/lib/rtp/src/extra/processor/rtpCallback.js +1 -1
- package/lib/rtp/src/extra/processor/rtpCallback.js.map +1 -1
- package/lib/rtp/src/extra/processor/rtpStream.d.ts +2 -2
- package/lib/rtp/src/extra/processor/rtpStream.js.map +1 -1
- package/lib/rtp/src/extra/processor/rtpTime.js.map +1 -1
- package/lib/rtp/src/extra/processor/rtpTimeCallback.d.ts +1 -11
- package/lib/rtp/src/extra/processor/webm.d.ts +27 -0
- package/lib/rtp/src/extra/processor/webm.js +43 -16
- package/lib/rtp/src/extra/processor/webm.js.map +1 -1
- package/lib/rtp/src/extra/processor/webmCallback.js +6 -1
- package/lib/rtp/src/extra/processor/webmCallback.js.map +1 -1
- package/lib/rtp/src/extra/processor/webmStream.js.map +1 -1
- package/lib/rtp/src/helper.d.ts +2 -2
- package/lib/rtp/src/helper.js +2 -6
- package/lib/rtp/src/helper.js.map +1 -1
- package/lib/rtp/src/index.d.ts +4 -2
- package/lib/rtp/src/index.js +4 -2
- package/lib/rtp/src/index.js.map +1 -1
- package/lib/rtp/src/rtcp/psfb/fullIntraRequest.js +2 -1
- package/lib/rtp/src/rtcp/psfb/fullIntraRequest.js.map +1 -1
- package/lib/rtp/src/rtcp/rtcp.js +2 -1
- package/lib/rtp/src/rtcp/rtcp.js.map +1 -1
- package/lib/rtp/src/rtcp/sr.d.ts +4 -3
- package/lib/rtp/src/rtcp/sr.js +3 -2
- package/lib/rtp/src/rtcp/sr.js.map +1 -1
- package/lib/rtp/src/rtp/mediaClock.d.ts +283 -0
- package/lib/rtp/src/rtp/mediaClock.js +655 -0
- package/lib/rtp/src/rtp/mediaClock.js.map +1 -0
- package/lib/rtp/src/srtp/cipher/ctr.d.ts +2 -2
- package/lib/rtp/src/srtp/cipher/ctr.js +1 -1
- package/lib/rtp/src/srtp/cipher/ctr.js.map +1 -1
- package/lib/rtp/src/srtp/cipher/gcm.d.ts +1 -1
- package/lib/rtp/src/srtp/cipher/gcm.js +1 -1
- package/lib/rtp/src/srtp/cipher/gcm.js.map +1 -1
- package/lib/rtp/src/srtp/context/context.d.ts +29 -1
- package/lib/rtp/src/srtp/context/context.js +78 -24
- package/lib/rtp/src/srtp/context/context.js.map +1 -1
- package/lib/rtp/src/srtp/context/srtp.js +23 -15
- package/lib/rtp/src/srtp/context/srtp.js.map +1 -1
- package/lib/rtp/src/util.d.ts +59 -6
- package/lib/rtp/src/util.js +88 -10
- package/lib/rtp/src/util.js.map +1 -1
- package/lib/sctp/src/index.d.ts +4 -3
- package/lib/sctp/src/index.js +10 -8
- package/lib/sctp/src/index.js.map +1 -1
- package/lib/sctp/src/sctp.d.ts +11 -2
- package/lib/sctp/src/sctp.js +47 -28
- package/lib/sctp/src/sctp.js.map +1 -1
- package/lib/webrtc/src/api/peerConfig.d.ts +264 -0
- package/lib/webrtc/src/api/peerConfig.js +250 -0
- package/lib/webrtc/src/api/peerConfig.js.map +1 -0
- package/lib/webrtc/src/api/peerConnectionEvents.d.ts +36 -0
- package/lib/webrtc/src/api/peerConnectionEvents.js +44 -0
- package/lib/webrtc/src/api/peerConnectionEvents.js.map +1 -0
- package/lib/webrtc/src/dataChannel.d.ts +1 -1
- package/lib/webrtc/src/dataChannel.js +1 -1
- package/lib/webrtc/src/dataChannel.js.map +1 -1
- package/lib/webrtc/src/index.d.ts +2 -2
- package/lib/webrtc/src/index.js +2 -2
- package/lib/webrtc/src/index.js.map +1 -1
- package/lib/webrtc/src/media/codec.d.ts +18 -0
- package/lib/webrtc/src/media/codec.js +43 -2
- package/lib/webrtc/src/media/codec.js.map +1 -1
- package/lib/webrtc/src/media/codecCompatibility.d.ts +5 -0
- package/lib/webrtc/src/media/codecCompatibility.js +15 -4
- package/lib/webrtc/src/media/codecCompatibility.js.map +1 -1
- package/lib/webrtc/src/media/index.d.ts +1 -1
- package/lib/webrtc/src/media/index.js +1 -1
- package/lib/webrtc/src/media/index.js.map +1 -1
- package/lib/webrtc/src/media/receiver/nack.js +3 -4
- package/lib/webrtc/src/media/receiver/nack.js.map +1 -1
- package/lib/webrtc/src/media/receiver/receiverTwcc.js.map +1 -1
- package/lib/webrtc/src/media/router.d.ts +116 -5
- package/lib/webrtc/src/media/router.js +281 -29
- package/lib/webrtc/src/media/router.js.map +1 -1
- package/lib/webrtc/src/media/rtpReceiver.d.ts +107 -12
- package/lib/webrtc/src/media/rtpReceiver.js +255 -28
- package/lib/webrtc/src/media/rtpReceiver.js.map +1 -1
- package/lib/webrtc/src/media/rtpSender.d.ts +56 -3
- package/lib/webrtc/src/media/rtpSender.js +180 -21
- package/lib/webrtc/src/media/rtpSender.js.map +1 -1
- package/lib/webrtc/src/media/rtpTransceiver.d.ts +94 -1
- package/lib/webrtc/src/media/rtpTransceiver.js +111 -2
- package/lib/webrtc/src/media/rtpTransceiver.js.map +1 -1
- package/lib/webrtc/src/media/sender/senderBWE.d.ts +2 -1
- package/lib/webrtc/src/media/sender/senderBWE.js +22 -10
- package/lib/webrtc/src/media/sender/senderBWE.js.map +1 -1
- package/lib/webrtc/src/media/track.d.ts +1 -1
- package/lib/webrtc/src/media/track.js +1 -1
- package/lib/webrtc/src/media/track.js.map +1 -1
- package/lib/webrtc/src/negotiation/bundleTopology.d.ts +107 -0
- package/lib/webrtc/src/negotiation/bundleTopology.js +380 -0
- package/lib/webrtc/src/negotiation/bundleTopology.js.map +1 -0
- package/lib/webrtc/src/negotiation/descriptionValidation.d.ts +51 -0
- package/lib/webrtc/src/negotiation/descriptionValidation.js +261 -0
- package/lib/webrtc/src/negotiation/descriptionValidation.js.map +1 -0
- package/lib/webrtc/src/negotiation/iceRestartRequest.d.ts +21 -0
- package/lib/webrtc/src/negotiation/iceRestartRequest.js +61 -0
- package/lib/webrtc/src/negotiation/iceRestartRequest.js.map +1 -0
- package/lib/webrtc/src/negotiation/internalState.d.ts +34 -0
- package/lib/webrtc/src/negotiation/internalState.js +21 -0
- package/lib/webrtc/src/negotiation/internalState.js.map +1 -0
- package/lib/webrtc/src/negotiation/negotiationNeeded.d.ts +44 -0
- package/lib/webrtc/src/negotiation/negotiationNeeded.js +118 -0
- package/lib/webrtc/src/negotiation/negotiationNeeded.js.map +1 -0
- package/lib/webrtc/src/negotiation/remoteCandidates.d.ts +86 -0
- package/lib/webrtc/src/negotiation/remoteCandidates.js +344 -0
- package/lib/webrtc/src/negotiation/remoteCandidates.js.map +1 -0
- package/lib/webrtc/src/negotiation/remoteMediaApplication.d.ts +71 -0
- package/lib/webrtc/src/negotiation/remoteMediaApplication.js +398 -0
- package/lib/webrtc/src/negotiation/remoteMediaApplication.js.map +1 -0
- package/lib/webrtc/src/negotiation/transportActivation.d.ts +59 -0
- package/lib/webrtc/src/negotiation/transportActivation.js +345 -0
- package/lib/webrtc/src/negotiation/transportActivation.js.map +1 -0
- package/lib/webrtc/src/negotiationTransaction.d.ts +233 -0
- package/lib/webrtc/src/negotiationTransaction.js +591 -0
- package/lib/webrtc/src/negotiationTransaction.js.map +1 -0
- package/lib/webrtc/src/nonstandard/dummyMedia.js +20 -6
- package/lib/webrtc/src/nonstandard/dummyMedia.js.map +1 -1
- package/lib/webrtc/src/nonstandard/index.d.ts +1 -1
- package/lib/webrtc/src/nonstandard/index.js +1 -1
- package/lib/webrtc/src/nonstandard/index.js.map +1 -1
- package/lib/webrtc/src/nonstandard/navigator.js.map +1 -1
- package/lib/webrtc/src/nonstandard/recorder/writer/index.d.ts +1 -1
- package/lib/webrtc/src/nonstandard/recorder/writer/index.js.map +1 -1
- package/lib/webrtc/src/nonstandard/recorder/writer/webm.d.ts +2 -2
- package/lib/webrtc/src/nonstandard/recorder/writer/webm.js +2 -2
- package/lib/webrtc/src/nonstandard/recorder/writer/webm.js.map +1 -1
- package/lib/webrtc/src/nonstandard/userMedia/packetizer.d.ts +4 -4
- package/lib/webrtc/src/nonstandard/userMedia/packetizer.js +61 -306
- package/lib/webrtc/src/nonstandard/userMedia/packetizer.js.map +1 -1
- package/lib/webrtc/src/nonstandard/userMedia.d.ts +4 -2
- package/lib/webrtc/src/nonstandard/userMedia.js +43 -9
- package/lib/webrtc/src/nonstandard/userMedia.js.map +1 -1
- package/lib/webrtc/src/peerConnection.d.ts +132 -237
- package/lib/webrtc/src/peerConnection.js +971 -906
- package/lib/webrtc/src/peerConnection.js.map +1 -1
- package/lib/webrtc/src/polyfill/api.d.ts +5 -5
- package/lib/webrtc/src/polyfill/api.js.map +1 -1
- package/lib/webrtc/src/polyfill/index.js.map +1 -1
- package/lib/webrtc/src/polyfill/install.js +1 -1
- package/lib/webrtc/src/polyfill/install.js.map +1 -1
- package/lib/webrtc/src/polyfill/mediaDevices.js.map +1 -1
- package/lib/webrtc/src/polyfill/registers/mp4Webm.js.map +1 -1
- package/lib/webrtc/src/polyfill/registers/rtpRtcp.js.map +1 -1
- package/lib/webrtc/src/polyfill/selectSettings.js.map +1 -1
- package/lib/webrtc/src/polyfill/sourceIo.js.map +1 -1
- package/lib/webrtc/src/sctpManager.d.ts +66 -2
- package/lib/webrtc/src/sctpManager.js +122 -5
- package/lib/webrtc/src/sctpManager.js.map +1 -1
- package/lib/webrtc/src/sdp.js.map +1 -1
- package/lib/webrtc/src/sdpManager.d.ts +55 -11
- package/lib/webrtc/src/sdpManager.js +367 -89
- package/lib/webrtc/src/sdpManager.js.map +1 -1
- package/lib/webrtc/src/secureTransportManager.d.ts +38 -25
- package/lib/webrtc/src/secureTransportManager.js +130 -34
- package/lib/webrtc/src/secureTransportManager.js.map +1 -1
- package/lib/webrtc/src/transceiverManager.d.ts +62 -18
- package/lib/webrtc/src/transceiverManager.js +266 -105
- package/lib/webrtc/src/transceiverManager.js.map +1 -1
- package/lib/webrtc/src/transport/dtls.d.ts +11 -2
- package/lib/webrtc/src/transport/dtls.js +37 -13
- package/lib/webrtc/src/transport/dtls.js.map +1 -1
- package/lib/webrtc/src/transport/ice.d.ts +254 -7
- package/lib/webrtc/src/transport/ice.js +608 -52
- package/lib/webrtc/src/transport/ice.js.map +1 -1
- package/lib/webrtc/src/transport/iceCandidateAttribute.d.ts +98 -0
- package/lib/webrtc/src/transport/iceCandidateAttribute.js +129 -0
- package/lib/webrtc/src/transport/iceCandidateAttribute.js.map +1 -0
- package/lib/webrtc/src/transport/sctp.d.ts +4 -1
- package/lib/webrtc/src/transport/sctp.js +83 -17
- package/lib/webrtc/src/transport/sctp.js.map +1 -1
- package/lib/webrtc/src/utils.d.ts +3 -3
- package/lib/webrtc/src/utils.js +1 -1
- package/lib/webrtc/src/utils.js.map +1 -1
- package/package.json +13 -14
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import { Event } from "../../../common/src";
|
|
2
|
+
export interface RtpMediaTimelineOptions {
|
|
3
|
+
/** RTP clock rate in Hz (e.g. 48000 for Opus, 90000 for video). */
|
|
4
|
+
clockRate: number;
|
|
5
|
+
/**
|
|
6
|
+
* Samples per frame. May be fractional (e.g. 90000 / 29.97).
|
|
7
|
+
* Exactly one of `frameSamples` / `frameDurationMs` must be given.
|
|
8
|
+
*/
|
|
9
|
+
frameSamples?: number;
|
|
10
|
+
/** Frame duration in milliseconds. May be fractional. */
|
|
11
|
+
frameDurationMs?: number;
|
|
12
|
+
/** RTP timestamp of frame 0. Default: random32(). */
|
|
13
|
+
initialTimestamp?: number;
|
|
14
|
+
}
|
|
15
|
+
/** Wall-clock anchor that maps a monotonic time to a frame index. */
|
|
16
|
+
export interface RtpMediaTimelineAnchor {
|
|
17
|
+
/** Monotonic time (ms) of `frameIndex`'s deadline. */
|
|
18
|
+
time: number;
|
|
19
|
+
frameIndex: number;
|
|
20
|
+
}
|
|
21
|
+
export interface RtpMediaClockTick {
|
|
22
|
+
/** Slot number N of this tick. */
|
|
23
|
+
frameIndex: number;
|
|
24
|
+
/** RTP timestamp of the slot (uint32, wrapped). */
|
|
25
|
+
timestamp: number;
|
|
26
|
+
/** Samples elapsed since the previous tick, including skipped slots. */
|
|
27
|
+
elapsedSamples: number;
|
|
28
|
+
/** Slots that were skipped instead of being emitted (normally 0). */
|
|
29
|
+
skippedFrames: number;
|
|
30
|
+
/** Scheduled monotonic time (ms) of this slot. */
|
|
31
|
+
deadline: number;
|
|
32
|
+
/** `now - deadline` in ms. */
|
|
33
|
+
lateness: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Pure, deterministic RTP media timeline.
|
|
37
|
+
*
|
|
38
|
+
* All values are computed absolutely from the frame index, so no error
|
|
39
|
+
* accumulates no matter how long the timeline runs.
|
|
40
|
+
*/
|
|
41
|
+
export declare class RtpMediaTimeline {
|
|
42
|
+
readonly clockRate: number;
|
|
43
|
+
readonly frameSamples: number;
|
|
44
|
+
readonly frameDurationMs: number;
|
|
45
|
+
readonly initialTimestamp: number;
|
|
46
|
+
constructor(options: RtpMediaTimelineOptions);
|
|
47
|
+
/** `round(N * frameSamples)`: samples elapsed from frame 0 to frame N. */
|
|
48
|
+
elapsedSamples(frameIndex: number): number;
|
|
49
|
+
/** `(initialTimestamp + elapsedSamples(N)) mod 2^32` */
|
|
50
|
+
timestamp(frameIndex: number): number;
|
|
51
|
+
/** `anchor.time + (N - anchor.frameIndex) * frameDurationMs` */
|
|
52
|
+
deadline(anchor: RtpMediaTimelineAnchor, frameIndex: number): number;
|
|
53
|
+
/** Latest slot whose deadline has been reached at `now`. */
|
|
54
|
+
latestFrameIndex(anchor: RtpMediaTimelineAnchor, now: number): number;
|
|
55
|
+
/**
|
|
56
|
+
* Resolves the tick to emit at `now`.
|
|
57
|
+
*
|
|
58
|
+
* Returns `undefined` when the deadline of `nextFrameIndex` has not been
|
|
59
|
+
* reached yet. When several slots have elapsed, `stallPolicy: "skip"`
|
|
60
|
+
* (default) returns only the latest reached slot and reports the slots in
|
|
61
|
+
* between as `skippedFrames`; `"delay"` returns `nextFrameIndex` with its
|
|
62
|
+
* original deadline, so `lateness` shows how far behind the clock is.
|
|
63
|
+
* `skippedFrames` and `elapsedSamples` are counted from `lastFrameIndex`
|
|
64
|
+
* (or from `baseFrameIndex` before the first tick), so a `nextFrameIndex`
|
|
65
|
+
* moved forward (e.g. by `resume()`) is reported as skipped too.
|
|
66
|
+
*/
|
|
67
|
+
resolveTick({ anchor, nextFrameIndex, lastFrameIndex, baseFrameIndex, now, stallPolicy, }: {
|
|
68
|
+
anchor: RtpMediaTimelineAnchor;
|
|
69
|
+
nextFrameIndex: number;
|
|
70
|
+
/** Frame index of the previous tick, if any. */
|
|
71
|
+
lastFrameIndex?: number;
|
|
72
|
+
/**
|
|
73
|
+
* First slot of the timeline, used as the counting origin while there is no
|
|
74
|
+
* previous tick. Default: `nextFrameIndex`.
|
|
75
|
+
*/
|
|
76
|
+
baseFrameIndex?: number;
|
|
77
|
+
now: number;
|
|
78
|
+
stallPolicy?: RtpMediaClockStallPolicy;
|
|
79
|
+
}): RtpMediaClockTick | undefined;
|
|
80
|
+
}
|
|
81
|
+
export interface RtpMediaClockScheduler {
|
|
82
|
+
setTimeout(cb: () => void, ms: number): unknown;
|
|
83
|
+
clearTimeout(handle: unknown): void;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* What to do when the clock falls behind by one frame or more.
|
|
87
|
+
*
|
|
88
|
+
* - `"skip"`: jump to the latest reached slot. The slots in between are
|
|
89
|
+
* reported as `skippedFrames` and appear as a timestamp gap. RTP time stays
|
|
90
|
+
* aligned with real time. Suited to audio and to live video that encodes the
|
|
91
|
+
* latest captured frame on each tick.
|
|
92
|
+
* - `"delay"`: never skip a slot. The late slot is emitted immediately and the
|
|
93
|
+
* timeline is re-anchored to `now`, so the stall is absorbed as added latency
|
|
94
|
+
* instead of a gap or a burst. Suited to already-encoded video (or any source
|
|
95
|
+
* where every frame must be sent) at a constant frame rate.
|
|
96
|
+
*/
|
|
97
|
+
export type RtpMediaClockStallPolicy = "skip" | "delay";
|
|
98
|
+
export interface RtpMediaClockOptions extends RtpMediaTimelineOptions {
|
|
99
|
+
/** Default: `"skip"`. */
|
|
100
|
+
stallPolicy?: RtpMediaClockStallPolicy;
|
|
101
|
+
/** Monotonic time source in ms. Default: `performance.now()`. */
|
|
102
|
+
now?: () => number;
|
|
103
|
+
/** Timer implementation. Default: global setTimeout / clearTimeout. */
|
|
104
|
+
scheduler?: RtpMediaClockScheduler;
|
|
105
|
+
/** Call `unref()` on timer handles (Node.js only). Default: false. */
|
|
106
|
+
unref?: boolean;
|
|
107
|
+
/** Aborting the signal is equivalent to `stop()`. */
|
|
108
|
+
signal?: AbortSignal;
|
|
109
|
+
}
|
|
110
|
+
export interface RtpMediaClockResumeOptions {
|
|
111
|
+
/**
|
|
112
|
+
* `false`: the paused wall-clock time is reflected as a timestamp gap, the
|
|
113
|
+
* same as a scheduler stall.
|
|
114
|
+
* `true`: the pause is collapsed and the timeline advances by one frame.
|
|
115
|
+
*
|
|
116
|
+
* Default: `false` for `stallPolicy: "skip"`, `true` for `"delay"`.
|
|
117
|
+
*/
|
|
118
|
+
continuous?: boolean;
|
|
119
|
+
}
|
|
120
|
+
export type RtpMediaClockState = "idle" | "running" | "paused" | "stopped";
|
|
121
|
+
/**
|
|
122
|
+
* Monotonic real-time RTP media clock / pacer.
|
|
123
|
+
*
|
|
124
|
+
* - Each slot N is scheduled at the absolute deadline
|
|
125
|
+
* `origin + N * frameDurationMs`, so timer lateness never accumulates.
|
|
126
|
+
* - When the event loop stalls past several deadlines, `onTick` fires once.
|
|
127
|
+
* With `stallPolicy: "skip"` (default) it fires for the latest reached slot;
|
|
128
|
+
* the slots in between are reported via `skippedFrames` and appear as a
|
|
129
|
+
* timestamp gap. With `"delay"` it fires for the next slot and re-anchors
|
|
130
|
+
* the timeline, so no slot is skipped. Late ticks are never burst.
|
|
131
|
+
* - `onTick` subscribers are invoked synchronously after the internal state
|
|
132
|
+
* (including the next timer) has been updated. Returned promises are not
|
|
133
|
+
* awaited; backpressure is out of scope.
|
|
134
|
+
* - `resume()` re-anchors the origin to the resume time and emits a tick
|
|
135
|
+
* immediately. With `"skip"` the paused time is reflected as a timestamp gap
|
|
136
|
+
* by default; pass `{ continuous: true }` to collapse it (default for
|
|
137
|
+
* `"delay"`).
|
|
138
|
+
*
|
|
139
|
+
* This is an opt-in utility for media sources. `RTCRtpSender.sendRtp()` never
|
|
140
|
+
* rewrites RTP timestamps based on send time.
|
|
141
|
+
*/
|
|
142
|
+
export declare class RtpMediaClock {
|
|
143
|
+
readonly timeline: RtpMediaTimeline;
|
|
144
|
+
readonly onTick: Event<[RtpMediaClockTick]>;
|
|
145
|
+
readonly stallPolicy: RtpMediaClockStallPolicy;
|
|
146
|
+
private readonly now;
|
|
147
|
+
private readonly scheduler;
|
|
148
|
+
private readonly unref;
|
|
149
|
+
private readonly signal?;
|
|
150
|
+
private _state;
|
|
151
|
+
private anchor;
|
|
152
|
+
private nextFrameIndex;
|
|
153
|
+
private _lastTick?;
|
|
154
|
+
private timerHandle?;
|
|
155
|
+
constructor(options: RtpMediaClockOptions);
|
|
156
|
+
get state(): RtpMediaClockState;
|
|
157
|
+
get clockRate(): number;
|
|
158
|
+
/** The most recently emitted tick. */
|
|
159
|
+
get lastTick(): RtpMediaClockTick | undefined;
|
|
160
|
+
/** RTP timestamp of the latest tick, or of frame 0 before the first tick. */
|
|
161
|
+
get timestamp(): number;
|
|
162
|
+
start(onTick?: (tick: RtpMediaClockTick) => void): void;
|
|
163
|
+
pause(): void;
|
|
164
|
+
resume(options?: RtpMediaClockResumeOptions): void;
|
|
165
|
+
stop(): void;
|
|
166
|
+
private handleAbort;
|
|
167
|
+
private schedule;
|
|
168
|
+
private clearTimer;
|
|
169
|
+
private handleTimer;
|
|
170
|
+
}
|
|
171
|
+
export interface RtpMediaPacerOptions {
|
|
172
|
+
/** RTP clock rate in Hz (e.g. 90000 for video). */
|
|
173
|
+
clockRate: number;
|
|
174
|
+
/** RTP timestamp of the first pushed frame's `pts`. Default: random32(). */
|
|
175
|
+
initialTimestamp?: number;
|
|
176
|
+
/**
|
|
177
|
+
* Initial playout delay (ms) of the first frame. For streaming sources it
|
|
178
|
+
* absorbs arrival jitter / bursts up to this amount without re-anchoring.
|
|
179
|
+
* Default: 0.
|
|
180
|
+
*/
|
|
181
|
+
latencyMs?: number;
|
|
182
|
+
/** Monotonic time source in ms. Default: `performance.now()`. */
|
|
183
|
+
now?: () => number;
|
|
184
|
+
/** Timer implementation. Default: global setTimeout / clearTimeout. */
|
|
185
|
+
scheduler?: RtpMediaClockScheduler;
|
|
186
|
+
/** Call `unref()` on timer handles (Node.js only). Default: false. */
|
|
187
|
+
unref?: boolean;
|
|
188
|
+
/** Aborting the signal is equivalent to `stop()`. */
|
|
189
|
+
signal?: AbortSignal;
|
|
190
|
+
}
|
|
191
|
+
export interface RtpMediaPacerFrameTiming {
|
|
192
|
+
/**
|
|
193
|
+
* Presentation time in `clockRate` units (e.g. container PTS rescaled to
|
|
194
|
+
* 90 kHz). Becomes the RTP timestamp. May be fractional.
|
|
195
|
+
*/
|
|
196
|
+
pts: number;
|
|
197
|
+
/**
|
|
198
|
+
* Decode time in `clockRate` units; frames are paced by it and must be pushed
|
|
199
|
+
* in non-decreasing `dts` order. Default: `pts` (no B-frames).
|
|
200
|
+
*/
|
|
201
|
+
dts?: number;
|
|
202
|
+
}
|
|
203
|
+
export interface RtpMediaPacerTick<T> {
|
|
204
|
+
frame: T;
|
|
205
|
+
/** Number of frames emitted before this one. */
|
|
206
|
+
frameIndex: number;
|
|
207
|
+
/** RTP timestamp derived from `pts` (uint32, wrapped). */
|
|
208
|
+
timestamp: number;
|
|
209
|
+
pts: number;
|
|
210
|
+
dts: number;
|
|
211
|
+
/** Scheduled monotonic time (ms) of this frame. */
|
|
212
|
+
deadline: number;
|
|
213
|
+
/** `now - deadline` in ms. */
|
|
214
|
+
lateness: number;
|
|
215
|
+
/** Total time (ms) the timeline has been shifted by stalls and pauses. */
|
|
216
|
+
delay: number;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Monotonic real-time pacer for frames with their own timestamps, such as
|
|
220
|
+
* variable-frame-rate encoded video. Works both for sources that are read
|
|
221
|
+
* ahead (demuxed files) and for streaming sources that deliver frames in real
|
|
222
|
+
* time with jitter (live encoders, pipes, network ingest).
|
|
223
|
+
*
|
|
224
|
+
* - Frame k is emitted at the absolute deadline
|
|
225
|
+
* `anchor.time + (dts(k) - anchor.dts) * 1000 / clockRate`, so timer
|
|
226
|
+
* lateness never accumulates. The RTP timestamp is
|
|
227
|
+
* `initialTimestamp + (pts(k) - pts(first frame))`, which keeps the source's
|
|
228
|
+
* frame spacing (including B-frame reordering).
|
|
229
|
+
* - Frames are never skipped. When the emitted frame and the next queued frame
|
|
230
|
+
* are both overdue (a stall, or a producer that pushes a late batch), only
|
|
231
|
+
* the emitted frame is sent and the timeline is re-anchored to `now`, so the
|
|
232
|
+
* stall becomes added latency (`delay`) instead of a burst. A frame pushed
|
|
233
|
+
* after its deadline while the queue is empty is emitted immediately.
|
|
234
|
+
* - For streaming sources, frames arriving early (bursts) wait for their
|
|
235
|
+
* deadline and frames arriving late are sent at once, so `delay` grows only
|
|
236
|
+
* up to the worst arrival lateness seen, never cumulatively. `latencyMs`
|
|
237
|
+
* reserves headroom for that jitter up front.
|
|
238
|
+
* - `resume()` emits the next frame immediately if it became due while paused
|
|
239
|
+
* and re-anchors to it; the paused time is added to `delay`.
|
|
240
|
+
* - `onTick` subscribers are invoked synchronously after the internal state has
|
|
241
|
+
* been updated. Returned promises are not awaited; use `queueLength` for
|
|
242
|
+
* backpressure on the producer side.
|
|
243
|
+
*/
|
|
244
|
+
export declare class RtpMediaPacer<T = Buffer> {
|
|
245
|
+
readonly clockRate: number;
|
|
246
|
+
readonly initialTimestamp: number;
|
|
247
|
+
readonly onTick: Event<[RtpMediaPacerTick<T>]>;
|
|
248
|
+
private readonly now;
|
|
249
|
+
private readonly scheduler;
|
|
250
|
+
private readonly unref;
|
|
251
|
+
private readonly signal?;
|
|
252
|
+
private readonly latencyMs;
|
|
253
|
+
private _state;
|
|
254
|
+
private queue;
|
|
255
|
+
private firstPts?;
|
|
256
|
+
private lastPushedDts?;
|
|
257
|
+
/** maps a dts to a monotonic time; undefined until the first emission */
|
|
258
|
+
private anchor?;
|
|
259
|
+
private frameIndex;
|
|
260
|
+
private _delay;
|
|
261
|
+
private _lastTick?;
|
|
262
|
+
private timerHandle?;
|
|
263
|
+
constructor(options: RtpMediaPacerOptions);
|
|
264
|
+
get state(): RtpMediaClockState;
|
|
265
|
+
/** Frames pushed but not emitted yet. */
|
|
266
|
+
get queueLength(): number;
|
|
267
|
+
/** The most recently emitted tick. */
|
|
268
|
+
get lastTick(): RtpMediaPacerTick<T> | undefined;
|
|
269
|
+
/** Total time (ms) the timeline has been shifted so far. */
|
|
270
|
+
get delay(): number;
|
|
271
|
+
/** Queues a frame. Frames may be pushed before `start()`. */
|
|
272
|
+
push(frame: T, timing: RtpMediaPacerFrameTiming): void;
|
|
273
|
+
start(onTick?: (tick: RtpMediaPacerTick<T>) => void): void;
|
|
274
|
+
pause(): void;
|
|
275
|
+
resume(): void;
|
|
276
|
+
stop(): void;
|
|
277
|
+
private handleAbort;
|
|
278
|
+
private deadline;
|
|
279
|
+
private reanchor;
|
|
280
|
+
private scheduleNext;
|
|
281
|
+
private clearTimer;
|
|
282
|
+
private handleTimer;
|
|
283
|
+
}
|