werift 0.18.13 → 0.18.15
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/index.d.ts +0 -1
- package/lib/common/src/index.js +0 -1
- package/lib/common/src/index.js.map +1 -1
- package/lib/dtls/src/client.js.map +1 -1
- package/lib/dtls/src/context/cipher.js +1 -1
- 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/transport.js.map +1 -1
- package/lib/dtls/src/flight/client/flight1.js.map +1 -1
- 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/flight4.js.map +1 -1
- package/lib/dtls/src/flight/server/flight6.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/finished.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 +1 -1
- package/lib/dtls/src/handshake/random.js.map +1 -1
- package/lib/dtls/src/record/message/fragment.js +1 -1
- 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/server.js.map +1 -1
- package/lib/dtls/src/socket.js.map +1 -1
- package/lib/dtls/src/transport.js.map +1 -1
- package/lib/ice/src/candidate.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.js.map +1 -1
- package/lib/ice/src/stun/attributes.js.map +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.map +1 -1
- package/lib/ice/src/turn/protocol.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/container/index.d.ts +2 -1
- package/lib/rtp/src/container/index.js +2 -1
- package/lib/rtp/src/container/index.js.map +1 -1
- package/lib/rtp/src/container/mp4/container.d.ts +66 -0
- package/lib/rtp/src/container/mp4/container.js +262 -0
- package/lib/rtp/src/container/mp4/container.js.map +1 -0
- package/lib/rtp/src/container/mp4/exp-golomb.d.ts +20 -0
- package/lib/rtp/src/container/mp4/exp-golomb.js +144 -0
- package/lib/rtp/src/container/mp4/exp-golomb.js.map +1 -0
- package/lib/rtp/src/container/mp4/h264.d.ts +42 -0
- package/lib/rtp/src/container/mp4/h264.js +240 -0
- package/lib/rtp/src/container/mp4/h264.js.map +1 -0
- package/lib/rtp/src/container/mp4/index.d.ts +2 -0
- package/lib/rtp/src/container/mp4/index.js +19 -0
- package/lib/rtp/src/container/mp4/index.js.map +1 -0
- package/lib/rtp/src/container/mp4/mp4box.d.ts +5 -0
- package/lib/rtp/src/container/mp4/mp4box.js +32 -0
- package/lib/rtp/src/container/mp4/mp4box.js.map +1 -0
- package/lib/rtp/src/container/mp4/sps-parser.d.ts +40 -0
- package/lib/rtp/src/container/mp4/sps-parser.js +291 -0
- package/lib/rtp/src/container/mp4/sps-parser.js.map +1 -0
- package/lib/rtp/src/container/ogg/index.d.ts +1 -0
- package/lib/rtp/src/container/ogg/index.js +18 -0
- package/lib/rtp/src/container/ogg/index.js.map +1 -0
- package/lib/rtp/src/container/ogg/parser.d.ts +12 -0
- package/lib/rtp/src/container/ogg/parser.js +100 -0
- package/lib/rtp/src/container/ogg/parser.js.map +1 -0
- package/lib/rtp/src/container/{webm.d.ts → webm/container.d.ts} +1 -1
- package/lib/rtp/src/container/{webm.js → webm/container.js} +6 -6
- package/lib/rtp/src/container/webm/container.js.map +1 -0
- package/lib/rtp/src/container/webm/ebml/ebml.js.map +1 -0
- package/lib/rtp/src/container/webm/ebml/id.js.map +1 -0
- package/lib/rtp/src/container/webm/ebml/index.js.map +1 -0
- package/lib/rtp/src/container/webm/ebml/typedArrayUtils.js.map +1 -0
- package/lib/rtp/src/container/webm/index.d.ts +2 -0
- package/lib/rtp/src/container/webm/index.js +19 -0
- package/lib/rtp/src/container/webm/index.js.map +1 -0
- package/lib/rtp/src/processor/depacketizer.js.map +1 -1
- package/lib/rtp/src/processor/dtx.d.ts +1 -1
- package/lib/rtp/src/processor/dtx.js.map +1 -1
- package/lib/rtp/src/processor/index.d.ts +2 -0
- package/lib/rtp/src/processor/index.js +2 -0
- package/lib/rtp/src/processor/index.js.map +1 -1
- package/lib/rtp/src/processor/jitterBuffer.js.map +1 -1
- package/lib/rtp/src/processor/jitterBufferTransformer.js.map +1 -1
- package/lib/rtp/src/processor/lipsync.js.map +1 -1
- package/lib/rtp/src/processor/lipsyncCallback.js.map +1 -1
- package/lib/rtp/src/processor/mp4.d.ts +50 -0
- package/lib/rtp/src/processor/mp4.js +162 -0
- package/lib/rtp/src/processor/mp4.js.map +1 -0
- package/lib/rtp/src/processor/mp4Callback.d.ts +12 -0
- package/lib/rtp/src/processor/mp4Callback.js +83 -0
- package/lib/rtp/src/processor/mp4Callback.js.map +1 -0
- package/lib/rtp/src/processor/mute.d.ts +1 -1
- package/lib/rtp/src/processor/mute.js +6 -3
- package/lib/rtp/src/processor/mute.js.map +1 -1
- package/lib/rtp/src/processor/muteCallback.js.map +1 -1
- package/lib/rtp/src/processor/nack.js +2 -3
- package/lib/rtp/src/processor/nack.js.map +1 -1
- package/lib/rtp/src/processor/ntpTime.d.ts +1 -1
- package/lib/rtp/src/processor/ntpTime.js.map +1 -1
- package/lib/rtp/src/processor/rtcpCallback.js.map +1 -1
- package/lib/rtp/src/processor/rtpCallback.js.map +1 -1
- package/lib/rtp/src/processor/rtpStream.js.map +1 -1
- package/lib/rtp/src/processor/rtpTime.js.map +1 -1
- package/lib/rtp/src/processor/webm.d.ts +1 -1
- package/lib/rtp/src/processor/webm.js +1 -1
- package/lib/rtp/src/processor/webm.js.map +1 -1
- package/lib/rtp/src/processor/webmCallback.d.ts +1 -1
- package/lib/rtp/src/processor/webmCallback.js.map +1 -1
- package/lib/rtp/src/processor/webmStream.d.ts +1 -1
- package/lib/rtp/src/processor/webmStream.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 +3 -7
- package/lib/rtp/src/rtcp/rr.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 +6 -13
- package/lib/rtp/src/rtcp/rtpfb/nack.js.map +1 -1
- package/lib/rtp/src/rtcp/rtpfb/twcc.js +12 -8
- 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 +2 -6
- package/lib/rtp/src/rtcp/sr.js.map +1 -1
- package/lib/rtp/src/rtp/headerExtension.d.ts +5 -0
- package/lib/rtp/src/rtp/headerExtension.js +35 -9
- 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/rtp.js.map +1 -1
- package/lib/rtp/src/srtp/cipher/ctr.js.map +1 -1
- package/lib/rtp/src/srtp/cipher/gcm.js.map +1 -1
- package/lib/rtp/src/srtp/cipher/index.js.map +1 -1
- package/lib/rtp/src/srtp/context/context.js.map +1 -1
- package/lib/rtp/src/srtp/session.js.map +1 -1
- package/lib/rtp/src/srtp/srtcp.js.map +1 -1
- package/lib/rtp/src/srtp/srtp.js.map +1 -1
- package/lib/rtp/src/util.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/param.js +3 -3
- package/lib/sctp/src/param.js.map +1 -1
- package/lib/sctp/src/sctp.js.map +1 -1
- package/lib/sctp/src/transport.js.map +1 -1
- package/lib/webrtc/src/const.js.map +1 -1
- package/lib/webrtc/src/dataChannel.js.map +1 -1
- 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.map +1 -1
- package/lib/webrtc/src/media/rtpReceiver.js.map +1 -1
- package/lib/webrtc/src/media/rtpSender.js.map +1 -1
- package/lib/webrtc/src/media/rtpTransceiver.d.ts +1 -1
- package/lib/webrtc/src/media/rtpTransceiver.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/recorder/index.js.map +1 -1
- package/lib/webrtc/src/nonstandard/recorder/writer/index.js.map +1 -1
- 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.js.map +1 -1
- package/lib/webrtc/src/sdp.js.map +1 -1
- package/lib/webrtc/src/transport/dtls.d.ts +1 -1
- package/lib/webrtc/src/transport/dtls.js.map +1 -1
- package/lib/webrtc/src/transport/ice.d.ts +2 -2
- package/lib/webrtc/src/transport/ice.js.map +1 -1
- package/lib/webrtc/src/transport/sctp.js.map +1 -1
- package/lib/webrtc/src/types/domain.d.ts +2 -2
- package/lib/webrtc/src/types/domain.js.map +1 -1
- package/lib/webrtc/src/utils.d.ts +1 -0
- package/lib/webrtc/src/utils.js +9 -1
- package/lib/webrtc/src/utils.js.map +1 -1
- package/package.json +5 -3
- package/src/const.ts +1 -1
- package/src/dataChannel.ts +3 -3
- package/src/media/parameters.ts +3 -3
- package/src/media/receiver/nack.ts +7 -4
- package/src/media/receiver/receiverTwcc.ts +5 -5
- package/src/media/receiver/statistics.ts +1 -1
- package/src/media/router.ts +5 -5
- package/src/media/rtpReceiver.ts +9 -9
- package/src/media/rtpSender.ts +8 -8
- package/src/media/rtpTransceiver.ts +3 -3
- package/src/media/sender/senderBWE.ts +2 -2
- package/src/media/track.ts +1 -1
- package/src/nonstandard/recorder/index.ts +1 -1
- package/src/nonstandard/recorder/writer/index.ts +1 -1
- package/src/nonstandard/recorder/writer/webm.ts +2 -2
- package/src/nonstandard/userMedia.ts +1 -1
- package/src/peerConnection.ts +52 -52
- package/src/sdp.ts +27 -21
- package/src/transport/dtls.ts +13 -10
- package/src/transport/ice.ts +6 -6
- package/src/transport/sctp.ts +4 -4
- package/src/types/domain.ts +2 -2
- package/src/utils.ts +11 -2
- package/lib/common/src/array.d.ts +0 -1
- package/lib/common/src/array.js +0 -15
- package/lib/common/src/array.js.map +0 -1
- package/lib/rtp/src/container/ebml/ebml.js.map +0 -1
- package/lib/rtp/src/container/ebml/id.js.map +0 -1
- package/lib/rtp/src/container/ebml/index.js.map +0 -1
- package/lib/rtp/src/container/ebml/typedArrayUtils.js.map +0 -1
- package/lib/rtp/src/container/webm.js.map +0 -1
- /package/lib/rtp/src/container/{ebml → webm/ebml}/ebml.d.ts +0 -0
- /package/lib/rtp/src/container/{ebml → webm/ebml}/ebml.js +0 -0
- /package/lib/rtp/src/container/{ebml → webm/ebml}/id.d.ts +0 -0
- /package/lib/rtp/src/container/{ebml → webm/ebml}/id.js +0 -0
- /package/lib/rtp/src/container/{ebml → webm/ebml}/index.d.ts +0 -0
- /package/lib/rtp/src/container/{ebml → webm/ebml}/index.js +0 -0
- /package/lib/rtp/src/container/{ebml → webm/ebml}/typedArrayUtils.d.ts +0 -0
- /package/lib/rtp/src/container/{ebml → webm/ebml}/typedArrayUtils.js +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "werift",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.15",
|
|
4
4
|
"description": "WebRTC Implementation for TypeScript (Node.js)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"WebRTC",
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
"test": "npm run type && jest --runInBand --forceExit --coverage",
|
|
33
33
|
"type": "tsc --noEmit --project ./tsconfig.json",
|
|
34
34
|
"unused": "organize-imports-cli src/**/*.ts",
|
|
35
|
-
"upgrade-interactive": "npx npm-check-updates -i"
|
|
35
|
+
"upgrade-interactive": "npx npm-check-updates -i",
|
|
36
|
+
"knip": "knip"
|
|
36
37
|
},
|
|
37
38
|
"dependencies": {
|
|
38
39
|
"@fidm/x509": "^1.2.1",
|
|
@@ -55,7 +56,8 @@
|
|
|
55
56
|
"rx.mini": "^1.2.2",
|
|
56
57
|
"turbo-crc32": "^1.0.1",
|
|
57
58
|
"tweetnacl": "^1.0.3",
|
|
58
|
-
"uuid": "^9.0.0"
|
|
59
|
+
"uuid": "^9.0.0",
|
|
60
|
+
"mp4box": "^0.5.2"
|
|
59
61
|
},
|
|
60
62
|
"devDependencies": {
|
|
61
63
|
"@types/aes-js": "^3.1.1",
|
package/src/const.ts
CHANGED
|
@@ -37,7 +37,7 @@ export const DTLS_ROLE_SETUP = {
|
|
|
37
37
|
server: "passive",
|
|
38
38
|
};
|
|
39
39
|
export const DTLS_SETUP_ROLE: { [key: string]: DtlsRole } = Object.keys(
|
|
40
|
-
DTLS_ROLE_SETUP
|
|
40
|
+
DTLS_ROLE_SETUP,
|
|
41
41
|
).reduce((acc, cur) => {
|
|
42
42
|
const key = (DTLS_ROLE_SETUP as any)[cur];
|
|
43
43
|
acc[key] = cur;
|
package/src/dataChannel.ts
CHANGED
|
@@ -29,7 +29,7 @@ export class RTCDataChannel extends EventTarget {
|
|
|
29
29
|
constructor(
|
|
30
30
|
private readonly transport: RTCSctpTransport,
|
|
31
31
|
private readonly parameters: RTCDataChannelParameters,
|
|
32
|
-
public readonly sendOpen = true
|
|
32
|
+
public readonly sendOpen = true,
|
|
33
33
|
) {
|
|
34
34
|
super();
|
|
35
35
|
|
|
@@ -38,7 +38,7 @@ export class RTCDataChannel extends EventTarget {
|
|
|
38
38
|
if (parameters.negotiated) {
|
|
39
39
|
if (this.id == undefined || this.id < 0 || this.id > 65534) {
|
|
40
40
|
throw new Error(
|
|
41
|
-
"ID must be in range 0-65534 if data channel is negotiated out-of-band"
|
|
41
|
+
"ID must be in range 0-65534 if data channel is negotiated out-of-band",
|
|
42
42
|
);
|
|
43
43
|
}
|
|
44
44
|
this.transport.dataChannelAddNegotiated(this);
|
|
@@ -81,7 +81,7 @@ export class RTCDataChannel extends EventTarget {
|
|
|
81
81
|
set bufferedAmountLowThreshold(value: number) {
|
|
82
82
|
if (value < 0 || value > 4294967295) {
|
|
83
83
|
throw new Error(
|
|
84
|
-
"bufferedAmountLowThreshold must be in range 0 - 4294967295"
|
|
84
|
+
"bufferedAmountLowThreshold must be in range 0 - 4294967295",
|
|
85
85
|
);
|
|
86
86
|
}
|
|
87
87
|
this._bufferedAmountLowThreshold = value;
|
package/src/media/parameters.ts
CHANGED
|
@@ -26,7 +26,7 @@ export class RTCRtpCodecParameters {
|
|
|
26
26
|
|
|
27
27
|
constructor(
|
|
28
28
|
props: Pick<RTCRtpCodecParameters, "mimeType" | "clockRate"> &
|
|
29
|
-
Partial<RTCRtpCodecParameters
|
|
29
|
+
Partial<RTCRtpCodecParameters>,
|
|
30
30
|
) {
|
|
31
31
|
Object.assign(this, props);
|
|
32
32
|
}
|
|
@@ -52,7 +52,7 @@ export class RTCRtpHeaderExtensionParameters {
|
|
|
52
52
|
|
|
53
53
|
constructor(
|
|
54
54
|
props: Partial<RTCRtpHeaderExtensionParameters> &
|
|
55
|
-
Pick<RTCRtpHeaderExtensionParameters, "uri"
|
|
55
|
+
Pick<RTCRtpHeaderExtensionParameters, "uri">,
|
|
56
56
|
) {
|
|
57
57
|
Object.assign(this, props);
|
|
58
58
|
}
|
|
@@ -91,7 +91,7 @@ export class RTCRtpCodingParameters {
|
|
|
91
91
|
|
|
92
92
|
constructor(
|
|
93
93
|
props: Partial<RTCRtpCodingParameters> &
|
|
94
|
-
Pick<RTCRtpCodingParameters, "ssrc" | "payloadType"
|
|
94
|
+
Pick<RTCRtpCodingParameters, "ssrc" | "payloadType">,
|
|
95
95
|
) {
|
|
96
96
|
Object.assign(this, props);
|
|
97
97
|
}
|
|
@@ -90,10 +90,13 @@ export class NackHandler {
|
|
|
90
90
|
if (this.lostSeqNumbers.length > LOST_SIZE) {
|
|
91
91
|
this._lost = Object.entries(this._lost)
|
|
92
92
|
.slice(-LOST_SIZE)
|
|
93
|
-
.reduce(
|
|
94
|
-
acc[key]
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
.reduce(
|
|
94
|
+
(acc, [key, v]) => {
|
|
95
|
+
acc[key] = v;
|
|
96
|
+
return acc;
|
|
97
|
+
},
|
|
98
|
+
{} as { [seqNum: number]: number },
|
|
99
|
+
);
|
|
97
100
|
}
|
|
98
101
|
}
|
|
99
102
|
|
|
@@ -29,7 +29,7 @@ export class ReceiverTWCC {
|
|
|
29
29
|
constructor(
|
|
30
30
|
private dtlsTransport: RTCDtlsTransport,
|
|
31
31
|
private rtcpSsrc: number,
|
|
32
|
-
private mediaSourceSsrc: number
|
|
32
|
+
private mediaSourceSsrc: number,
|
|
33
33
|
) {
|
|
34
34
|
this.runTWCC();
|
|
35
35
|
}
|
|
@@ -55,7 +55,7 @@ export class ReceiverTWCC {
|
|
|
55
55
|
private sendTWCC() {
|
|
56
56
|
if (Object.keys(this.extensionInfo).length === 0) return;
|
|
57
57
|
const extensionsArr = Object.values(this.extensionInfo).sort(
|
|
58
|
-
(a, b) => a.tsn - b.tsn
|
|
58
|
+
(a, b) => a.tsn - b.tsn,
|
|
59
59
|
);
|
|
60
60
|
|
|
61
61
|
const minTSN = extensionsArr[0].tsn;
|
|
@@ -99,7 +99,7 @@ export class ReceiverTWCC {
|
|
|
99
99
|
new RunLengthChunk({
|
|
100
100
|
packetStatus: lastPacketStatus.status,
|
|
101
101
|
runLength: i - lastPacketStatus.minTSN,
|
|
102
|
-
})
|
|
102
|
+
}),
|
|
103
103
|
);
|
|
104
104
|
lastPacketStatus = { minTSN: i, status: recvDelta.type! };
|
|
105
105
|
}
|
|
@@ -110,14 +110,14 @@ export class ReceiverTWCC {
|
|
|
110
110
|
new RunLengthChunk({
|
|
111
111
|
packetStatus: lastPacketStatus.status,
|
|
112
112
|
runLength: i - lastPacketStatus.minTSN + 1,
|
|
113
|
-
})
|
|
113
|
+
}),
|
|
114
114
|
);
|
|
115
115
|
} else {
|
|
116
116
|
packetChunks.push(
|
|
117
117
|
new RunLengthChunk({
|
|
118
118
|
packetStatus: recvDelta.type,
|
|
119
119
|
runLength: 1,
|
|
120
|
-
})
|
|
120
|
+
}),
|
|
121
121
|
);
|
|
122
122
|
}
|
|
123
123
|
}
|
|
@@ -51,7 +51,7 @@ export class StreamStatistics {
|
|
|
51
51
|
const diff = Math.abs(
|
|
52
52
|
arrival -
|
|
53
53
|
(this.last_arrival ?? 0) -
|
|
54
|
-
(packet.header.timestamp - (this.last_timestamp ?? 0))
|
|
54
|
+
(packet.header.timestamp - (this.last_timestamp ?? 0)),
|
|
55
55
|
);
|
|
56
56
|
this.jitter_q4 += diff - ((this.jitter_q4 + 8) >> 4);
|
|
57
57
|
}
|
package/src/media/router.ts
CHANGED
|
@@ -43,7 +43,7 @@ export class RtpRouter {
|
|
|
43
43
|
|
|
44
44
|
registerRtpReceiverBySsrc(
|
|
45
45
|
transceiver: RTCRtpTransceiver,
|
|
46
|
-
params: RTCRtpReceiveParameters
|
|
46
|
+
params: RTCRtpReceiveParameters,
|
|
47
47
|
) {
|
|
48
48
|
log("registerRtpReceiverBySsrc", params);
|
|
49
49
|
|
|
@@ -58,7 +58,7 @@ export class RtpRouter {
|
|
|
58
58
|
id: transceiver.sender.trackId,
|
|
59
59
|
remote: true,
|
|
60
60
|
codec: params.codecs[i],
|
|
61
|
-
})
|
|
61
|
+
}),
|
|
62
62
|
);
|
|
63
63
|
if (encode.rtx) {
|
|
64
64
|
this.registerRtpReceiver(transceiver.receiver, encode.rtx.ssrc);
|
|
@@ -73,7 +73,7 @@ export class RtpRouter {
|
|
|
73
73
|
registerRtpReceiverByRid(
|
|
74
74
|
transceiver: RTCRtpTransceiver,
|
|
75
75
|
param: RTCRtpSimulcastParameters,
|
|
76
|
-
params: RTCRtpReceiveParameters
|
|
76
|
+
params: RTCRtpReceiveParameters,
|
|
77
77
|
) {
|
|
78
78
|
// サイマルキャスト利用時のRTXをサポートしていないのでcodecs/encodingsは常に一つ
|
|
79
79
|
const [codec] = params.codecs;
|
|
@@ -86,7 +86,7 @@ export class RtpRouter {
|
|
|
86
86
|
id: transceiver.sender.trackId,
|
|
87
87
|
remote: true,
|
|
88
88
|
codec,
|
|
89
|
-
})
|
|
89
|
+
}),
|
|
90
90
|
);
|
|
91
91
|
this.ridTable[param.rid] = transceiver.receiver;
|
|
92
92
|
}
|
|
@@ -94,7 +94,7 @@ export class RtpRouter {
|
|
|
94
94
|
routeRtp = (packet: RtpPacket) => {
|
|
95
95
|
const extensions = rtpHeaderExtensionsParser(
|
|
96
96
|
packet.header.extensions,
|
|
97
|
-
this.extIdUriMap
|
|
97
|
+
this.extIdUriMap,
|
|
98
98
|
);
|
|
99
99
|
|
|
100
100
|
let rtpReceiver: RTCRtpReceiver | undefined = this.ssrcTable[
|
package/src/media/rtpReceiver.ts
CHANGED
|
@@ -35,7 +35,7 @@ export class RTCRtpReceiver {
|
|
|
35
35
|
private readonly codecs: { [pt: number]: RTCRtpCodecParameters } = {};
|
|
36
36
|
private get codecArray() {
|
|
37
37
|
return Object.values(this.codecs).sort(
|
|
38
|
-
(a, b) => a.payloadType - b.payloadType
|
|
38
|
+
(a, b) => a.payloadType - b.payloadType,
|
|
39
39
|
);
|
|
40
40
|
}
|
|
41
41
|
private readonly ssrcByRtx: { [rtxSsrc: number]: number } = {};
|
|
@@ -73,7 +73,7 @@ export class RTCRtpReceiver {
|
|
|
73
73
|
constructor(
|
|
74
74
|
readonly config: PeerConfig,
|
|
75
75
|
public kind: Kind,
|
|
76
|
-
public rtcpSsrc: number
|
|
76
|
+
public rtcpSsrc: number,
|
|
77
77
|
) {}
|
|
78
78
|
|
|
79
79
|
setDtlsTransport(dtls: RTCDtlsTransport) {
|
|
@@ -91,13 +91,13 @@ export class RTCRtpReceiver {
|
|
|
91
91
|
|
|
92
92
|
get twccEnabled() {
|
|
93
93
|
return this.codecArray[0]?.rtcpFeedback.find(
|
|
94
|
-
(f) => f.type === useTWCC().type
|
|
94
|
+
(f) => f.type === useTWCC().type,
|
|
95
95
|
);
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
get pliEnabled() {
|
|
99
99
|
return this.codecArray[0]?.rtcpFeedback.find(
|
|
100
|
-
(f) => f.type === usePLI().type
|
|
100
|
+
(f) => f.type === usePLI().type,
|
|
101
101
|
);
|
|
102
102
|
}
|
|
103
103
|
|
|
@@ -120,7 +120,7 @@ export class RTCRtpReceiver {
|
|
|
120
120
|
this.receiverTWCC = new ReceiverTWCC(
|
|
121
121
|
this.dtlsTransport,
|
|
122
122
|
this.rtcpSsrc,
|
|
123
|
-
mediaSourceSsrc
|
|
123
|
+
mediaSourceSsrc,
|
|
124
124
|
);
|
|
125
125
|
}
|
|
126
126
|
}
|
|
@@ -188,7 +188,7 @@ export class RTCRtpReceiver {
|
|
|
188
188
|
lsr: lastSRtimestamp,
|
|
189
189
|
dlsr: delaySinceLastSR,
|
|
190
190
|
});
|
|
191
|
-
}
|
|
191
|
+
},
|
|
192
192
|
);
|
|
193
193
|
|
|
194
194
|
const packet = new RtcpRrPacket({ ssrc: this.rtcpSsrc, reports });
|
|
@@ -240,7 +240,7 @@ export class RTCRtpReceiver {
|
|
|
240
240
|
{
|
|
241
241
|
const sr = packet as RtcpSrPacket;
|
|
242
242
|
this.lastSRtimestamp[sr.ssrc] = compactNtp(
|
|
243
|
-
sr.senderInfo.ntpTimestamp
|
|
243
|
+
sr.senderInfo.ntpTimestamp,
|
|
244
244
|
);
|
|
245
245
|
this.receiveLastSRTimestamp[sr.ssrc] = timestampSeconds();
|
|
246
246
|
|
|
@@ -272,7 +272,7 @@ export class RTCRtpReceiver {
|
|
|
272
272
|
private handleRTP(
|
|
273
273
|
packet: RtpPacket,
|
|
274
274
|
extensions: Extensions,
|
|
275
|
-
track?: MediaStreamTrack
|
|
275
|
+
track?: MediaStreamTrack,
|
|
276
276
|
) {
|
|
277
277
|
if (this.stopped) {
|
|
278
278
|
return;
|
|
@@ -318,7 +318,7 @@ export class RTCRtpReceiver {
|
|
|
318
318
|
red = Red.deSerialize(packet.payload);
|
|
319
319
|
if (
|
|
320
320
|
!Object.keys(this.codecs).includes(
|
|
321
|
-
red.header.fields[0].blockPT.toString()
|
|
321
|
+
red.header.fields[0].blockPT.toString(),
|
|
322
322
|
)
|
|
323
323
|
) {
|
|
324
324
|
return;
|
package/src/media/rtpSender.ts
CHANGED
|
@@ -179,7 +179,7 @@ export class RTCRtpSender {
|
|
|
179
179
|
}
|
|
180
180
|
if (codec.name.toLowerCase() === "red") {
|
|
181
181
|
this.redRedundantPayloadType = Number(
|
|
182
|
-
(codec.parameters ?? "").split("/")[0]
|
|
182
|
+
(codec.parameters ?? "").split("/")[0],
|
|
183
183
|
);
|
|
184
184
|
}
|
|
185
185
|
});
|
|
@@ -273,7 +273,7 @@ export class RTCRtpSender {
|
|
|
273
273
|
],
|
|
274
274
|
}),
|
|
275
275
|
],
|
|
276
|
-
})
|
|
276
|
+
}),
|
|
277
277
|
);
|
|
278
278
|
}
|
|
279
279
|
|
|
@@ -292,7 +292,7 @@ export class RTCRtpSender {
|
|
|
292
292
|
sequenceNumber,
|
|
293
293
|
timestamp,
|
|
294
294
|
}: Pick<RtpHeader, "sequenceNumber" | "timestamp">,
|
|
295
|
-
discontinuity = false
|
|
295
|
+
discontinuity = false,
|
|
296
296
|
) {
|
|
297
297
|
if (this.sequenceNumber != undefined) {
|
|
298
298
|
this.seqOffset = uint16Add(this.sequenceNumber, -sequenceNumber);
|
|
@@ -351,10 +351,10 @@ export class RTCRtpSender {
|
|
|
351
351
|
case RTP_EXTENSION_URI.transportWideCC:
|
|
352
352
|
this.dtlsTransport.transportSequenceNumber = uint16Add(
|
|
353
353
|
this.dtlsTransport.transportSequenceNumber,
|
|
354
|
-
1
|
|
354
|
+
1,
|
|
355
355
|
);
|
|
356
356
|
return serializeTransportWideCC(
|
|
357
|
-
this.dtlsTransport.transportSequenceNumber
|
|
357
|
+
this.dtlsTransport.transportSequenceNumber,
|
|
358
358
|
);
|
|
359
359
|
case RTP_EXTENSION_URI.absSendTime:
|
|
360
360
|
return serializeAbsSendTime(ntpTimestamp);
|
|
@@ -447,16 +447,16 @@ export class RTCRtpSender {
|
|
|
447
447
|
packet,
|
|
448
448
|
this.rtxPayloadType,
|
|
449
449
|
this.rtxSequenceNumber,
|
|
450
|
-
this.rtxSsrc
|
|
450
|
+
this.rtxSsrc,
|
|
451
451
|
);
|
|
452
452
|
this.rtxSequenceNumber = uint16Add(
|
|
453
453
|
this.rtxSequenceNumber,
|
|
454
|
-
1
|
|
454
|
+
1,
|
|
455
455
|
);
|
|
456
456
|
}
|
|
457
457
|
await this.dtlsTransport.sendRtp(
|
|
458
458
|
packet.payload,
|
|
459
|
-
packet.header
|
|
459
|
+
packet.header,
|
|
460
460
|
);
|
|
461
461
|
}
|
|
462
462
|
});
|
|
@@ -39,7 +39,7 @@ export class RTCRtpTransceiver {
|
|
|
39
39
|
public receiver: RTCRtpReceiver,
|
|
40
40
|
public sender: RTCRtpSender,
|
|
41
41
|
/**RFC 8829 4.2.4. direction the transceiver was initialized with */
|
|
42
|
-
private _direction: Direction
|
|
42
|
+
private _direction: Direction,
|
|
43
43
|
) {
|
|
44
44
|
this.setDtlsTransport(dtlsTransport);
|
|
45
45
|
}
|
|
@@ -99,7 +99,7 @@ export class RTCRtpTransceiver {
|
|
|
99
99
|
|
|
100
100
|
getPayloadType(mimeType: string) {
|
|
101
101
|
return this.codecs.find((codec) =>
|
|
102
|
-
codec.mimeType.toLowerCase().includes(mimeType.toLowerCase())
|
|
102
|
+
codec.mimeType.toLowerCase().includes(mimeType.toLowerCase()),
|
|
103
103
|
)?.payloadType;
|
|
104
104
|
}
|
|
105
105
|
}
|
|
@@ -111,7 +111,7 @@ export const Sendrecv = "sendrecv";
|
|
|
111
111
|
|
|
112
112
|
export const Directions = [Inactive, Sendonly, Recvonly, Sendrecv] as const;
|
|
113
113
|
|
|
114
|
-
export type Direction = typeof Directions[number];
|
|
114
|
+
export type Direction = (typeof Directions)[number];
|
|
115
115
|
|
|
116
116
|
type SimulcastDirection = "send" | "recv";
|
|
117
117
|
|
|
@@ -70,14 +70,14 @@ export class SenderBandwidthEstimator {
|
|
|
70
70
|
this.cumulativeResult.addPacket(
|
|
71
71
|
info.size,
|
|
72
72
|
info.sendingAtMs,
|
|
73
|
-
result.receivedAtMs
|
|
73
|
+
result.receivedAtMs,
|
|
74
74
|
);
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
if (elapsedMs >= 100 && this.cumulativeResult.numPackets >= 20) {
|
|
78
78
|
this.availableBitrate = Math.min(
|
|
79
79
|
this.cumulativeResult.sendBitrate,
|
|
80
|
-
this.cumulativeResult.receiveBitrate
|
|
80
|
+
this.cumulativeResult.receiveBitrate,
|
|
81
81
|
);
|
|
82
82
|
this.cumulativeResult.reset();
|
|
83
83
|
|
package/src/media/track.ts
CHANGED
|
@@ -32,7 +32,7 @@ export class MediaStreamTrack extends EventTarget {
|
|
|
32
32
|
muted = true;
|
|
33
33
|
|
|
34
34
|
constructor(
|
|
35
|
-
props: Partial<MediaStreamTrack> & Pick<MediaStreamTrack, "kind"
|
|
35
|
+
props: Partial<MediaStreamTrack> & Pick<MediaStreamTrack, "kind">,
|
|
36
36
|
) {
|
|
37
37
|
super();
|
|
38
38
|
Object.assign(this, props);
|
|
@@ -14,7 +14,7 @@ export class MediaRecorder {
|
|
|
14
14
|
constructor(
|
|
15
15
|
public path: string,
|
|
16
16
|
public numOfTracks = 1,
|
|
17
|
-
public options: Partial<MediaRecorderOptions> = {}
|
|
17
|
+
public options: Partial<MediaRecorderOptions> = {},
|
|
18
18
|
) {
|
|
19
19
|
this.ext = path.split(".").slice(-1)[0];
|
|
20
20
|
this.writer = (() => {
|
|
@@ -4,7 +4,7 @@ import { MediaRecorderOptions } from "..";
|
|
|
4
4
|
export abstract class MediaWriter {
|
|
5
5
|
constructor(
|
|
6
6
|
protected path: string,
|
|
7
|
-
protected options: Partial<MediaRecorderOptions
|
|
7
|
+
protected options: Partial<MediaRecorderOptions>,
|
|
8
8
|
) {}
|
|
9
9
|
|
|
10
10
|
async start(tracks: MediaStreamTrack[]) {}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { unlink } from "fs/promises";
|
|
2
2
|
import { EventDisposer } from "rx.mini";
|
|
3
3
|
|
|
4
|
-
import { SupportedCodec } from "../../../../../rtp/src/container/webm";
|
|
4
|
+
import { SupportedCodec } from "../../../../../rtp/src/container/webm/container";
|
|
5
5
|
import {
|
|
6
6
|
DepacketizeCallback,
|
|
7
7
|
JitterBufferCallback,
|
|
@@ -126,4 +126,4 @@ export class WebmFactory extends MediaWriter {
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
const supportedVideoCodecs = ["h264", "vp8", "vp9", "av1x"] as const;
|
|
129
|
-
type SupportedVideoCodec = typeof supportedVideoCodecs[number];
|
|
129
|
+
type SupportedVideoCodec = (typeof supportedVideoCodecs)[number];
|