@gjsify/webrtc 0.3.13 → 0.3.14
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/esm/get-user-media.js +95 -80
- package/lib/esm/gst-enum-maps.js +55 -59
- package/lib/esm/gst-init.js +19 -22
- package/lib/esm/gst-stats-parser.js +94 -67
- package/lib/esm/gst-utils.js +24 -13
- package/lib/esm/index.js +13 -43
- package/lib/esm/media-device-info.js +23 -22
- package/lib/esm/media-devices.js +150 -139
- package/lib/esm/media-stream-track.js +136 -139
- package/lib/esm/media-stream.js +76 -75
- package/lib/esm/register/data-channel.js +7 -3
- package/lib/esm/register/error.js +6 -2
- package/lib/esm/register/media-devices.js +6 -2
- package/lib/esm/register/media.js +8 -4
- package/lib/esm/register/peer-connection.js +9 -5
- package/lib/esm/rtc-certificate.js +62 -66
- package/lib/esm/rtc-data-channel.js +240 -251
- package/lib/esm/rtc-dtls-transport.js +40 -39
- package/lib/esm/rtc-dtmf-sender.js +92 -100
- package/lib/esm/rtc-error.js +24 -22
- package/lib/esm/rtc-events.js +33 -33
- package/lib/esm/rtc-ice-candidate.js +71 -72
- package/lib/esm/rtc-ice-transport.js +95 -94
- package/lib/esm/rtc-peer-connection.js +796 -845
- package/lib/esm/rtc-rtp-receiver.js +89 -87
- package/lib/esm/rtc-rtp-sender.js +282 -290
- package/lib/esm/rtc-rtp-transceiver.js +92 -93
- package/lib/esm/rtc-sctp-transport.js +38 -38
- package/lib/esm/rtc-session-description.js +47 -51
- package/lib/esm/rtc-stats-report.js +39 -34
- package/lib/esm/rtc-track-event.js +29 -27
- package/lib/esm/rtp-capabilities.js +81 -35
- package/lib/esm/tee-multiplexer.js +58 -60
- package/lib/esm/wpt-helpers.js +128 -112
- package/package.json +13 -13
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,91 +1,93 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ReceiverBridge
|
|
3
|
-
} from "@gjsify/webrtc-native";
|
|
4
1
|
import { MediaStreamTrack } from "./media-stream-track.js";
|
|
5
2
|
import { getRtpCapabilities } from "./rtp-capabilities.js";
|
|
3
|
+
import { ReceiverBridge } from "@gjsify/webrtc-native";
|
|
4
|
+
|
|
5
|
+
//#region src/rtc-rtp-receiver.ts
|
|
6
6
|
const MAX_JITTER_BUFFER_TARGET = 4e3;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
RTCRtpReceiver
|
|
7
|
+
var RTCRtpReceiver = class {
|
|
8
|
+
_gstReceiver;
|
|
9
|
+
_track;
|
|
10
|
+
_jitterBufferTarget = null;
|
|
11
|
+
_pipeline = null;
|
|
12
|
+
_receiverBridge = null;
|
|
13
|
+
/** @internal — stats callback set by RTCPeerConnection */
|
|
14
|
+
_getStatsForTrack = null;
|
|
15
|
+
constructor(kind, gstReceiver, pipeline) {
|
|
16
|
+
this._gstReceiver = gstReceiver;
|
|
17
|
+
this._pipeline = pipeline ?? null;
|
|
18
|
+
this._track = new MediaStreamTrack({
|
|
19
|
+
kind,
|
|
20
|
+
muted: true
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
/** @internal — called from RTCPeerConnection._handlePadAdded */
|
|
24
|
+
_connectToPad(pad) {
|
|
25
|
+
if (!this._pipeline || this._receiverBridge) return;
|
|
26
|
+
this._receiverBridge = new ReceiverBridge({
|
|
27
|
+
pipeline: this._pipeline,
|
|
28
|
+
kind: this._track.kind
|
|
29
|
+
});
|
|
30
|
+
this._receiverBridge.connect_to_pad(pad);
|
|
31
|
+
this._receiverBridge.connect("media-flowing", () => {
|
|
32
|
+
this._track._setMuted(false);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/** @internal — called from RTCPeerConnection.close() */
|
|
36
|
+
_dispose() {
|
|
37
|
+
try {
|
|
38
|
+
this._receiverBridge?.dispose_bridge();
|
|
39
|
+
} catch {}
|
|
40
|
+
this._receiverBridge = null;
|
|
41
|
+
}
|
|
42
|
+
/** @internal — set by RTCPeerConnection */
|
|
43
|
+
_transport = null;
|
|
44
|
+
get track() {
|
|
45
|
+
return this._track;
|
|
46
|
+
}
|
|
47
|
+
get transport() {
|
|
48
|
+
return this._transport;
|
|
49
|
+
}
|
|
50
|
+
get jitterBufferTarget() {
|
|
51
|
+
return this._jitterBufferTarget;
|
|
52
|
+
}
|
|
53
|
+
set jitterBufferTarget(v) {
|
|
54
|
+
if (v === null) {
|
|
55
|
+
this._jitterBufferTarget = null;
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const n = Number(v);
|
|
59
|
+
if (!Number.isFinite(n) || n < 0) {
|
|
60
|
+
throw new RangeError(`Failed to set jitterBufferTarget: ${v} is negative or not finite`);
|
|
61
|
+
}
|
|
62
|
+
if (n > MAX_JITTER_BUFFER_TARGET) {
|
|
63
|
+
throw new RangeError(`Failed to set jitterBufferTarget: ${v} exceeds maximum of ${MAX_JITTER_BUFFER_TARGET}`);
|
|
64
|
+
}
|
|
65
|
+
this._jitterBufferTarget = n;
|
|
66
|
+
}
|
|
67
|
+
getParameters() {
|
|
68
|
+
return {
|
|
69
|
+
codecs: [],
|
|
70
|
+
headerExtensions: [],
|
|
71
|
+
rtcp: {}
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
getContributingSources() {
|
|
75
|
+
return [];
|
|
76
|
+
}
|
|
77
|
+
getSynchronizationSources() {
|
|
78
|
+
return [];
|
|
79
|
+
}
|
|
80
|
+
async getStats() {
|
|
81
|
+
if (this._getStatsForTrack && this._track) {
|
|
82
|
+
return this._getStatsForTrack(this._track);
|
|
83
|
+
}
|
|
84
|
+
const { RTCStatsReport: Report } = await import("./rtc-stats-report.js");
|
|
85
|
+
return new Report();
|
|
86
|
+
}
|
|
87
|
+
static getCapabilities(kind) {
|
|
88
|
+
return getRtpCapabilities(kind);
|
|
89
|
+
}
|
|
91
90
|
};
|
|
91
|
+
|
|
92
|
+
//#endregion
|
|
93
|
+
export { RTCRtpReceiver };
|