werift 0.18.17 → 0.19.1
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/binary.js.map +1 -1
- package/lib/common/src/network.js.map +1 -1
- package/lib/common/src/promise.js.map +1 -1
- package/lib/dtls/src/cipher/const.d.ts +8 -0
- package/lib/dtls/src/cipher/const.js +10 -2
- package/lib/dtls/src/cipher/const.js.map +1 -1
- package/lib/dtls/src/cipher/create.js +10 -10
- package/lib/dtls/src/cipher/create.js.map +1 -1
- package/lib/dtls/src/cipher/ec.d.ts +9 -0
- package/lib/dtls/src/cipher/ec.js +22 -0
- package/lib/dtls/src/cipher/ec.js.map +1 -0
- package/lib/dtls/src/cipher/namedCurve.js +6 -29
- package/lib/dtls/src/cipher/namedCurve.js.map +1 -1
- package/lib/dtls/src/cipher/prf.js +7 -32
- 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/cipher/suites/aead.js.map +1 -1
- package/lib/dtls/src/client.js.map +1 -1
- package/lib/dtls/src/context/cipher.js +2 -2
- package/lib/dtls/src/context/cipher.js.map +1 -1
- package/lib/dtls/src/context/dtls.js.map +1 -1
- package/lib/dtls/src/context/srtp.js.map +1 -1
- package/lib/dtls/src/flight/client/flight5.js +8 -6
- package/lib/dtls/src/flight/client/flight5.js.map +1 -1
- package/lib/dtls/src/flight/flight.js +1 -1
- package/lib/dtls/src/flight/flight.js.map +1 -1
- package/lib/dtls/src/flight/server/flight2.js +1 -1
- package/lib/dtls/src/flight/server/flight2.js.map +1 -1
- package/lib/dtls/src/flight/server/flight4.js +1 -7
- package/lib/dtls/src/flight/server/flight4.js.map +1 -1
- package/lib/dtls/src/flight/server/flight6.js.map +1 -1
- package/lib/dtls/src/handshake/const.js +1 -1
- package/lib/dtls/src/handshake/const.js.map +1 -1
- package/lib/dtls/src/handshake/extensions/ellipticCurves.js +1 -1
- package/lib/dtls/src/handshake/extensions/ellipticCurves.js.map +1 -1
- package/lib/dtls/src/handshake/extensions/extendedMasterSecret.js +1 -1
- package/lib/dtls/src/handshake/extensions/extendedMasterSecret.js.map +1 -1
- package/lib/dtls/src/handshake/extensions/renegotiationIndication.js +1 -1
- package/lib/dtls/src/handshake/extensions/renegotiationIndication.js.map +1 -1
- package/lib/dtls/src/handshake/extensions/signature.js +1 -1
- package/lib/dtls/src/handshake/extensions/signature.js.map +1 -1
- package/lib/dtls/src/handshake/extensions/useSrtp.js +1 -1
- package/lib/dtls/src/handshake/extensions/useSrtp.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 +1 -1
- package/lib/dtls/src/handshake/message/changeCipherSpec.js.map +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.js +1 -1
- package/lib/dtls/src/handshake/message/server/certificateRequest.js.map +1 -1
- package/lib/dtls/src/handshake/message/server/hello.js +1 -1
- 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.js +1 -1
- package/lib/dtls/src/handshake/message/server/keyExchange.js.map +1 -1
- package/lib/dtls/src/handshake/random.js +2 -2
- package/lib/dtls/src/handshake/random.js.map +1 -1
- package/lib/dtls/src/helper.d.ts +1 -1
- package/lib/dtls/src/helper.js.map +1 -1
- package/lib/dtls/src/record/const.js +2 -2
- package/lib/dtls/src/record/const.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/record/message/plaintext.js +1 -1
- package/lib/dtls/src/record/message/plaintext.js.map +1 -1
- package/lib/dtls/src/record/receive.js.map +1 -1
- package/lib/dtls/src/server.js.map +1 -1
- package/lib/dtls/src/socket.js +1 -4
- package/lib/dtls/src/socket.js.map +1 -1
- package/lib/dtls/src/transport.js.map +1 -1
- package/lib/ice/src/candidate.js +1 -1
- package/lib/ice/src/candidate.js.map +1 -1
- package/lib/ice/src/dns/lookup.js.map +1 -1
- package/lib/ice/src/exceptions.js.map +1 -1
- package/lib/ice/src/helper.js.map +1 -1
- package/lib/ice/src/ice.d.ts +5 -13
- package/lib/ice/src/ice.js +57 -154
- package/lib/ice/src/ice.js.map +1 -1
- package/lib/ice/src/stun/attributes.js.map +1 -1
- package/lib/ice/src/stun/const.d.ts +1 -1
- package/lib/ice/src/stun/const.js +2 -2
- package/lib/ice/src/stun/const.js.map +1 -1
- package/lib/ice/src/stun/message.js +1 -1
- package/lib/ice/src/stun/message.js.map +1 -1
- package/lib/ice/src/stun/protocol.js.map +1 -1
- package/lib/ice/src/stun/transaction.js.map +1 -1
- package/lib/ice/src/transport.js +1 -1
- package/lib/ice/src/transport.js.map +1 -1
- package/lib/ice/src/turn/protocol.js.map +1 -1
- package/lib/ice/src/utils.d.ts +1 -0
- package/lib/ice/src/utils.js +72 -1
- package/lib/ice/src/utils.js.map +1 -1
- package/lib/rtp/src/codec/av1.js +1 -1
- package/lib/rtp/src/codec/av1.js.map +1 -1
- package/lib/rtp/src/codec/h264.js.map +1 -1
- package/lib/rtp/src/codec/index.js.map +1 -1
- package/lib/rtp/src/codec/opus.js.map +1 -1
- package/lib/rtp/src/codec/vp8.js.map +1 -1
- package/lib/rtp/src/codec/vp9.js.map +1 -1
- package/lib/rtp/src/extra/container/index.js.map +1 -0
- package/lib/rtp/src/extra/container/mp4/container.js.map +1 -0
- package/lib/rtp/src/extra/container/mp4/exp-golomb.js.map +1 -0
- package/lib/rtp/src/{container → extra/container}/mp4/h264.js +1 -1
- package/lib/rtp/src/extra/container/mp4/h264.js.map +1 -0
- package/lib/rtp/src/extra/container/mp4/index.js.map +1 -0
- package/lib/rtp/src/extra/container/mp4/mp4box.js.map +1 -0
- package/lib/rtp/src/{container → extra/container}/mp4/sps-parser.js +4 -4
- package/lib/rtp/src/extra/container/mp4/sps-parser.js.map +1 -0
- package/lib/rtp/src/extra/container/ogg/index.js.map +1 -0
- package/lib/rtp/src/extra/container/ogg/parser.js.map +1 -0
- package/lib/rtp/src/{container → extra/container}/webm/container.js +3 -3
- package/lib/rtp/src/extra/container/webm/container.js.map +1 -0
- package/lib/rtp/src/{container → extra/container}/webm/ebml/ebml.js +1 -1
- package/lib/rtp/src/extra/container/webm/ebml/ebml.js.map +1 -0
- package/lib/rtp/src/extra/container/webm/ebml/id.js.map +1 -0
- package/lib/rtp/src/extra/container/webm/ebml/index.js.map +1 -0
- package/lib/rtp/src/extra/container/webm/ebml/typedArrayUtils.js.map +1 -0
- package/lib/rtp/src/extra/container/webm/index.js.map +1 -0
- package/lib/rtp/src/extra/index.d.ts +2 -0
- package/lib/rtp/src/extra/index.js +19 -0
- package/lib/rtp/src/extra/index.js.map +1 -0
- package/lib/rtp/src/{processor → extra/processor}/depacketizer.d.ts +1 -1
- package/lib/rtp/src/{processor → extra/processor}/depacketizer.js +1 -1
- package/lib/rtp/src/extra/processor/depacketizer.js.map +1 -0
- package/lib/rtp/src/extra/processor/depacketizerCallback.js.map +1 -0
- package/lib/rtp/src/{processor → extra/processor}/depacketizerTransformer.d.ts +1 -1
- package/lib/rtp/src/extra/processor/depacketizerTransformer.js.map +1 -0
- package/lib/rtp/src/extra/processor/dtx.js.map +1 -0
- package/lib/rtp/src/extra/processor/dtxCallback.js.map +1 -0
- package/lib/rtp/src/extra/processor/index.js.map +1 -0
- package/lib/rtp/src/extra/processor/interface.js.map +1 -0
- package/lib/rtp/src/{processor → extra/processor}/jitterBuffer.js +1 -1
- package/lib/rtp/src/extra/processor/jitterBuffer.js.map +1 -0
- package/lib/rtp/src/extra/processor/jitterBufferCallback.js.map +1 -0
- package/lib/rtp/src/extra/processor/jitterBufferTransformer.js.map +1 -0
- package/lib/rtp/src/{processor → extra/processor}/lipsync.js +1 -1
- package/lib/rtp/src/extra/processor/lipsync.js.map +1 -0
- package/lib/rtp/src/{processor → extra/processor}/lipsyncCallback.d.ts +1 -1
- package/lib/rtp/src/extra/processor/lipsyncCallback.js.map +1 -0
- package/lib/rtp/src/{processor → extra/processor}/mp4.d.ts +1 -1
- package/lib/rtp/src/{processor → extra/processor}/mp4.js +4 -3
- package/lib/rtp/src/extra/processor/mp4.js.map +1 -0
- package/lib/rtp/src/{processor → extra/processor}/mp4Callback.js +2 -2
- package/lib/rtp/src/extra/processor/mp4Callback.js.map +1 -0
- package/lib/rtp/src/{processor → extra/processor}/mute.js +1 -1
- package/lib/rtp/src/extra/processor/mute.js.map +1 -0
- package/lib/rtp/src/extra/processor/muteCallback.js.map +1 -0
- package/lib/rtp/src/{processor → extra/processor}/nack.d.ts +1 -1
- package/lib/rtp/src/{processor → extra/processor}/nack.js +1 -1
- package/lib/rtp/src/extra/processor/nack.js.map +1 -0
- package/lib/rtp/src/extra/processor/nackHandlerCallback.js.map +1 -0
- package/lib/rtp/src/{processor → extra/processor}/ntpTime.d.ts +2 -1
- package/lib/rtp/src/{processor → extra/processor}/ntpTime.js +4 -3
- package/lib/rtp/src/extra/processor/ntpTime.js.map +1 -0
- package/lib/rtp/src/extra/processor/ntpTimeCallback.js.map +1 -0
- package/lib/rtp/src/{processor → extra/processor}/rtcpCallback.d.ts +1 -1
- package/lib/rtp/src/extra/processor/rtcpCallback.js.map +1 -0
- package/lib/rtp/src/{processor → extra/processor}/rtpCallback.d.ts +1 -1
- package/lib/rtp/src/{processor → extra/processor}/rtpCallback.js +1 -1
- package/lib/rtp/src/extra/processor/rtpCallback.js.map +1 -0
- package/lib/rtp/src/{processor → extra/processor}/rtpStream.d.ts +1 -1
- package/lib/rtp/src/{processor → extra/processor}/rtpStream.js +1 -1
- package/lib/rtp/src/extra/processor/rtpStream.js.map +1 -0
- package/lib/rtp/src/{processor → extra/processor}/rtpTime.d.ts +1 -1
- package/lib/rtp/src/{processor → extra/processor}/rtpTime.js +4 -3
- package/lib/rtp/src/extra/processor/rtpTime.js.map +1 -0
- package/lib/rtp/src/extra/processor/rtpTimeCallback.js.map +1 -0
- package/lib/rtp/src/{processor → extra/processor}/webm.js +4 -4
- package/lib/rtp/src/extra/processor/webm.js.map +1 -0
- package/lib/rtp/src/{processor → extra/processor}/webmCallback.js +1 -1
- package/lib/rtp/src/extra/processor/webmCallback.js.map +1 -0
- package/lib/rtp/src/extra/processor/webmStream.js.map +1 -0
- package/lib/rtp/src/index.d.ts +1 -2
- package/lib/rtp/src/index.js +0 -2
- package/lib/rtp/src/index.js.map +1 -1
- package/lib/rtp/src/rtcp/header.js.map +1 -1
- package/lib/rtp/src/rtcp/psfb/fullIntraRequest.js +1 -1
- package/lib/rtp/src/rtcp/psfb/fullIntraRequest.js.map +1 -1
- package/lib/rtp/src/rtcp/psfb/index.js +1 -1
- package/lib/rtp/src/rtcp/psfb/index.js.map +1 -1
- package/lib/rtp/src/rtcp/psfb/pictureLossIndication.js +1 -1
- package/lib/rtp/src/rtcp/psfb/pictureLossIndication.js.map +1 -1
- package/lib/rtp/src/rtcp/psfb/remb.js +1 -1
- package/lib/rtp/src/rtcp/psfb/remb.js.map +1 -1
- package/lib/rtp/src/rtcp/rr.js +1 -1
- package/lib/rtp/src/rtcp/rr.js.map +1 -1
- package/lib/rtp/src/rtcp/rtcp.js.map +1 -1
- package/lib/rtp/src/rtcp/rtpfb/index.js +1 -1
- package/lib/rtp/src/rtcp/rtpfb/index.js.map +1 -1
- package/lib/rtp/src/rtcp/rtpfb/nack.js +2 -2
- package/lib/rtp/src/rtcp/rtpfb/nack.js.map +1 -1
- package/lib/rtp/src/rtcp/rtpfb/twcc.js +3 -3
- package/lib/rtp/src/rtcp/rtpfb/twcc.js.map +1 -1
- package/lib/rtp/src/rtcp/sdes.js +1 -1
- package/lib/rtp/src/rtcp/sdes.js.map +1 -1
- package/lib/rtp/src/rtcp/sr.js +1 -1
- package/lib/rtp/src/rtcp/sr.js.map +1 -1
- package/lib/rtp/src/rtp/headerExtension.js.map +1 -1
- package/lib/rtp/src/rtp/red/encoder.js.map +1 -1
- package/lib/rtp/src/rtp/red/handler.js.map +1 -1
- package/lib/rtp/src/rtp/red/packet.js +0 -1
- package/lib/rtp/src/rtp/red/packet.js.map +1 -1
- package/lib/rtp/src/rtp/rtp.js +3 -2
- package/lib/rtp/src/rtp/rtp.js.map +1 -1
- package/lib/rtp/src/srtp/cipher/ctr.d.ts +1 -1
- 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/const.js.map +1 -1
- package/lib/rtp/src/srtp/context/context.js +1 -1
- package/lib/rtp/src/srtp/context/context.js.map +1 -1
- package/lib/rtp/src/srtp/context/srtcp.js.map +1 -1
- package/lib/sctp/src/chunk.js +17 -17
- package/lib/sctp/src/chunk.js.map +1 -1
- package/lib/sctp/src/const.js +2 -2
- package/lib/sctp/src/const.js.map +1 -1
- package/lib/sctp/src/param.js +5 -5
- package/lib/sctp/src/param.js.map +1 -1
- package/lib/sctp/src/sctp.js +5 -1
- package/lib/sctp/src/sctp.js.map +1 -1
- package/lib/sctp/src/transport.js.map +1 -1
- 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/helper.js.map +1 -1
- package/lib/webrtc/src/index.d.ts +0 -2
- package/lib/webrtc/src/index.js +0 -2
- package/lib/webrtc/src/index.js.map +1 -1
- package/lib/webrtc/src/media/parameters.d.ts +1 -2
- package/lib/webrtc/src/media/parameters.js.map +1 -1
- 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/receiver/statistics.js.map +1 -1
- package/lib/webrtc/src/media/router.js +4 -2
- package/lib/webrtc/src/media/router.js.map +1 -1
- package/lib/webrtc/src/media/rtpReceiver.d.ts +1 -1
- package/lib/webrtc/src/media/rtpReceiver.js +1 -1
- package/lib/webrtc/src/media/rtpReceiver.js.map +1 -1
- package/lib/webrtc/src/media/rtpSender.js +1 -1
- package/lib/webrtc/src/media/rtpSender.js.map +1 -1
- package/lib/webrtc/src/media/rtpTransceiver.js.map +1 -1
- package/lib/webrtc/src/media/sender/cumulativeResult.js.map +1 -1
- package/lib/webrtc/src/media/sender/senderBWE.js.map +1 -1
- package/lib/webrtc/src/media/track.js.map +1 -1
- package/lib/webrtc/src/nonstandard/index.d.ts +2 -0
- package/lib/webrtc/src/nonstandard/index.js +19 -0
- package/lib/webrtc/src/nonstandard/index.js.map +1 -0
- package/lib/webrtc/src/nonstandard/recorder/index.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 -1
- package/lib/webrtc/src/nonstandard/recorder/writer/webm.js +11 -10
- package/lib/webrtc/src/nonstandard/recorder/writer/webm.js.map +1 -1
- package/lib/webrtc/src/nonstandard/userMedia.js.map +1 -1
- package/lib/webrtc/src/peerConnection.d.ts +2 -2
- package/lib/webrtc/src/peerConnection.js +11 -8
- package/lib/webrtc/src/peerConnection.js.map +1 -1
- package/lib/webrtc/src/sdp.js +47 -37
- package/lib/webrtc/src/sdp.js.map +1 -1
- package/lib/webrtc/src/transport/dtls.js.map +1 -1
- package/lib/webrtc/src/transport/ice.js.map +1 -1
- package/lib/webrtc/src/transport/sctp.js +9 -7
- package/lib/webrtc/src/transport/sctp.js.map +1 -1
- package/lib/webrtc/src/utils.js +1 -1
- package/lib/webrtc/src/utils.js.map +1 -1
- package/package.json +20 -19
- package/src/dataChannel.ts +1 -1
- package/src/index.ts +0 -2
- package/src/media/parameters.ts +2 -2
- package/src/media/receiver/nack.ts +4 -7
- package/src/media/router.ts +36 -40
- package/src/media/rtpReceiver.ts +12 -15
- package/src/media/rtpSender.ts +69 -82
- package/src/nonstandard/index.ts +2 -0
- package/src/nonstandard/recorder/writer/index.ts +1 -1
- package/src/nonstandard/recorder/writer/webm.ts +5 -6
- package/src/nonstandard/userMedia.ts +1 -3
- package/src/peerConnection.ts +28 -24
- package/src/sdp.ts +49 -55
- package/src/transport/dtls.ts +3 -6
- package/src/transport/ice.ts +1 -1
- package/src/transport/sctp.ts +60 -66
- package/src/utils.ts +1 -1
- package/lib/rtp/src/container/index.js.map +0 -1
- package/lib/rtp/src/container/mp4/container.js.map +0 -1
- package/lib/rtp/src/container/mp4/exp-golomb.js.map +0 -1
- package/lib/rtp/src/container/mp4/h264.js.map +0 -1
- package/lib/rtp/src/container/mp4/index.js.map +0 -1
- package/lib/rtp/src/container/mp4/mp4box.js.map +0 -1
- package/lib/rtp/src/container/mp4/sps-parser.js.map +0 -1
- package/lib/rtp/src/container/ogg/index.js.map +0 -1
- package/lib/rtp/src/container/ogg/parser.js.map +0 -1
- package/lib/rtp/src/container/webm/container.js.map +0 -1
- package/lib/rtp/src/container/webm/ebml/ebml.js.map +0 -1
- package/lib/rtp/src/container/webm/ebml/id.js.map +0 -1
- package/lib/rtp/src/container/webm/ebml/index.js.map +0 -1
- package/lib/rtp/src/container/webm/ebml/typedArrayUtils.js.map +0 -1
- package/lib/rtp/src/container/webm/index.js.map +0 -1
- package/lib/rtp/src/processor/depacketizer.js.map +0 -1
- package/lib/rtp/src/processor/depacketizerCallback.js.map +0 -1
- package/lib/rtp/src/processor/depacketizerTransformer.js.map +0 -1
- package/lib/rtp/src/processor/dtx.js.map +0 -1
- package/lib/rtp/src/processor/dtxCallback.js.map +0 -1
- package/lib/rtp/src/processor/index.js.map +0 -1
- package/lib/rtp/src/processor/interface.js.map +0 -1
- package/lib/rtp/src/processor/jitterBuffer.js.map +0 -1
- package/lib/rtp/src/processor/jitterBufferCallback.js.map +0 -1
- package/lib/rtp/src/processor/jitterBufferTransformer.js.map +0 -1
- package/lib/rtp/src/processor/lipsync.js.map +0 -1
- package/lib/rtp/src/processor/lipsyncCallback.js.map +0 -1
- package/lib/rtp/src/processor/mp4.js.map +0 -1
- package/lib/rtp/src/processor/mp4Callback.js.map +0 -1
- package/lib/rtp/src/processor/mute.js.map +0 -1
- package/lib/rtp/src/processor/muteCallback.js.map +0 -1
- package/lib/rtp/src/processor/nack.js.map +0 -1
- package/lib/rtp/src/processor/nackHandlerCallback.js.map +0 -1
- package/lib/rtp/src/processor/ntpTime.js.map +0 -1
- package/lib/rtp/src/processor/ntpTimeCallback.js.map +0 -1
- package/lib/rtp/src/processor/rtcpCallback.js.map +0 -1
- package/lib/rtp/src/processor/rtpCallback.js.map +0 -1
- package/lib/rtp/src/processor/rtpStream.js.map +0 -1
- package/lib/rtp/src/processor/rtpTime.js.map +0 -1
- package/lib/rtp/src/processor/rtpTimeCallback.js.map +0 -1
- package/lib/rtp/src/processor/webm.js.map +0 -1
- package/lib/rtp/src/processor/webmCallback.js.map +0 -1
- package/lib/rtp/src/processor/webmStream.js.map +0 -1
- /package/lib/rtp/src/{container → extra/container}/index.d.ts +0 -0
- /package/lib/rtp/src/{container → extra/container}/index.js +0 -0
- /package/lib/rtp/src/{container → extra/container}/mp4/container.d.ts +0 -0
- /package/lib/rtp/src/{container → extra/container}/mp4/container.js +0 -0
- /package/lib/rtp/src/{container → extra/container}/mp4/exp-golomb.d.ts +0 -0
- /package/lib/rtp/src/{container → extra/container}/mp4/exp-golomb.js +0 -0
- /package/lib/rtp/src/{container → extra/container}/mp4/h264.d.ts +0 -0
- /package/lib/rtp/src/{container → extra/container}/mp4/index.d.ts +0 -0
- /package/lib/rtp/src/{container → extra/container}/mp4/index.js +0 -0
- /package/lib/rtp/src/{container → extra/container}/mp4/mp4box.d.ts +0 -0
- /package/lib/rtp/src/{container → extra/container}/mp4/mp4box.js +0 -0
- /package/lib/rtp/src/{container → extra/container}/mp4/sps-parser.d.ts +0 -0
- /package/lib/rtp/src/{container → extra/container}/ogg/index.d.ts +0 -0
- /package/lib/rtp/src/{container → extra/container}/ogg/index.js +0 -0
- /package/lib/rtp/src/{container → extra/container}/ogg/parser.d.ts +0 -0
- /package/lib/rtp/src/{container → extra/container}/ogg/parser.js +0 -0
- /package/lib/rtp/src/{container → extra/container}/webm/container.d.ts +0 -0
- /package/lib/rtp/src/{container → extra/container}/webm/ebml/ebml.d.ts +0 -0
- /package/lib/rtp/src/{container → extra/container}/webm/ebml/id.d.ts +0 -0
- /package/lib/rtp/src/{container → extra/container}/webm/ebml/id.js +0 -0
- /package/lib/rtp/src/{container → extra/container}/webm/ebml/index.d.ts +0 -0
- /package/lib/rtp/src/{container → extra/container}/webm/ebml/index.js +0 -0
- /package/lib/rtp/src/{container → extra/container}/webm/ebml/typedArrayUtils.d.ts +0 -0
- /package/lib/rtp/src/{container → extra/container}/webm/ebml/typedArrayUtils.js +0 -0
- /package/lib/rtp/src/{container → extra/container}/webm/index.d.ts +0 -0
- /package/lib/rtp/src/{container → extra/container}/webm/index.js +0 -0
- /package/lib/rtp/src/{processor → extra/processor}/depacketizerCallback.d.ts +0 -0
- /package/lib/rtp/src/{processor → extra/processor}/depacketizerCallback.js +0 -0
- /package/lib/rtp/src/{processor → extra/processor}/depacketizerTransformer.js +0 -0
- /package/lib/rtp/src/{processor → extra/processor}/dtx.d.ts +0 -0
- /package/lib/rtp/src/{processor → extra/processor}/dtx.js +0 -0
- /package/lib/rtp/src/{processor → extra/processor}/dtxCallback.d.ts +0 -0
- /package/lib/rtp/src/{processor → extra/processor}/dtxCallback.js +0 -0
- /package/lib/rtp/src/{processor → extra/processor}/index.d.ts +0 -0
- /package/lib/rtp/src/{processor → extra/processor}/index.js +0 -0
- /package/lib/rtp/src/{processor → extra/processor}/interface.d.ts +0 -0
- /package/lib/rtp/src/{processor → extra/processor}/interface.js +0 -0
- /package/lib/rtp/src/{processor → extra/processor}/jitterBuffer.d.ts +0 -0
- /package/lib/rtp/src/{processor → extra/processor}/jitterBufferCallback.d.ts +0 -0
- /package/lib/rtp/src/{processor → extra/processor}/jitterBufferCallback.js +0 -0
- /package/lib/rtp/src/{processor → extra/processor}/jitterBufferTransformer.d.ts +0 -0
- /package/lib/rtp/src/{processor → extra/processor}/jitterBufferTransformer.js +0 -0
- /package/lib/rtp/src/{processor → extra/processor}/lipsync.d.ts +0 -0
- /package/lib/rtp/src/{processor → extra/processor}/lipsyncCallback.js +0 -0
- /package/lib/rtp/src/{processor → extra/processor}/mp4Callback.d.ts +0 -0
- /package/lib/rtp/src/{processor → extra/processor}/mute.d.ts +0 -0
- /package/lib/rtp/src/{processor → extra/processor}/muteCallback.d.ts +0 -0
- /package/lib/rtp/src/{processor → extra/processor}/muteCallback.js +0 -0
- /package/lib/rtp/src/{processor → extra/processor}/nackHandlerCallback.d.ts +0 -0
- /package/lib/rtp/src/{processor → extra/processor}/nackHandlerCallback.js +0 -0
- /package/lib/rtp/src/{processor → extra/processor}/ntpTimeCallback.d.ts +0 -0
- /package/lib/rtp/src/{processor → extra/processor}/ntpTimeCallback.js +0 -0
- /package/lib/rtp/src/{processor → extra/processor}/rtcpCallback.js +0 -0
- /package/lib/rtp/src/{processor → extra/processor}/rtpTimeCallback.d.ts +0 -0
- /package/lib/rtp/src/{processor → extra/processor}/rtpTimeCallback.js +0 -0
- /package/lib/rtp/src/{processor → extra/processor}/webm.d.ts +0 -0
- /package/lib/rtp/src/{processor → extra/processor}/webmCallback.d.ts +0 -0
- /package/lib/rtp/src/{processor → extra/processor}/webmStream.d.ts +0 -0
- /package/lib/rtp/src/{processor → extra/processor}/webmStream.js +0 -0
package/src/media/rtpSender.ts
CHANGED
|
@@ -27,11 +27,13 @@ import Event from "rx.mini";
|
|
|
27
27
|
import { setTimeout } from "timers/promises";
|
|
28
28
|
import * as uuid from "uuid";
|
|
29
29
|
|
|
30
|
+
import { codecParametersFromString } from "..";
|
|
30
31
|
import { random16, uint16Add, uint32Add } from "../../../common/src";
|
|
31
32
|
import {
|
|
32
33
|
Extension,
|
|
33
34
|
GenericNack,
|
|
34
35
|
PictureLossIndication,
|
|
36
|
+
RTP_EXTENSION_URI,
|
|
35
37
|
ReceiverEstimatedMaxBitrate,
|
|
36
38
|
RedEncoder,
|
|
37
39
|
RtcpPacket,
|
|
@@ -41,20 +43,18 @@ import {
|
|
|
41
43
|
RtcpSourceDescriptionPacket,
|
|
42
44
|
RtcpSrPacket,
|
|
43
45
|
RtcpTransportLayerFeedback,
|
|
44
|
-
RTP_EXTENSION_URI,
|
|
45
46
|
RtpHeader,
|
|
46
47
|
RtpPacket,
|
|
48
|
+
SourceDescriptionChunk,
|
|
49
|
+
SourceDescriptionItem,
|
|
50
|
+
TransportWideCC,
|
|
47
51
|
serializeAbsSendTime,
|
|
48
52
|
serializeRepairedRtpStreamId,
|
|
49
53
|
serializeSdesMid,
|
|
50
54
|
serializeSdesRTPStreamID,
|
|
51
55
|
serializeTransportWideCC,
|
|
52
|
-
SourceDescriptionChunk,
|
|
53
|
-
SourceDescriptionItem,
|
|
54
|
-
TransportWideCC,
|
|
55
56
|
wrapRtx,
|
|
56
57
|
} from "../../../rtp/src";
|
|
57
|
-
import { codecParametersFromString } from "..";
|
|
58
58
|
import { RTCDtlsTransport } from "../transport/dtls";
|
|
59
59
|
import { Kind } from "../types/domain";
|
|
60
60
|
import { compactNtp, milliTime, ntpTime, timestampSeconds } from "../utils";
|
|
@@ -104,7 +104,7 @@ export class RTCRtpSender {
|
|
|
104
104
|
private octetCount = 0;
|
|
105
105
|
private packetCount = 0;
|
|
106
106
|
private rtt?: number;
|
|
107
|
-
receiverEstimatedMaxBitrate
|
|
107
|
+
receiverEstimatedMaxBitrate = 0n;
|
|
108
108
|
|
|
109
109
|
// rtp
|
|
110
110
|
private sequenceNumber?: number;
|
|
@@ -410,90 +410,77 @@ export class RTCRtpSender {
|
|
|
410
410
|
handleRtcpPacket(rtcpPacket: RtcpPacket) {
|
|
411
411
|
switch (rtcpPacket.type) {
|
|
412
412
|
case RtcpSrPacket.type:
|
|
413
|
-
case RtcpRrPacket.type:
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
.
|
|
419
|
-
if (this.
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
this.rtt = RTT_ALPHA * this.rtt + (1 - RTT_ALPHA) * rtt;
|
|
429
|
-
}
|
|
413
|
+
case RtcpRrPacket.type: {
|
|
414
|
+
const packet = rtcpPacket as RtcpSrPacket | RtcpRrPacket;
|
|
415
|
+
packet.reports
|
|
416
|
+
.filter((report) => report.ssrc === this.ssrc)
|
|
417
|
+
.forEach((report) => {
|
|
418
|
+
if (this.lastSRtimestamp === report.lsr && report.dlsr) {
|
|
419
|
+
if (this.lastSentSRTimestamp) {
|
|
420
|
+
const rtt =
|
|
421
|
+
timestampSeconds() -
|
|
422
|
+
this.lastSentSRTimestamp -
|
|
423
|
+
report.dlsr / 65536;
|
|
424
|
+
if (this.rtt === undefined) {
|
|
425
|
+
this.rtt = rtt;
|
|
426
|
+
} else {
|
|
427
|
+
this.rtt = RTT_ALPHA * this.rtt + (1 - RTT_ALPHA) * rtt;
|
|
430
428
|
}
|
|
431
429
|
}
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
break;
|
|
434
|
+
case RtcpTransportLayerFeedback.type: {
|
|
435
|
+
const packet = rtcpPacket as RtcpTransportLayerFeedback;
|
|
436
|
+
switch (packet.feedback.count) {
|
|
437
|
+
case TransportWideCC.count: {
|
|
438
|
+
const feedback = packet.feedback as TransportWideCC;
|
|
439
|
+
this.senderBWE.receiveTWCC(feedback);
|
|
440
|
+
}
|
|
441
|
+
break;
|
|
442
|
+
case GenericNack.count: {
|
|
443
|
+
const feedback = packet.feedback as GenericNack;
|
|
444
|
+
feedback.lost.forEach(async (seqNum) => {
|
|
445
|
+
let packet: RtpPacket | undefined =
|
|
446
|
+
this.rtpCache[seqNum % RTP_HISTORY_SIZE];
|
|
447
|
+
if (packet && packet.header.sequenceNumber !== seqNum) {
|
|
448
|
+
packet = undefined;
|
|
443
449
|
}
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
this.
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
if (this.rtxPayloadType != undefined) {
|
|
456
|
-
packet = wrapRtx(
|
|
457
|
-
packet,
|
|
458
|
-
this.rtxPayloadType,
|
|
459
|
-
this.rtxSequenceNumber,
|
|
460
|
-
this.rtxSsrc,
|
|
461
|
-
);
|
|
462
|
-
this.rtxSequenceNumber = uint16Add(
|
|
463
|
-
this.rtxSequenceNumber,
|
|
464
|
-
1,
|
|
465
|
-
);
|
|
466
|
-
}
|
|
467
|
-
await this.dtlsTransport.sendRtp(
|
|
468
|
-
packet.payload,
|
|
469
|
-
packet.header,
|
|
470
|
-
);
|
|
471
|
-
}
|
|
472
|
-
});
|
|
473
|
-
this.onGenericNack.execute(feedback);
|
|
450
|
+
if (packet) {
|
|
451
|
+
if (this.rtxPayloadType != undefined) {
|
|
452
|
+
packet = wrapRtx(
|
|
453
|
+
packet,
|
|
454
|
+
this.rtxPayloadType,
|
|
455
|
+
this.rtxSequenceNumber,
|
|
456
|
+
this.rtxSsrc,
|
|
457
|
+
);
|
|
458
|
+
this.rtxSequenceNumber = uint16Add(this.rtxSequenceNumber, 1);
|
|
459
|
+
}
|
|
460
|
+
await this.dtlsTransport.sendRtp(packet.payload, packet.header);
|
|
474
461
|
}
|
|
475
|
-
|
|
462
|
+
});
|
|
463
|
+
this.onGenericNack.execute(feedback);
|
|
476
464
|
}
|
|
465
|
+
break;
|
|
477
466
|
}
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
this.receiverEstimatedMaxBitrate = feedback.bitrate;
|
|
487
|
-
}
|
|
488
|
-
break;
|
|
489
|
-
case PictureLossIndication.count:
|
|
490
|
-
{
|
|
491
|
-
this.onPictureLossIndication.execute();
|
|
492
|
-
}
|
|
493
|
-
break;
|
|
467
|
+
}
|
|
468
|
+
break;
|
|
469
|
+
case RtcpPayloadSpecificFeedback.type: {
|
|
470
|
+
const packet = rtcpPacket as RtcpPayloadSpecificFeedback;
|
|
471
|
+
switch (packet.feedback.count) {
|
|
472
|
+
case ReceiverEstimatedMaxBitrate.count: {
|
|
473
|
+
const feedback = packet.feedback as ReceiverEstimatedMaxBitrate;
|
|
474
|
+
this.receiverEstimatedMaxBitrate = feedback.bitrate;
|
|
494
475
|
}
|
|
476
|
+
break;
|
|
477
|
+
case PictureLossIndication.count: {
|
|
478
|
+
this.onPictureLossIndication.execute();
|
|
479
|
+
}
|
|
480
|
+
break;
|
|
495
481
|
}
|
|
496
|
-
|
|
482
|
+
}
|
|
483
|
+
break;
|
|
497
484
|
}
|
|
498
485
|
this.onRtcp.execute(rtcpPacket);
|
|
499
486
|
}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import { unlink } from "fs/promises";
|
|
2
2
|
import { EventDisposer } from "rx.mini";
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { MediaWriter } from ".";
|
|
5
|
+
import { MediaStreamTrack, WeriftError } from "../../..";
|
|
5
6
|
import {
|
|
6
7
|
DepacketizeCallback,
|
|
7
8
|
JitterBufferCallback,
|
|
8
9
|
LipsyncCallback,
|
|
9
|
-
MediaStreamTrack,
|
|
10
10
|
NtpTimeCallback,
|
|
11
11
|
RtcpSourceCallback,
|
|
12
12
|
RtpSourceCallback,
|
|
13
|
-
|
|
13
|
+
SupportedCodec,
|
|
14
14
|
WebmCallback,
|
|
15
|
-
|
|
16
|
-
} from "
|
|
17
|
-
import { MediaWriter } from ".";
|
|
15
|
+
saveToFileSystem,
|
|
16
|
+
} from "../../../../../rtp/src/extra";
|
|
18
17
|
|
|
19
18
|
const sourcePath = "packages/webrtc/src/nonstandard/recorder/writer/webm.ts";
|
|
20
19
|
|
|
@@ -134,9 +134,7 @@ export class MediaPlayerWebm extends MediaPlayer {
|
|
|
134
134
|
const run = async () => {
|
|
135
135
|
if (payloadType > 100) payloadType = 96;
|
|
136
136
|
|
|
137
|
-
const cmd = `gst-launch-1.0 filesrc location=${
|
|
138
|
-
this.props.path
|
|
139
|
-
} ! matroskademux name=d \
|
|
137
|
+
const cmd = `gst-launch-1.0 filesrc location=${this.props.path} ! matroskademux name=d \
|
|
140
138
|
d.video_0 ! queue ! rtpvp8pay pt=${payloadType++} ! \
|
|
141
139
|
udpsink host=127.0.0.1 port=${this.props.videoPort} \
|
|
142
140
|
d.audio_0 ! queue ! rtpopuspay pt=${payloadType++} ! \
|
package/src/peerConnection.ts
CHANGED
|
@@ -4,34 +4,34 @@ import isEqual from "lodash/isEqual";
|
|
|
4
4
|
import Event from "rx.mini";
|
|
5
5
|
import * as uuid from "uuid";
|
|
6
6
|
|
|
7
|
-
import { Profile } from "../../dtls/src/context/srtp";
|
|
8
|
-
import { Message } from "../../ice/src/stun/message";
|
|
9
|
-
import { Protocol } from "../../ice/src/types/model";
|
|
10
7
|
import {
|
|
11
8
|
Address,
|
|
12
9
|
CandidatePair,
|
|
13
|
-
deepMerge,
|
|
14
10
|
InterfaceAddresses,
|
|
15
11
|
Recvonly,
|
|
16
12
|
Sendonly,
|
|
17
13
|
Sendrecv,
|
|
14
|
+
deepMerge,
|
|
18
15
|
} from ".";
|
|
19
16
|
import {
|
|
20
|
-
codecParametersFromString,
|
|
21
17
|
DtlsKeys,
|
|
18
|
+
codecParametersFromString,
|
|
22
19
|
useNACK,
|
|
23
20
|
usePLI,
|
|
24
21
|
useREMB,
|
|
25
22
|
} from ".";
|
|
23
|
+
import { Profile } from "../../dtls/src/context/srtp";
|
|
24
|
+
import { Message } from "../../ice/src/stun/message";
|
|
25
|
+
import { Protocol } from "../../ice/src/types/model";
|
|
26
26
|
import {
|
|
27
27
|
DISCARD_HOST,
|
|
28
28
|
DISCARD_PORT,
|
|
29
29
|
ReceiverDirection,
|
|
30
|
-
SenderDirections,
|
|
31
30
|
SRTP_PROFILE,
|
|
31
|
+
SenderDirections,
|
|
32
32
|
} from "./const";
|
|
33
33
|
import { RTCDataChannel, RTCDataChannelParameters } from "./dataChannel";
|
|
34
|
-
import {
|
|
34
|
+
import { EventTarget, enumerate } from "./helper";
|
|
35
35
|
import {
|
|
36
36
|
RTCRtpCodecParameters,
|
|
37
37
|
RTCRtpCodingParameters,
|
|
@@ -51,11 +51,11 @@ import {
|
|
|
51
51
|
} from "./media/rtpTransceiver";
|
|
52
52
|
import { MediaStream, MediaStreamTrack } from "./media/track";
|
|
53
53
|
import {
|
|
54
|
-
addSDPHeader,
|
|
55
54
|
GroupDescription,
|
|
56
55
|
MediaDescription,
|
|
57
56
|
SessionDescription,
|
|
58
57
|
SsrcDescription,
|
|
58
|
+
addSDPHeader,
|
|
59
59
|
} from "./sdp";
|
|
60
60
|
import { RTCCertificate, RTCDtlsTransport } from "./transport/dtls";
|
|
61
61
|
import {
|
|
@@ -168,20 +168,18 @@ export class RTCPeerConnection extends EventTarget {
|
|
|
168
168
|
|
|
169
169
|
codecParams.payloadType = 96 + i;
|
|
170
170
|
switch (codecParams.name.toLowerCase()) {
|
|
171
|
-
case "rtx":
|
|
172
|
-
{
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
codecParams.parameters = `${redundant}/${redundant}`;
|
|
181
|
-
codecParams.payloadType = 63;
|
|
182
|
-
}
|
|
171
|
+
case "rtx": {
|
|
172
|
+
codecParams.parameters = `apt=${codecParams.payloadType - 1}`;
|
|
173
|
+
}
|
|
174
|
+
break;
|
|
175
|
+
case "red": {
|
|
176
|
+
if (codecParams.contentType === "audio") {
|
|
177
|
+
const redundant = codecParams.payloadType + 1;
|
|
178
|
+
codecParams.parameters = `${redundant}/${redundant}`;
|
|
179
|
+
codecParams.payloadType = 63;
|
|
183
180
|
}
|
|
184
|
-
|
|
181
|
+
}
|
|
182
|
+
break;
|
|
185
183
|
}
|
|
186
184
|
}
|
|
187
185
|
|
|
@@ -214,12 +212,16 @@ export class RTCPeerConnection extends EventTarget {
|
|
|
214
212
|
}
|
|
215
213
|
|
|
216
214
|
get localDescription() {
|
|
217
|
-
if (!this._localDescription)
|
|
215
|
+
if (!this._localDescription) {
|
|
216
|
+
return undefined;
|
|
217
|
+
}
|
|
218
218
|
return this._localDescription.toJSON();
|
|
219
219
|
}
|
|
220
220
|
|
|
221
221
|
get remoteDescription() {
|
|
222
|
-
if (!this._remoteDescription)
|
|
222
|
+
if (!this._remoteDescription) {
|
|
223
|
+
return undefined;
|
|
224
|
+
}
|
|
223
225
|
return this._remoteDescription.toJSON();
|
|
224
226
|
}
|
|
225
227
|
|
|
@@ -830,7 +832,9 @@ export class RTCPeerConnection extends EventTarget {
|
|
|
830
832
|
|
|
831
833
|
get remoteIsBundled() {
|
|
832
834
|
const remoteSdp = this._remoteDescription;
|
|
833
|
-
if (!remoteSdp)
|
|
835
|
+
if (!remoteSdp) {
|
|
836
|
+
return undefined;
|
|
837
|
+
}
|
|
834
838
|
const bundle = remoteSdp.group.find(
|
|
835
839
|
(g) => g.semantic === "BUNDLE" && this.config.bundlePolicy !== "disable",
|
|
836
840
|
);
|
package/src/sdp.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { randomBytes } from "crypto";
|
|
2
|
+
import { isIPv4 } from "net";
|
|
2
3
|
import { Uint64BE } from "int64-buffer";
|
|
3
4
|
import range from "lodash/range";
|
|
4
|
-
import { isIPv4 } from "net";
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
7
|
DTLS_ROLE_SETUP,
|
|
@@ -63,12 +63,13 @@ export class SessionDescription {
|
|
|
63
63
|
} else if (line.startsWith("a=")) {
|
|
64
64
|
const [attr, value] = parseAttr(line);
|
|
65
65
|
switch (attr) {
|
|
66
|
-
case "fingerprint":
|
|
66
|
+
case "fingerprint": {
|
|
67
67
|
const [algorithm, fingerprint] = value?.split(" ") || [];
|
|
68
68
|
session.dtlsFingerprints.push(
|
|
69
69
|
new RTCDtlsFingerprint(algorithm, fingerprint),
|
|
70
70
|
);
|
|
71
|
-
|
|
71
|
+
}
|
|
72
|
+
break;
|
|
72
73
|
case "ice-lite":
|
|
73
74
|
session.iceLite = true;
|
|
74
75
|
break;
|
|
@@ -147,7 +148,7 @@ export class SessionDescription {
|
|
|
147
148
|
case "end-of-candidates":
|
|
148
149
|
currentMedia.iceCandidatesComplete = true;
|
|
149
150
|
break;
|
|
150
|
-
case "extmap":
|
|
151
|
+
case "extmap": {
|
|
151
152
|
// eslint-disable-next-line prefer-const
|
|
152
153
|
let [extId, extUri] = value.split(" ");
|
|
153
154
|
if (extId.includes("/")) {
|
|
@@ -159,14 +160,16 @@ export class SessionDescription {
|
|
|
159
160
|
uri: extUri,
|
|
160
161
|
}),
|
|
161
162
|
);
|
|
162
|
-
|
|
163
|
-
|
|
163
|
+
}
|
|
164
|
+
break;
|
|
165
|
+
case "fingerprint": {
|
|
164
166
|
if (!value) throw new Error();
|
|
165
167
|
const [algorithm, fingerprint] = value.split(" ");
|
|
166
168
|
currentMedia.dtlsParams?.fingerprints.push(
|
|
167
169
|
new RTCDtlsFingerprint(algorithm, fingerprint),
|
|
168
170
|
);
|
|
169
|
-
|
|
171
|
+
}
|
|
172
|
+
break;
|
|
170
173
|
case "ice-options":
|
|
171
174
|
currentMedia.iceOptions = value;
|
|
172
175
|
break;
|
|
@@ -190,11 +193,12 @@ export class SessionDescription {
|
|
|
190
193
|
case "msid":
|
|
191
194
|
currentMedia.msid = value;
|
|
192
195
|
break;
|
|
193
|
-
case "rtcp":
|
|
196
|
+
case "rtcp": {
|
|
194
197
|
const [port, rest] = divide(value, " ");
|
|
195
198
|
currentMedia.rtcpPort = parseInt(port);
|
|
196
199
|
currentMedia.rtcpHost = ipAddressFromSdp(rest);
|
|
197
|
-
|
|
200
|
+
}
|
|
201
|
+
break;
|
|
198
202
|
case "rtcp-mux":
|
|
199
203
|
currentMedia.rtcpMux = true;
|
|
200
204
|
break;
|
|
@@ -207,34 +211,34 @@ export class SessionDescription {
|
|
|
207
211
|
case "inactive":
|
|
208
212
|
currentMedia.direction = attr;
|
|
209
213
|
break;
|
|
210
|
-
case "rtpmap":
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
channels = channel ? parseInt(channel) : 1;
|
|
217
|
-
}
|
|
218
|
-
const codec = new RTCRtpCodecParameters({
|
|
219
|
-
mimeType: currentMedia.kind + "/" + type,
|
|
220
|
-
channels,
|
|
221
|
-
clockRate: parseInt(clock),
|
|
222
|
-
payloadType: parseInt(formatId),
|
|
223
|
-
});
|
|
224
|
-
currentMedia.rtp.codecs.push(codec);
|
|
214
|
+
case "rtpmap": {
|
|
215
|
+
const [formatId, formatDesc] = divide(value, " ");
|
|
216
|
+
const [type, clock, channel] = formatDesc.split("/");
|
|
217
|
+
let channels: number | undefined;
|
|
218
|
+
if (currentMedia.kind === "audio") {
|
|
219
|
+
channels = channel ? parseInt(channel) : 1;
|
|
225
220
|
}
|
|
226
|
-
|
|
227
|
-
|
|
221
|
+
const codec = new RTCRtpCodecParameters({
|
|
222
|
+
mimeType: currentMedia.kind + "/" + type,
|
|
223
|
+
channels,
|
|
224
|
+
clockRate: parseInt(clock),
|
|
225
|
+
payloadType: parseInt(formatId),
|
|
226
|
+
});
|
|
227
|
+
currentMedia.rtp.codecs.push(codec);
|
|
228
|
+
}
|
|
229
|
+
break;
|
|
230
|
+
case "sctpmap": {
|
|
228
231
|
if (!value) throw new Error();
|
|
229
232
|
const [formatId, formatDesc] = divide(value, " ");
|
|
230
233
|
currentMedia.sctpMap[parseInt(formatId)] = formatDesc;
|
|
231
234
|
currentMedia.sctpPort = parseInt(formatId);
|
|
232
|
-
|
|
235
|
+
}
|
|
236
|
+
break;
|
|
233
237
|
case "sctp-port":
|
|
234
238
|
if (!value) throw new Error();
|
|
235
239
|
currentMedia.sctpPort = parseInt(value);
|
|
236
240
|
break;
|
|
237
|
-
case "ssrc":
|
|
241
|
+
case "ssrc": {
|
|
238
242
|
const [ssrcStr, ssrcDesc] = divide(value, " ");
|
|
239
243
|
const ssrc = parseInt(ssrcStr);
|
|
240
244
|
const [ssrcAttr, ssrcValue] = divide(ssrcDesc, ":");
|
|
@@ -246,22 +250,22 @@ export class SessionDescription {
|
|
|
246
250
|
if (SSRC_INFO_ATTRS.includes(ssrcAttr)) {
|
|
247
251
|
ssrcInfo[ssrcAttr] = ssrcValue;
|
|
248
252
|
}
|
|
249
|
-
|
|
253
|
+
}
|
|
254
|
+
break;
|
|
250
255
|
case "ssrc-group":
|
|
251
256
|
parseGroup(currentMedia.ssrcGroup, value);
|
|
252
257
|
break;
|
|
253
|
-
case "rid":
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
break;
|
|
258
|
+
case "rid": {
|
|
259
|
+
const [rid, direction] = divide(value, " ");
|
|
260
|
+
|
|
261
|
+
currentMedia.simulcastParameters.push(
|
|
262
|
+
new RTCRtpSimulcastParameters({
|
|
263
|
+
rid,
|
|
264
|
+
direction: direction as any,
|
|
265
|
+
}),
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
break;
|
|
265
269
|
}
|
|
266
270
|
}
|
|
267
271
|
});
|
|
@@ -278,11 +282,7 @@ export class SessionDescription {
|
|
|
278
282
|
for (let i = 0; i < bundle.items.length; i++) {
|
|
279
283
|
if (!bundle.items.includes(i.toString())) continue;
|
|
280
284
|
const check = session.media[i];
|
|
281
|
-
if (
|
|
282
|
-
check?.iceParams &&
|
|
283
|
-
check.iceParams.usernameFragment &&
|
|
284
|
-
check.iceParams.password
|
|
285
|
-
) {
|
|
285
|
+
if (check.iceParams?.usernameFragment && check.iceParams.password) {
|
|
286
286
|
currentMedia.iceParams = {
|
|
287
287
|
...check.iceParams,
|
|
288
288
|
};
|
|
@@ -327,7 +327,7 @@ export class SessionDescription {
|
|
|
327
327
|
}
|
|
328
328
|
|
|
329
329
|
webrtcTrackId(media: MediaDescription) {
|
|
330
|
-
if (media.msid
|
|
330
|
+
if (media.msid?.includes(" ")) {
|
|
331
331
|
const bits = media.msid.split(" ");
|
|
332
332
|
for (const group of this.msidSemantic) {
|
|
333
333
|
if (
|
|
@@ -532,10 +532,7 @@ export class MediaDescription {
|
|
|
532
532
|
}
|
|
533
533
|
|
|
534
534
|
export class GroupDescription {
|
|
535
|
-
constructor(
|
|
536
|
-
public semantic: string,
|
|
537
|
-
public items: string[],
|
|
538
|
-
) {}
|
|
535
|
+
constructor(public semantic: string, public items: string[]) {}
|
|
539
536
|
|
|
540
537
|
get str() {
|
|
541
538
|
return `${this.semantic} ${this.items.join(" ")}`;
|
|
@@ -643,10 +640,7 @@ export function candidateFromSdp(sdp: string) {
|
|
|
643
640
|
}
|
|
644
641
|
|
|
645
642
|
export class RTCSessionDescription {
|
|
646
|
-
constructor(
|
|
647
|
-
public sdp: string,
|
|
648
|
-
public type: "offer" | "answer",
|
|
649
|
-
) {}
|
|
643
|
+
constructor(public sdp: string, public type: "offer" | "answer") {}
|
|
650
644
|
static isThis(o: any) {
|
|
651
645
|
if (typeof o?.sdp === "string") return true;
|
|
652
646
|
}
|
package/src/transport/dtls.ts
CHANGED
|
@@ -20,14 +20,14 @@ import { CipherContext } from "../../../dtls/src/context/cipher";
|
|
|
20
20
|
import { Profile } from "../../../dtls/src/context/srtp";
|
|
21
21
|
import { Connection } from "../../../ice/src";
|
|
22
22
|
import {
|
|
23
|
-
isMedia,
|
|
24
|
-
isRtcp,
|
|
25
23
|
RtcpPacket,
|
|
26
24
|
RtcpPacketConverter,
|
|
27
25
|
RtpHeader,
|
|
28
26
|
RtpPacket,
|
|
29
27
|
SrtcpSession,
|
|
30
28
|
SrtpSession,
|
|
29
|
+
isMedia,
|
|
30
|
+
isRtcp,
|
|
31
31
|
} from "../../../rtp/src";
|
|
32
32
|
import { keyLength, saltLength } from "../../../rtp/src/srtp/const";
|
|
33
33
|
import { RtpRouter } from "../media/router";
|
|
@@ -329,10 +329,7 @@ export type DtlsKeys = {
|
|
|
329
329
|
};
|
|
330
330
|
|
|
331
331
|
export class RTCDtlsFingerprint {
|
|
332
|
-
constructor(
|
|
333
|
-
public algorithm: string,
|
|
334
|
-
public value: string,
|
|
335
|
-
) {}
|
|
332
|
+
constructor(public algorithm: string, public value: string) {}
|
|
336
333
|
}
|
|
337
334
|
|
|
338
335
|
export class RTCDtlsParameters {
|