@epicgames-ps/lib-pixelstreamingfrontend-ue5.5 0.4.7 → 1.0.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/.lintstagedrc.mjs +7 -0
- package/dist/{commonjs → cjs}/Config/Config.js +8 -0
- package/dist/cjs/Config/Config.js.map +1 -0
- package/dist/{commonjs → cjs}/Config/SettingBase.js +1 -3
- package/dist/cjs/Config/SettingBase.js.map +1 -0
- package/dist/{commonjs → cjs}/Config/SettingFlag.js +1 -3
- package/dist/cjs/Config/SettingFlag.js.map +1 -0
- package/dist/{commonjs → cjs}/Config/SettingNumber.js +1 -3
- package/dist/cjs/Config/SettingNumber.js.map +1 -0
- package/dist/{commonjs → cjs}/Config/SettingOption.js +2 -6
- package/dist/cjs/Config/SettingOption.js.map +1 -0
- package/dist/{commonjs → cjs}/Config/SettingText.js +1 -3
- package/dist/cjs/Config/SettingText.js.map +1 -0
- package/dist/{commonjs → cjs}/Inputs/GamepadController.js +0 -2
- package/dist/cjs/Inputs/GamepadController.js.map +1 -0
- package/dist/{commonjs → cjs}/PeerConnectionController/AggregatedStats.js +103 -45
- package/dist/cjs/PeerConnectionController/AggregatedStats.js.map +1 -0
- package/dist/{commonjs → cjs}/PeerConnectionController/InboundRTPStats.js.map +1 -1
- package/dist/cjs/PeerConnectionController/LatencyCalculator.js +290 -0
- package/dist/cjs/PeerConnectionController/LatencyCalculator.js.map +1 -0
- package/dist/cjs/PeerConnectionController/OutBoundRTPStats.js +21 -0
- package/dist/cjs/PeerConnectionController/OutBoundRTPStats.js.map +1 -0
- package/dist/{commonjs → cjs}/PeerConnectionController/PeerConnectionController.js +53 -19
- package/dist/cjs/PeerConnectionController/PeerConnectionController.js.map +1 -0
- package/dist/{commonjs → cjs}/PixelStreaming/PixelStreaming.js +24 -3
- package/dist/cjs/PixelStreaming/PixelStreaming.js.map +1 -0
- package/dist/{commonjs → cjs}/Util/EventEmitter.js +38 -1
- package/dist/cjs/Util/EventEmitter.js.map +1 -0
- package/dist/{commonjs → cjs}/WebRtcPlayer/WebRtcPlayerController.js +41 -5
- package/dist/cjs/WebRtcPlayer/WebRtcPlayerController.js.map +1 -0
- package/dist/cjs/__test__/mockMediaStream.js +100 -0
- package/dist/cjs/__test__/mockMediaStream.js.map +1 -0
- package/dist/cjs/__test__/mockRTCPeerConnection.js +252 -0
- package/dist/cjs/__test__/mockRTCPeerConnection.js.map +1 -0
- package/dist/cjs/__test__/mockRTCRtpReceiver.js +26 -0
- package/dist/cjs/__test__/mockRTCRtpReceiver.js.map +1 -0
- package/dist/cjs/__test__/mockWebSocket.js +109 -0
- package/dist/cjs/__test__/mockWebSocket.js.map +1 -0
- package/dist/{commonjs → cjs}/pixelstreamingfrontend.js +4 -2
- package/dist/{commonjs → cjs}/pixelstreamingfrontend.js.map +1 -1
- package/dist/esm/Config/Config.js +8 -0
- package/dist/esm/Config/Config.js.map +1 -1
- package/dist/esm/Config/SettingBase.js +1 -3
- package/dist/esm/Config/SettingBase.js.map +1 -1
- package/dist/esm/Config/SettingFlag.js +1 -3
- package/dist/esm/Config/SettingFlag.js.map +1 -1
- package/dist/esm/Config/SettingNumber.js +1 -3
- package/dist/esm/Config/SettingNumber.js.map +1 -1
- package/dist/esm/Config/SettingOption.js +2 -6
- package/dist/esm/Config/SettingOption.js.map +1 -1
- package/dist/esm/Config/SettingText.js +1 -3
- package/dist/esm/Config/SettingText.js.map +1 -1
- package/dist/esm/Inputs/GamepadController.js +0 -2
- package/dist/esm/Inputs/GamepadController.js.map +1 -1
- package/dist/esm/PeerConnectionController/AggregatedStats.js +104 -46
- package/dist/esm/PeerConnectionController/AggregatedStats.js.map +1 -1
- package/dist/esm/PeerConnectionController/InboundRTPStats.js.map +1 -1
- package/dist/esm/PeerConnectionController/LatencyCalculator.js +284 -0
- package/dist/esm/PeerConnectionController/LatencyCalculator.js.map +1 -0
- package/dist/esm/PeerConnectionController/OutBoundRTPStats.js +8 -4
- package/dist/esm/PeerConnectionController/OutBoundRTPStats.js.map +1 -1
- package/dist/esm/PeerConnectionController/PeerConnectionController.js +52 -18
- package/dist/esm/PeerConnectionController/PeerConnectionController.js.map +1 -1
- package/dist/esm/PixelStreaming/PixelStreaming.js +25 -4
- package/dist/esm/PixelStreaming/PixelStreaming.js.map +1 -1
- package/dist/esm/Util/EventEmitter.js +33 -0
- package/dist/esm/Util/EventEmitter.js.map +1 -1
- package/dist/esm/WebRtcPlayer/WebRtcPlayerController.js +42 -6
- package/dist/esm/WebRtcPlayer/WebRtcPlayerController.js.map +1 -1
- package/dist/esm/__test__/mockMediaStream.js +92 -0
- package/dist/esm/__test__/mockMediaStream.js.map +1 -0
- package/dist/esm/__test__/mockRTCPeerConnection.js +242 -0
- package/dist/esm/__test__/mockRTCPeerConnection.js.map +1 -0
- package/dist/esm/__test__/mockRTCRtpReceiver.js +21 -0
- package/dist/esm/__test__/mockRTCRtpReceiver.js.map +1 -0
- package/dist/esm/__test__/mockWebSocket.js +103 -0
- package/dist/esm/__test__/mockWebSocket.js.map +1 -0
- package/dist/esm/pixelstreamingfrontend.js +2 -1
- package/dist/esm/pixelstreamingfrontend.js.map +1 -1
- package/dist/types/Config/Config.d.ts +2 -0
- package/dist/types/PeerConnectionController/AggregatedStats.d.ts +18 -7
- package/dist/types/PeerConnectionController/InboundRTPStats.d.ts +88 -85
- package/dist/types/PeerConnectionController/LatencyCalculator.d.ts +87 -0
- package/dist/types/PeerConnectionController/OutBoundRTPStats.d.ts +46 -12
- package/dist/types/PeerConnectionController/PeerConnectionController.d.ts +17 -3
- package/dist/types/PixelStreaming/PixelStreaming.d.ts +17 -3
- package/dist/types/Util/EventEmitter.d.ts +41 -1
- package/dist/types/VideoPlayer/VideoPlayer.d.ts +1 -1
- package/dist/types/WebRtcPlayer/WebRtcPlayerController.d.ts +4 -1
- package/dist/types/__test__/mockMediaStream.d.ts +49 -0
- package/dist/types/__test__/mockRTCPeerConnection.d.ts +134 -0
- package/dist/types/__test__/mockRTCRtpReceiver.d.ts +3 -0
- package/dist/types/__test__/mockWebSocket.d.ts +33 -0
- package/dist/types/pixelstreamingfrontend.d.ts +2 -1
- package/eslint.config.mjs +52 -0
- package/package.json +47 -45
- package/src/Config/Config.ts +30 -0
- package/src/Config/SettingBase.ts +1 -1
- package/src/Config/SettingFlag.ts +1 -1
- package/src/Config/SettingNumber.ts +1 -1
- package/src/Config/SettingOption.ts +2 -2
- package/src/Config/SettingText.ts +1 -1
- package/src/Inputs/GamepadController.ts +2 -2
- package/src/PeerConnectionController/AggregatedStats.ts +111 -52
- package/src/PeerConnectionController/InboundRTPStats.ts +88 -85
- package/src/PeerConnectionController/LatencyCalculator.ts +392 -0
- package/src/PeerConnectionController/OutBoundRTPStats.ts +46 -12
- package/src/PeerConnectionController/PeerConnectionController.ts +72 -19
- package/src/PixelStreaming/PixelStreaming.ts +34 -4
- package/src/Util/EventEmitter.ts +60 -0
- package/src/VideoPlayer/VideoPlayer.ts +1 -1
- package/src/WebRtcPlayer/WebRtcPlayerController.ts +53 -7
- package/src/__test__/mockRTCPeerConnection.ts +1 -1
- package/src/pixelstreamingfrontend.ts +2 -1
- package/{tsconfig.json → tsconfig.base.json} +5 -3
- package/tsconfig.cjs.json +3 -5
- package/tsconfig.esm.json +3 -3
- package/tsconfig.jest.json +6 -6
- package/.eslintignore +0 -12
- package/.eslintrc.js +0 -20
- package/.prettierrc.json +0 -7
- package/dist/commonjs/Config/Config.js.map +0 -1
- package/dist/commonjs/Config/SettingBase.js.map +0 -1
- package/dist/commonjs/Config/SettingFlag.js.map +0 -1
- package/dist/commonjs/Config/SettingNumber.js.map +0 -1
- package/dist/commonjs/Config/SettingOption.js.map +0 -1
- package/dist/commonjs/Config/SettingText.js.map +0 -1
- package/dist/commonjs/Inputs/GamepadController.js.map +0 -1
- package/dist/commonjs/PeerConnectionController/AggregatedStats.js.map +0 -1
- package/dist/commonjs/PeerConnectionController/OutBoundRTPStats.js +0 -17
- package/dist/commonjs/PeerConnectionController/OutBoundRTPStats.js.map +0 -1
- package/dist/commonjs/PeerConnectionController/PeerConnectionController.js.map +0 -1
- package/dist/commonjs/PixelStreaming/PixelStreaming.js.map +0 -1
- package/dist/commonjs/Util/EventEmitter.js.map +0 -1
- package/dist/commonjs/WebRtcPlayer/WebRtcPlayerController.js.map +0 -1
- /package/dist/{commonjs → cjs}/AFK/AFKController.js +0 -0
- /package/dist/{commonjs → cjs}/AFK/AFKController.js.map +0 -0
- /package/dist/{commonjs → cjs}/DataChannel/DataChannelController.js +0 -0
- /package/dist/{commonjs → cjs}/DataChannel/DataChannelController.js.map +0 -0
- /package/dist/{commonjs → cjs}/DataChannel/DataChannelLatencyTestController.js +0 -0
- /package/dist/{commonjs → cjs}/DataChannel/DataChannelLatencyTestController.js.map +0 -0
- /package/dist/{commonjs → cjs}/DataChannel/DataChannelLatencyTestResults.js +0 -0
- /package/dist/{commonjs → cjs}/DataChannel/DataChannelLatencyTestResults.js.map +0 -0
- /package/dist/{commonjs → cjs}/DataChannel/DataChannelSender.js +0 -0
- /package/dist/{commonjs → cjs}/DataChannel/DataChannelSender.js.map +0 -0
- /package/dist/{commonjs → cjs}/DataChannel/InitialSettings.js +0 -0
- /package/dist/{commonjs → cjs}/DataChannel/InitialSettings.js.map +0 -0
- /package/dist/{commonjs → cjs}/DataChannel/LatencyTestResults.js +0 -0
- /package/dist/{commonjs → cjs}/DataChannel/LatencyTestResults.js.map +0 -0
- /package/dist/{commonjs → cjs}/FreezeFrame/FreezeFrame.js +0 -0
- /package/dist/{commonjs → cjs}/FreezeFrame/FreezeFrame.js.map +0 -0
- /package/dist/{commonjs → cjs}/FreezeFrame/FreezeFrameController.js +0 -0
- /package/dist/{commonjs → cjs}/FreezeFrame/FreezeFrameController.js.map +0 -0
- /package/dist/{commonjs → cjs}/Inputs/GamepadTypes.js +0 -0
- /package/dist/{commonjs → cjs}/Inputs/GamepadTypes.js.map +0 -0
- /package/dist/{commonjs → cjs}/Inputs/IInputController.js +0 -0
- /package/dist/{commonjs → cjs}/Inputs/IInputController.js.map +0 -0
- /package/dist/{commonjs → cjs}/Inputs/InputClassesFactory.js +0 -0
- /package/dist/{commonjs → cjs}/Inputs/InputClassesFactory.js.map +0 -0
- /package/dist/{commonjs → cjs}/Inputs/KeyCodes.js +0 -0
- /package/dist/{commonjs → cjs}/Inputs/KeyCodes.js.map +0 -0
- /package/dist/{commonjs → cjs}/Inputs/KeyboardController.js +0 -0
- /package/dist/{commonjs → cjs}/Inputs/KeyboardController.js.map +0 -0
- /package/dist/{commonjs → cjs}/Inputs/MouseButtons.js +0 -0
- /package/dist/{commonjs → cjs}/Inputs/MouseButtons.js.map +0 -0
- /package/dist/{commonjs → cjs}/Inputs/MouseController.js +0 -0
- /package/dist/{commonjs → cjs}/Inputs/MouseController.js.map +0 -0
- /package/dist/{commonjs → cjs}/Inputs/MouseControllerHovering.js +0 -0
- /package/dist/{commonjs → cjs}/Inputs/MouseControllerHovering.js.map +0 -0
- /package/dist/{commonjs → cjs}/Inputs/MouseControllerLocked.js +0 -0
- /package/dist/{commonjs → cjs}/Inputs/MouseControllerLocked.js.map +0 -0
- /package/dist/{commonjs → cjs}/Inputs/SpecialKeyCodes.js +0 -0
- /package/dist/{commonjs → cjs}/Inputs/SpecialKeyCodes.js.map +0 -0
- /package/dist/{commonjs → cjs}/Inputs/TouchController.js +0 -0
- /package/dist/{commonjs → cjs}/Inputs/TouchController.js.map +0 -0
- /package/dist/{commonjs → cjs}/Inputs/TouchControllerFake.js +0 -0
- /package/dist/{commonjs → cjs}/Inputs/TouchControllerFake.js.map +0 -0
- /package/dist/{commonjs → cjs}/Inputs/XRGamepadController.js +0 -0
- /package/dist/{commonjs → cjs}/Inputs/XRGamepadController.js.map +0 -0
- /package/dist/{commonjs → cjs}/PeerConnectionController/CandidatePairStats.js +0 -0
- /package/dist/{commonjs → cjs}/PeerConnectionController/CandidatePairStats.js.map +0 -0
- /package/dist/{commonjs → cjs}/PeerConnectionController/CandidateStat.js +0 -0
- /package/dist/{commonjs → cjs}/PeerConnectionController/CandidateStat.js.map +0 -0
- /package/dist/{commonjs → cjs}/PeerConnectionController/CodecStats.js +0 -0
- /package/dist/{commonjs → cjs}/PeerConnectionController/CodecStats.js.map +0 -0
- /package/dist/{commonjs → cjs}/PeerConnectionController/DataChannelStats.js +0 -0
- /package/dist/{commonjs → cjs}/PeerConnectionController/DataChannelStats.js.map +0 -0
- /package/dist/{commonjs → cjs}/PeerConnectionController/InboundRTPStats.js +0 -0
- /package/dist/{commonjs → cjs}/PeerConnectionController/InboundTrackStats.js +0 -0
- /package/dist/{commonjs → cjs}/PeerConnectionController/InboundTrackStats.js.map +0 -0
- /package/dist/{commonjs → cjs}/PeerConnectionController/SessionStats.js +0 -0
- /package/dist/{commonjs → cjs}/PeerConnectionController/SessionStats.js.map +0 -0
- /package/dist/{commonjs → cjs}/PeerConnectionController/StreamStats.js +0 -0
- /package/dist/{commonjs → cjs}/PeerConnectionController/StreamStats.js.map +0 -0
- /package/dist/{commonjs → cjs}/UI/OnScreenKeyboard.js +0 -0
- /package/dist/{commonjs → cjs}/UI/OnScreenKeyboard.js.map +0 -0
- /package/dist/{commonjs → cjs}/UeInstanceMessage/ResponseController.js +0 -0
- /package/dist/{commonjs → cjs}/UeInstanceMessage/ResponseController.js.map +0 -0
- /package/dist/{commonjs → cjs}/UeInstanceMessage/SendMessageController.js +0 -0
- /package/dist/{commonjs → cjs}/UeInstanceMessage/SendMessageController.js.map +0 -0
- /package/dist/{commonjs → cjs}/UeInstanceMessage/StreamMessageController.js +0 -0
- /package/dist/{commonjs → cjs}/UeInstanceMessage/StreamMessageController.js.map +0 -0
- /package/dist/{commonjs → cjs}/UeInstanceMessage/ToStreamerMessagesController.js +0 -0
- /package/dist/{commonjs → cjs}/UeInstanceMessage/ToStreamerMessagesController.js.map +0 -0
- /package/dist/{commonjs → cjs}/Util/FileUtil.js +0 -0
- /package/dist/{commonjs → cjs}/Util/FileUtil.js.map +0 -0
- /package/dist/{commonjs → cjs}/Util/IURLSearchParams.js +0 -0
- /package/dist/{commonjs → cjs}/Util/IURLSearchParams.js.map +0 -0
- /package/dist/{commonjs → cjs}/Util/InputCoordTranslator.js +0 -0
- /package/dist/{commonjs → cjs}/Util/InputCoordTranslator.js.map +0 -0
- /package/dist/{commonjs → cjs}/Util/RTCUtils.js +0 -0
- /package/dist/{commonjs → cjs}/Util/RTCUtils.js.map +0 -0
- /package/dist/{commonjs → cjs}/VideoPlayer/StreamController.js +0 -0
- /package/dist/{commonjs → cjs}/VideoPlayer/StreamController.js.map +0 -0
- /package/dist/{commonjs → cjs}/VideoPlayer/VideoPlayer.js +0 -0
- /package/dist/{commonjs → cjs}/VideoPlayer/VideoPlayer.js.map +0 -0
- /package/dist/{commonjs → cjs}/WebXR/WebXRController.js +0 -0
- /package/dist/{commonjs → cjs}/WebXR/WebXRController.js.map +0 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
const spyFunctions = {
|
|
2
|
+
constructorSpy: null,
|
|
3
|
+
openSpy: null,
|
|
4
|
+
errorSpy: null,
|
|
5
|
+
closeSpy: null,
|
|
6
|
+
messageSpy: null,
|
|
7
|
+
messageBinarySpy: null,
|
|
8
|
+
sendSpy: null
|
|
9
|
+
};
|
|
10
|
+
const triggerFunctions = {
|
|
11
|
+
triggerOnOpen: null,
|
|
12
|
+
triggerOnError: null,
|
|
13
|
+
triggerOnClose: null,
|
|
14
|
+
triggerOnMessage: null,
|
|
15
|
+
triggerOnMessageBinary: null,
|
|
16
|
+
triggerRemoteClose: null
|
|
17
|
+
};
|
|
18
|
+
export class MockWebSocketImpl extends WebSocket {
|
|
19
|
+
constructor(url, protocols) {
|
|
20
|
+
var _a;
|
|
21
|
+
super(url, protocols);
|
|
22
|
+
this._readyState = this.OPEN;
|
|
23
|
+
(_a = spyFunctions.constructorSpy) === null || _a === void 0 ? void 0 : _a.call(spyFunctions, this.url);
|
|
24
|
+
triggerFunctions.triggerOnOpen = this.triggerOnOpen.bind(this);
|
|
25
|
+
triggerFunctions.triggerOnError = this.triggerOnError.bind(this);
|
|
26
|
+
triggerFunctions.triggerOnClose = this.triggerOnClose.bind(this);
|
|
27
|
+
triggerFunctions.triggerOnMessage = this.triggerOnMessage.bind(this);
|
|
28
|
+
triggerFunctions.triggerOnMessageBinary = this.triggerOnMessageBinary.bind(this);
|
|
29
|
+
triggerFunctions.triggerRemoteClose = this.triggerRemoteClose.bind(this);
|
|
30
|
+
}
|
|
31
|
+
get readyState() {
|
|
32
|
+
return this._readyState;
|
|
33
|
+
}
|
|
34
|
+
close(code, reason) {
|
|
35
|
+
super.close(code, reason);
|
|
36
|
+
this._readyState = this.CLOSED;
|
|
37
|
+
this.triggerOnClose({ code, reason });
|
|
38
|
+
}
|
|
39
|
+
send(data) {
|
|
40
|
+
var _a;
|
|
41
|
+
(_a = spyFunctions.sendSpy) === null || _a === void 0 ? void 0 : _a.call(spyFunctions, data);
|
|
42
|
+
}
|
|
43
|
+
triggerOnOpen() {
|
|
44
|
+
var _a, _b;
|
|
45
|
+
const event = new Event('open');
|
|
46
|
+
(_a = this.onopen) === null || _a === void 0 ? void 0 : _a.call(this, event);
|
|
47
|
+
(_b = spyFunctions.openSpy) === null || _b === void 0 ? void 0 : _b.call(spyFunctions, event);
|
|
48
|
+
}
|
|
49
|
+
triggerOnError() {
|
|
50
|
+
var _a, _b;
|
|
51
|
+
const event = new Event('error');
|
|
52
|
+
(_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, event);
|
|
53
|
+
(_b = spyFunctions.errorSpy) === null || _b === void 0 ? void 0 : _b.call(spyFunctions, event);
|
|
54
|
+
}
|
|
55
|
+
triggerOnClose(closeReason) {
|
|
56
|
+
var _a, _b;
|
|
57
|
+
const reason = closeReason !== null && closeReason !== void 0 ? closeReason : { code: 1, reason: 'mock reason' };
|
|
58
|
+
const event = new CloseEvent('close', reason);
|
|
59
|
+
(_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this, event);
|
|
60
|
+
(_b = spyFunctions.closeSpy) === null || _b === void 0 ? void 0 : _b.call(spyFunctions, event);
|
|
61
|
+
}
|
|
62
|
+
triggerRemoteClose(code, reason) {
|
|
63
|
+
this.close(code, reason);
|
|
64
|
+
}
|
|
65
|
+
triggerOnMessage(message) {
|
|
66
|
+
var _a, _b;
|
|
67
|
+
const data = JSON.stringify(message);
|
|
68
|
+
const event = new MessageEvent('message', { data });
|
|
69
|
+
(_a = this.onmessage) === null || _a === void 0 ? void 0 : _a.call(this, event);
|
|
70
|
+
(_b = spyFunctions.messageSpy) === null || _b === void 0 ? void 0 : _b.call(spyFunctions, event);
|
|
71
|
+
}
|
|
72
|
+
triggerOnMessageBinary(message) {
|
|
73
|
+
var _a, _b;
|
|
74
|
+
const data = message !== null && message !== void 0 ? message : new Blob([JSON.stringify({ type: 'test' })], {
|
|
75
|
+
type: 'application/json'
|
|
76
|
+
});
|
|
77
|
+
const event = new MessageEvent('messagebinary', { data });
|
|
78
|
+
(_a = this.onmessagebinary) === null || _a === void 0 ? void 0 : _a.call(this, event);
|
|
79
|
+
(_b = spyFunctions.messageBinarySpy) === null || _b === void 0 ? void 0 : _b.call(spyFunctions, event);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
const originalWebSocket = WebSocket;
|
|
83
|
+
export const mockWebSocket = () => {
|
|
84
|
+
spyFunctions.constructorSpy = jest.fn();
|
|
85
|
+
spyFunctions.openSpy = jest.fn();
|
|
86
|
+
spyFunctions.errorSpy = jest.fn();
|
|
87
|
+
spyFunctions.closeSpy = jest.fn();
|
|
88
|
+
spyFunctions.messageSpy = jest.fn();
|
|
89
|
+
spyFunctions.messageBinarySpy = jest.fn();
|
|
90
|
+
spyFunctions.sendSpy = jest.fn();
|
|
91
|
+
global.WebSocket = MockWebSocketImpl;
|
|
92
|
+
return [spyFunctions, triggerFunctions];
|
|
93
|
+
};
|
|
94
|
+
export const unmockWebSocket = () => {
|
|
95
|
+
global.WebSocket = originalWebSocket;
|
|
96
|
+
spyFunctions.constructorSpy = null;
|
|
97
|
+
spyFunctions.openSpy = null;
|
|
98
|
+
spyFunctions.errorSpy = null;
|
|
99
|
+
spyFunctions.closeSpy = null;
|
|
100
|
+
spyFunctions.messageSpy = null;
|
|
101
|
+
spyFunctions.messageBinarySpy = null;
|
|
102
|
+
};
|
|
103
|
+
//# sourceMappingURL=mockWebSocket.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mockWebSocket.js","sourceRoot":"","sources":["../../../src/__test__/mockWebSocket.ts"],"names":[],"mappings":"AAqBA,MAAM,YAAY,GAA8B;IAC5C,cAAc,EAAE,IAAI;IACpB,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE,IAAI;IAChB,gBAAgB,EAAE,IAAI;IACtB,OAAO,EAAE,IAAI;CAChB,CAAC;AAEF,MAAM,gBAAgB,GAAkC;IACpD,aAAa,EAAE,IAAI;IACnB,cAAc,EAAE,IAAI;IACpB,cAAc,EAAE,IAAI;IACpB,gBAAgB,EAAE,IAAI;IACtB,sBAAsB,EAAE,IAAI;IAC5B,kBAAkB,EAAE,IAAI;CAC3B,CAAC;AAEF,MAAM,OAAO,iBAAkB,SAAQ,SAAS;IAG5C,YAAY,GAAiB,EAAE,SAA6B;;QACxD,KAAK,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC;QAC7B,MAAA,YAAY,CAAC,cAAc,6DAAG,IAAI,CAAC,GAAG,CAAC,CAAC;QACxC,gBAAgB,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/D,gBAAgB,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjE,gBAAgB,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC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EAAE,EAAE,CAAC;IACjC,YAAY,CAAC,QAAQ,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IAClC,YAAY,CAAC,QAAQ,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IAClC,YAAY,CAAC,UAAU,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IACpC,YAAY,CAAC,gBAAgB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IAC1C,YAAY,CAAC,OAAO,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IACjC,MAAM,CAAC,SAAS,GAAG,iBAAiB,CAAC;IACrC,OAAO,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC;AAC5C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE;IAChC,MAAM,CAAC,SAAS,GAAG,iBAAiB,CAAC;IACrC,YAAY,CAAC,cAAc,GAAG,IAAI,CAAC;IACnC,YAAY,CAAC,OAAO,GAAG,IAAI,CAAC;IAC5B,YAAY,CAAC,QAAQ,GAAG,IAAI,CAAC;IAC7B,YAAY,CAAC,QAAQ,GAAG,IAAI,CAAC;IAC7B,YAAY,CAAC,UAAU,GAAG,IAAI,CAAC;IAC/B,YAAY,CAAC,gBAAgB,GAAG,IAAI,CAAC;AACzC,CAAC,CAAC"}
|
|
@@ -18,7 +18,8 @@ export { CandidatePairStats } from './PeerConnectionController/CandidatePairStat
|
|
|
18
18
|
export { CandidateStat } from './PeerConnectionController/CandidateStat';
|
|
19
19
|
export { DataChannelStats } from './PeerConnectionController/DataChannelStats';
|
|
20
20
|
export { InboundAudioStats, InboundVideoStats } from './PeerConnectionController/InboundRTPStats';
|
|
21
|
-
export {
|
|
21
|
+
export { OutboundRTPStats, RemoteOutboundRTPStats } from './PeerConnectionController/OutBoundRTPStats';
|
|
22
|
+
export * from './PeerConnectionController/LatencyCalculator';
|
|
22
23
|
export * from './DataChannel/DataChannelLatencyTestResults';
|
|
23
24
|
export * from './Util/EventEmitter';
|
|
24
25
|
export * from '@epicgames-ps/lib-pixelstreamingcommon-ue5.5';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pixelstreamingfrontend.js","sourceRoot":"","sources":["../../src/pixelstreamingfrontend.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAElD,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,cAAc,EAA2B,MAAM,iCAAiC,CAAC;AAC1F,OAAO,EAAE,aAAa,IAAI,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,cAAc,+BAA+B,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAClG,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"pixelstreamingfrontend.js","sourceRoot":"","sources":["../../src/pixelstreamingfrontend.ts"],"names":[],"m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er: "WaitForStreamer";
|
|
30
30
|
static HideUI: "HideUI";
|
|
31
|
+
static EnableCaptureTimeExt: "EnableCaptureTimeExt";
|
|
31
32
|
}
|
|
32
33
|
export type FlagsKeys = Exclude<keyof typeof Flags, 'prototype'>;
|
|
33
34
|
export type FlagsIds = (typeof Flags)[FlagsKeys];
|
|
@@ -50,6 +51,7 @@ export declare class NumericParameters {
|
|
|
50
51
|
static WebRTCMaxBitrate: "WebRTCMaxBitrate";
|
|
51
52
|
static MaxReconnectAttempts: "MaxReconnectAttempts";
|
|
52
53
|
static StreamerAutoJoinInterval: "StreamerAutoJoinInterval";
|
|
54
|
+
static KeepaliveDelay: "KeepaliveDelay";
|
|
53
55
|
}
|
|
54
56
|
export type NumericParametersKeys = Exclude<keyof typeof NumericParameters, 'prototype'>;
|
|
55
57
|
export type NumericParametersIds = (typeof NumericParameters)[NumericParametersKeys];
|
|
@@ -3,18 +3,24 @@ import { InboundTrackStats } from './InboundTrackStats';
|
|
|
3
3
|
import { DataChannelStats } from './DataChannelStats';
|
|
4
4
|
import { CandidateStat } from './CandidateStat';
|
|
5
5
|
import { CandidatePairStats } from './CandidatePairStats';
|
|
6
|
-
import {
|
|
6
|
+
import { RemoteOutboundRTPStats, OutboundRTPStats } from './OutBoundRTPStats';
|
|
7
7
|
import { SessionStats } from './SessionStats';
|
|
8
8
|
import { StreamStats } from './StreamStats';
|
|
9
9
|
import { CodecStats } from './CodecStats';
|
|
10
|
+
/**
|
|
11
|
+
* The Aggregated Stats that is generated from the RTC Stats Report
|
|
12
|
+
*/
|
|
10
13
|
export declare class AggregatedStats {
|
|
11
14
|
inboundVideoStats: InboundVideoStats;
|
|
12
15
|
inboundAudioStats: InboundAudioStats;
|
|
13
16
|
candidatePairs: Array<CandidatePairStats>;
|
|
14
|
-
|
|
17
|
+
datachannelStats: DataChannelStats;
|
|
15
18
|
localCandidates: Array<CandidateStat>;
|
|
16
19
|
remoteCandidates: Array<CandidateStat>;
|
|
17
|
-
|
|
20
|
+
outboundVideoStats: OutboundRTPStats;
|
|
21
|
+
outboundAudioStats: OutboundRTPStats;
|
|
22
|
+
remoteOutboundVideoStats: RemoteOutboundRTPStats;
|
|
23
|
+
remoteOutboundAudioStats: RemoteOutboundRTPStats;
|
|
18
24
|
sessionStats: SessionStats;
|
|
19
25
|
streamStats: StreamStats;
|
|
20
26
|
codecs: Map<string, CodecStats>;
|
|
@@ -55,12 +61,17 @@ export declare class AggregatedStats {
|
|
|
55
61
|
* Process the Inbound RTP Audio and Video Data
|
|
56
62
|
* @param stat - inbound rtp stats
|
|
57
63
|
*/
|
|
58
|
-
|
|
64
|
+
handleInboundRTP(stat: InboundRTPStats): void;
|
|
59
65
|
/**
|
|
60
|
-
* Process the outbound RTP Audio and Video
|
|
61
|
-
* @param stat -
|
|
66
|
+
* Process the "local" outbound RTP Audio and Video stats.
|
|
67
|
+
* @param stat - local outbound rtp stats
|
|
62
68
|
*/
|
|
63
|
-
|
|
69
|
+
handleLocalOutbound(stat: OutboundRTPStats): void;
|
|
70
|
+
/**
|
|
71
|
+
* Process the "remote" outbound RTP Audio and Video stats.
|
|
72
|
+
* @param stat - remote outbound rtp stats
|
|
73
|
+
*/
|
|
74
|
+
handleRemoteOutbound(stat: RemoteOutboundRTPStats): void;
|
|
64
75
|
/**
|
|
65
76
|
* Process the Inbound Video Track Data
|
|
66
77
|
* @param stat - video track stats
|
|
@@ -2,140 +2,143 @@
|
|
|
2
2
|
* Inbound Audio Stats collected from the RTC Stats Report
|
|
3
3
|
*/
|
|
4
4
|
export declare class InboundAudioStats {
|
|
5
|
-
audioLevel: number;
|
|
5
|
+
audioLevel: number | undefined;
|
|
6
6
|
bytesReceived: number;
|
|
7
7
|
codecId: string;
|
|
8
|
-
concealedSamples: number;
|
|
9
|
-
concealmentEvents: number;
|
|
10
|
-
fecPacketsDiscarded: number;
|
|
11
|
-
fecPacketsReceived: number;
|
|
8
|
+
concealedSamples: number | undefined;
|
|
9
|
+
concealmentEvents: number | undefined;
|
|
10
|
+
fecPacketsDiscarded: number | undefined;
|
|
11
|
+
fecPacketsReceived: number | undefined;
|
|
12
12
|
headerBytesReceived: number;
|
|
13
13
|
id: string;
|
|
14
|
-
insertedSamplesForDeceleration: number;
|
|
14
|
+
insertedSamplesForDeceleration: number | undefined;
|
|
15
15
|
jitter: number;
|
|
16
16
|
jitterBufferDelay: number;
|
|
17
17
|
jitterBufferEmittedCount: number;
|
|
18
|
-
jitterBufferMinimumDelay: number;
|
|
19
|
-
jitterBufferTargetDelay: number;
|
|
18
|
+
jitterBufferMinimumDelay: number | undefined;
|
|
19
|
+
jitterBufferTargetDelay: number | undefined;
|
|
20
20
|
kind: string;
|
|
21
21
|
lastPacketReceivedTimestamp: number;
|
|
22
|
-
mediaType: string;
|
|
22
|
+
mediaType: string | undefined;
|
|
23
23
|
mid: string;
|
|
24
|
-
packetsDiscarded: number;
|
|
24
|
+
packetsDiscarded: number | undefined;
|
|
25
25
|
packetsLost: number;
|
|
26
26
|
packetsReceived: number;
|
|
27
|
-
removedSamplesForAcceleration: number;
|
|
28
|
-
silentConcealedSamples: number;
|
|
27
|
+
removedSamplesForAcceleration: number | undefined;
|
|
28
|
+
silentConcealedSamples: number | undefined;
|
|
29
29
|
ssrc: number;
|
|
30
30
|
timestamp: number;
|
|
31
|
-
totalAudioEnergy: number;
|
|
32
|
-
totalSamplesDuration: number;
|
|
33
|
-
totalSamplesReceived: number;
|
|
34
|
-
trackIdentifier: string;
|
|
35
|
-
transportId: string;
|
|
31
|
+
totalAudioEnergy: number | undefined;
|
|
32
|
+
totalSamplesDuration: number | undefined;
|
|
33
|
+
totalSamplesReceived: number | undefined;
|
|
34
|
+
trackIdentifier: string | undefined;
|
|
35
|
+
transportId: string | undefined;
|
|
36
36
|
type: string;
|
|
37
|
-
bitrate: number;
|
|
37
|
+
bitrate: number | undefined;
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
40
|
* Inbound Video Stats collected from the RTC Stats Report
|
|
41
41
|
*/
|
|
42
42
|
export declare class InboundVideoStats {
|
|
43
43
|
bytesReceived: number;
|
|
44
|
-
codecId: string;
|
|
45
|
-
firCount: number;
|
|
46
|
-
frameHeight: number;
|
|
47
|
-
frameWidth: number;
|
|
48
|
-
framesAssembledFromMultiplePackets: number;
|
|
49
|
-
framesDecoded: number;
|
|
50
|
-
framesDropped: number;
|
|
51
|
-
framesPerSecond: number;
|
|
52
|
-
framesReceived: number;
|
|
53
|
-
freezeCount: number;
|
|
54
|
-
googTimingFrameInfo: string;
|
|
44
|
+
codecId: string | undefined;
|
|
45
|
+
firCount: number | undefined;
|
|
46
|
+
frameHeight: number | undefined;
|
|
47
|
+
frameWidth: number | undefined;
|
|
48
|
+
framesAssembledFromMultiplePackets: number | undefined;
|
|
49
|
+
framesDecoded: number | undefined;
|
|
50
|
+
framesDropped: number | undefined;
|
|
51
|
+
framesPerSecond: number | undefined;
|
|
52
|
+
framesReceived: number | undefined;
|
|
53
|
+
freezeCount: number | undefined;
|
|
54
|
+
googTimingFrameInfo: string | undefined;
|
|
55
55
|
headerBytesReceived: number;
|
|
56
56
|
id: string;
|
|
57
57
|
jitter: number;
|
|
58
58
|
jitterBufferDelay: number;
|
|
59
59
|
jitterBufferEmittedCount: number;
|
|
60
|
-
keyFramesDecoded: number;
|
|
60
|
+
keyFramesDecoded: number | undefined;
|
|
61
61
|
kind: string;
|
|
62
|
-
lastPacketReceivedTimestamp: number;
|
|
63
|
-
mediaType: string;
|
|
62
|
+
lastPacketReceivedTimestamp: number | undefined;
|
|
63
|
+
mediaType: string | undefined;
|
|
64
64
|
mid: string;
|
|
65
|
-
nackCount: number;
|
|
65
|
+
nackCount: number | undefined;
|
|
66
66
|
packetsLost: number;
|
|
67
67
|
packetsReceived: number;
|
|
68
|
-
pauseCount: number;
|
|
69
|
-
pliCount: number;
|
|
68
|
+
pauseCount: number | undefined;
|
|
69
|
+
pliCount: number | undefined;
|
|
70
70
|
ssrc: number;
|
|
71
71
|
timestamp: number;
|
|
72
|
-
totalAssemblyTime: number;
|
|
73
|
-
totalDecodeTime: number;
|
|
74
|
-
totalFreezesDuration: number;
|
|
75
|
-
totalInterFrameDelay: number;
|
|
76
|
-
totalPausesDuration: number;
|
|
77
|
-
totalProcessingDelay: number;
|
|
78
|
-
totalSquaredInterFrameDelay: number;
|
|
79
|
-
trackIdentifier: string;
|
|
80
|
-
transportId: string;
|
|
72
|
+
totalAssemblyTime: number | undefined;
|
|
73
|
+
totalDecodeTime: number | undefined;
|
|
74
|
+
totalFreezesDuration: number | undefined;
|
|
75
|
+
totalInterFrameDelay: number | undefined;
|
|
76
|
+
totalPausesDuration: number | undefined;
|
|
77
|
+
totalProcessingDelay: number | undefined;
|
|
78
|
+
totalSquaredInterFrameDelay: number | undefined;
|
|
79
|
+
trackIdentifier: string | undefined;
|
|
80
|
+
transportId: string | undefined;
|
|
81
81
|
type: string;
|
|
82
|
-
bitrate: number;
|
|
82
|
+
bitrate: number | undefined;
|
|
83
83
|
}
|
|
84
84
|
/**
|
|
85
85
|
* Inbound Stats collected from the RTC Stats Report
|
|
86
86
|
*/
|
|
87
87
|
export declare class InboundRTPStats {
|
|
88
88
|
bytesReceived: number;
|
|
89
|
-
codecId: string;
|
|
89
|
+
codecId: string | undefined;
|
|
90
90
|
headerBytesReceived: number;
|
|
91
91
|
id: string;
|
|
92
92
|
jitter: number;
|
|
93
93
|
jitterBufferDelay: number;
|
|
94
94
|
jitterBufferEmittedCount: number;
|
|
95
95
|
kind: string;
|
|
96
|
-
lastPacketReceivedTimestamp: number;
|
|
97
|
-
mediaType: string;
|
|
96
|
+
lastPacketReceivedTimestamp: number | undefined;
|
|
97
|
+
mediaType: string | undefined;
|
|
98
98
|
mid: string;
|
|
99
99
|
packetsLost: number;
|
|
100
100
|
packetsReceived: number;
|
|
101
|
+
playoutId: string | undefined;
|
|
102
|
+
qpsum: number | undefined;
|
|
103
|
+
remoteId: string | undefined;
|
|
101
104
|
ssrc: number;
|
|
102
105
|
timestamp: number;
|
|
103
|
-
trackIdentifier: string;
|
|
104
|
-
transportId: string;
|
|
106
|
+
trackIdentifier: string | undefined;
|
|
107
|
+
transportId: string | undefined;
|
|
105
108
|
type: string;
|
|
106
|
-
audioLevel: number;
|
|
107
|
-
concealedSamples: number;
|
|
108
|
-
concealmentEvents: number;
|
|
109
|
-
fecPacketsDiscarded: number;
|
|
110
|
-
fecPacketsReceived: number;
|
|
111
|
-
insertedSamplesForDeceleration: number;
|
|
112
|
-
jitterBufferMinimumDelay: number;
|
|
113
|
-
jitterBufferTargetDelay: number;
|
|
114
|
-
packetsDiscarded: number;
|
|
115
|
-
removedSamplesForAcceleration: number;
|
|
116
|
-
silentConcealedSamples: number;
|
|
117
|
-
totalAudioEnergy: number;
|
|
118
|
-
totalSamplesDuration: number;
|
|
119
|
-
totalSamplesReceived: number;
|
|
120
|
-
firCount: number;
|
|
121
|
-
frameHeight: number;
|
|
122
|
-
frameWidth: number;
|
|
123
|
-
framesAssembledFromMultiplePackets: number;
|
|
124
|
-
framesDecoded: number;
|
|
125
|
-
framesDropped: number;
|
|
126
|
-
framesPerSecond: number;
|
|
127
|
-
framesReceived: number;
|
|
128
|
-
freezeCount: number;
|
|
129
|
-
googTimingFrameInfo: string;
|
|
130
|
-
keyFramesDecoded: number;
|
|
131
|
-
nackCount: number;
|
|
132
|
-
pauseCount: number;
|
|
133
|
-
pliCount: number;
|
|
134
|
-
totalAssemblyTime: number;
|
|
135
|
-
totalDecodeTime: number;
|
|
136
|
-
totalFreezesDuration: number;
|
|
137
|
-
totalInterFrameDelay: number;
|
|
138
|
-
totalPausesDuration: number;
|
|
139
|
-
totalProcessingDelay: number;
|
|
140
|
-
totalSquaredInterFrameDelay: number;
|
|
109
|
+
audioLevel: number | undefined;
|
|
110
|
+
concealedSamples: number | undefined;
|
|
111
|
+
concealmentEvents: number | undefined;
|
|
112
|
+
fecPacketsDiscarded: number | undefined;
|
|
113
|
+
fecPacketsReceived: number | undefined;
|
|
114
|
+
insertedSamplesForDeceleration: number | undefined;
|
|
115
|
+
jitterBufferMinimumDelay: number | undefined;
|
|
116
|
+
jitterBufferTargetDelay: number | undefined;
|
|
117
|
+
packetsDiscarded: number | undefined;
|
|
118
|
+
removedSamplesForAcceleration: number | undefined;
|
|
119
|
+
silentConcealedSamples: number | undefined;
|
|
120
|
+
totalAudioEnergy: number | undefined;
|
|
121
|
+
totalSamplesDuration: number | undefined;
|
|
122
|
+
totalSamplesReceived: number | undefined;
|
|
123
|
+
firCount: number | undefined;
|
|
124
|
+
frameHeight: number | undefined;
|
|
125
|
+
frameWidth: number | undefined;
|
|
126
|
+
framesAssembledFromMultiplePackets: number | undefined;
|
|
127
|
+
framesDecoded: number | undefined;
|
|
128
|
+
framesDropped: number | undefined;
|
|
129
|
+
framesPerSecond: number | undefined;
|
|
130
|
+
framesReceived: number | undefined;
|
|
131
|
+
freezeCount: number | undefined;
|
|
132
|
+
googTimingFrameInfo: string | undefined;
|
|
133
|
+
keyFramesDecoded: number | undefined;
|
|
134
|
+
nackCount: number | undefined;
|
|
135
|
+
pauseCount: number | undefined;
|
|
136
|
+
pliCount: number | undefined;
|
|
137
|
+
totalAssemblyTime: number | undefined;
|
|
138
|
+
totalDecodeTime: number | undefined;
|
|
139
|
+
totalFreezesDuration: number | undefined;
|
|
140
|
+
totalInterFrameDelay: number | undefined;
|
|
141
|
+
totalPausesDuration: number | undefined;
|
|
142
|
+
totalProcessingDelay: number | undefined;
|
|
143
|
+
totalSquaredInterFrameDelay: number | undefined;
|
|
141
144
|
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { AggregatedStats } from './AggregatedStats';
|
|
2
|
+
/**
|
|
3
|
+
* FrameTimingInfo is a Chromium-specific set of WebRTC stats useful for latency calculation. It is stored in WebRTC stats as `googTimingFrameInfo`.
|
|
4
|
+
* It is defined as an RTP header extension here: https://webrtc.googlesource.com/src/+/refs/heads/main/docs/native-code/rtp-hdrext/video-timing/README.md
|
|
5
|
+
* It is defined in source code here: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/video/video_timing.cc;l=82;drc=8d399817282e3c12ed54eb23ec42a5e418298ec6
|
|
6
|
+
* It is discussed by its author here: https://github.com/w3c/webrtc-provisional-stats/issues/40#issuecomment-1272916692
|
|
7
|
+
* In summary it a comma-delimited string that contains the following (in this order):
|
|
8
|
+
* 1) RTP timestamp: the RTP timestamp of the frame
|
|
9
|
+
* 2) Capture time: timestamp when this frame was captured
|
|
10
|
+
* 3) Encode start: timestamp when this frame started to be encoded
|
|
11
|
+
* 4) Encode finish: timestamp when this frame finished encoding
|
|
12
|
+
* 5) Packetization finish: timestamp when this frame was split into packets and was ready to be sent over the network
|
|
13
|
+
* 6) Pacer exit: timestamp when last packet of this frame was sent over the network by the sender at this timestamp
|
|
14
|
+
* 7) Network timestamp1: place for the SFU to mark when the frame started being forwarded. Application specific.
|
|
15
|
+
* 8) Network timestamp2: place for the SFU to mark when the frame finished being forwarded. Application specific.
|
|
16
|
+
* 9) Receive start: timestamp when the first packet of this frame was received
|
|
17
|
+
* 10) Receive finish: timestamp when the last packet of this frame was received
|
|
18
|
+
* 11) Decode start: timestamp when the frame was passed to decoder
|
|
19
|
+
* 12) Decode finish: timestamp when the frame was decoded
|
|
20
|
+
* 13) Render time: timestamp of the projected render time for this frame
|
|
21
|
+
* 14) "is outlier": a flag for if this frame is bigger in encoded size than the average frame by at least 5x.
|
|
22
|
+
* 15) "triggered by timer": a flag for if this report was triggered by the timer (The report is sent every 200ms)
|
|
23
|
+
*/
|
|
24
|
+
export declare class FrameTimingInfo {
|
|
25
|
+
rtpTimestamp: number;
|
|
26
|
+
captureTimestamp: number;
|
|
27
|
+
encodeStartTimestamp: number;
|
|
28
|
+
encodeFinishTimestamp: number;
|
|
29
|
+
packetizerFinishTimestamp: number;
|
|
30
|
+
pacerExitTimestamp: number;
|
|
31
|
+
networkTimestamp1: number;
|
|
32
|
+
networkTimestamp2: number;
|
|
33
|
+
receiveStart: number;
|
|
34
|
+
receiveFinish: number;
|
|
35
|
+
decodeStart: number;
|
|
36
|
+
decodeFinish: number;
|
|
37
|
+
renderTime: number;
|
|
38
|
+
isOutlier: boolean;
|
|
39
|
+
isTriggeredByTimer: boolean;
|
|
40
|
+
encoderLatencyMs: number;
|
|
41
|
+
packetizeLatencyMs: number;
|
|
42
|
+
pacerLatencyMs: number;
|
|
43
|
+
captureToSendLatencyMs: number;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Calculates a combination of latency statistics using purely WebRTC API.
|
|
47
|
+
*/
|
|
48
|
+
export declare class LatencyCalculator {
|
|
49
|
+
private latestSenderRecvClockOffset;
|
|
50
|
+
calculate(stats: AggregatedStats, receivers: RTCRtpReceiver[]): LatencyInfo;
|
|
51
|
+
private extractFrameTimingInfo;
|
|
52
|
+
private calculateSenderLatency;
|
|
53
|
+
/**
|
|
54
|
+
* Find the first valid ssrc or csrc that has capture time fields present from abs-capture-time header extension.
|
|
55
|
+
* @param receivers The RTP receviers this peer connection has.
|
|
56
|
+
* @returns A single valid ssrc or csrc that has capture time fields or null if there is none (e.g. in non-chromium browsers it will be null).
|
|
57
|
+
*/
|
|
58
|
+
private getCaptureSource;
|
|
59
|
+
private calculateSenderReceiverClockOffset;
|
|
60
|
+
private getRTTMs;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* A collection of latency information calculated using the WebRTC API.
|
|
64
|
+
* Most stats are calculated following the spec:
|
|
65
|
+
* https://w3c.github.io/webrtc-stats/#dictionary-rtcinboundrtpstreamstats-members
|
|
66
|
+
*/
|
|
67
|
+
export declare class LatencyInfo {
|
|
68
|
+
/**
|
|
69
|
+
* The time taken from the moment a frame is done capturing to the moment it is sent over the network.
|
|
70
|
+
* Note: This can only be calculated if both offer and answer contain the
|
|
71
|
+
* the RTP header extension for `video-timing` (Chrome only for now)
|
|
72
|
+
*/
|
|
73
|
+
senderLatencyMs: number | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* The time taken from the moment a frame is done capturing to the moment it is sent over the network.
|
|
76
|
+
* Note: This can only be calculated if both offer and answer contain the
|
|
77
|
+
* the RTP header extension for `abs-capture-time` (Chrome only for now)
|
|
78
|
+
*/
|
|
79
|
+
senderLatencyAbsCaptureTimeMs: number | undefined;
|
|
80
|
+
rttMs: number | undefined;
|
|
81
|
+
averageProcessingDelayMs: number | undefined;
|
|
82
|
+
averageJitterBufferDelayMs: number | undefined;
|
|
83
|
+
averageDecodeLatencyMs: number | undefined;
|
|
84
|
+
averageAssemblyDelayMs: number | undefined;
|
|
85
|
+
averageE2ELatency: number | undefined;
|
|
86
|
+
frameTiming: FrameTimingInfo | undefined;
|
|
87
|
+
}
|
|
@@ -1,23 +1,57 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Outbound
|
|
2
|
+
* Outbound RTP stats collected from the RTC Stats Report under `outbound-rtp`.
|
|
3
|
+
* Wrapper around: https://developer.mozilla.org/en-US/docs/Web/API/RTCOutboundRtpStreamStats
|
|
4
|
+
* These are stats for video we are sending to a remote peer.
|
|
3
5
|
*/
|
|
4
|
-
export declare class
|
|
6
|
+
export declare class OutboundRTPStats {
|
|
7
|
+
active: boolean | undefined;
|
|
8
|
+
codecId: string | undefined;
|
|
5
9
|
bytesSent: number;
|
|
10
|
+
frameHeight: number | undefined;
|
|
11
|
+
frameWidth: number | undefined;
|
|
12
|
+
framesEncoded: number | undefined;
|
|
13
|
+
framesPerSecond: number | undefined;
|
|
14
|
+
framesSent: number | undefined;
|
|
15
|
+
headerBytesSent: number;
|
|
6
16
|
id: string;
|
|
7
|
-
|
|
17
|
+
keyFramesEncoded: number | undefined;
|
|
18
|
+
kind: string;
|
|
19
|
+
mediaSourceId: string | undefined;
|
|
20
|
+
mid: string | undefined;
|
|
21
|
+
nackCount: number | undefined;
|
|
8
22
|
packetsSent: number;
|
|
9
|
-
|
|
23
|
+
qpSum: number | undefined;
|
|
24
|
+
qualityLimitationDurations: number | undefined;
|
|
25
|
+
qualityLimitationReason: string | undefined;
|
|
26
|
+
remoteId: string | undefined;
|
|
27
|
+
retransmittedBytesSent: number;
|
|
28
|
+
rid: string | undefined;
|
|
29
|
+
scalabilityMode: string | undefined;
|
|
30
|
+
ssrc: string;
|
|
31
|
+
targetBitrate: number | undefined;
|
|
10
32
|
timestamp: number;
|
|
33
|
+
totalEncodeTime: number | undefined;
|
|
34
|
+
totalEncodeBytesTarget: number | undefined;
|
|
35
|
+
totalPacketSendDelay: number | undefined;
|
|
36
|
+
transportId: string | undefined;
|
|
11
37
|
}
|
|
12
38
|
/**
|
|
13
|
-
*
|
|
39
|
+
* Remote outbound stats collected from the RTC Stats Report under `remote-outbound-rtp`.
|
|
40
|
+
* Wrapper around: https://developer.mozilla.org/en-US/docs/Web/API/RTCRemoteOutboundRtpStreamStats
|
|
41
|
+
* These are stats for media we are receiving from a remote peer.
|
|
14
42
|
*/
|
|
15
|
-
export declare class
|
|
43
|
+
export declare class RemoteOutboundRTPStats {
|
|
44
|
+
bytesSent: number | undefined;
|
|
45
|
+
codecId: string;
|
|
46
|
+
id: string | undefined;
|
|
16
47
|
kind: string;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
48
|
+
localId: string | undefined;
|
|
49
|
+
packetsSent: number | undefined;
|
|
50
|
+
remoteTimestamp: number | undefined;
|
|
51
|
+
reportsSent: number | undefined;
|
|
52
|
+
roundTripTimeMeasurements: number | undefined;
|
|
53
|
+
ssrc: string;
|
|
54
|
+
timestamp: number | undefined;
|
|
55
|
+
totalRoundTripTime: number | undefined;
|
|
56
|
+
transportId: string | undefined;
|
|
23
57
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Config } from '../Config/Config';
|
|
2
2
|
import { AggregatedStats } from './AggregatedStats';
|
|
3
|
+
import { LatencyCalculator, LatencyInfo } from './LatencyCalculator';
|
|
4
|
+
export declare const kAbsCaptureTime = "http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time";
|
|
3
5
|
/**
|
|
4
6
|
* Handles the Peer Connection
|
|
5
7
|
*/
|
|
@@ -11,6 +13,7 @@ export declare class PeerConnectionController {
|
|
|
11
13
|
updateCodecSelection: boolean;
|
|
12
14
|
videoTrack: MediaStreamTrack;
|
|
13
15
|
audioTrack: MediaStreamTrack;
|
|
16
|
+
latencyCalculator: LatencyCalculator;
|
|
14
17
|
/**
|
|
15
18
|
* Create a new RTC Peer Connection client
|
|
16
19
|
* @param options - Peer connection Options
|
|
@@ -24,7 +27,7 @@ export declare class PeerConnectionController {
|
|
|
24
27
|
*/
|
|
25
28
|
createOffer(offerOptions: RTCOfferOptions, config: Config): Promise<void>;
|
|
26
29
|
/**
|
|
27
|
-
*
|
|
30
|
+
* Receive offer from UE side and process it as the remote description of this peer connection
|
|
28
31
|
*/
|
|
29
32
|
receiveOffer(offer: RTCSessionDescriptionInit, config: Config): Promise<void>;
|
|
30
33
|
/**
|
|
@@ -47,6 +50,7 @@ export declare class PeerConnectionController {
|
|
|
47
50
|
* @returns A modified Session Descriptor
|
|
48
51
|
*/
|
|
49
52
|
mungeSDP(sdp: string, useMic: boolean): string;
|
|
53
|
+
isFirefox(): boolean;
|
|
50
54
|
/**
|
|
51
55
|
* When a Ice Candidate is received add to the RTC Peer Connection
|
|
52
56
|
* @param iceCandidate - RTC Ice Candidate from the Signaling Server
|
|
@@ -121,16 +125,26 @@ export declare class PeerConnectionController {
|
|
|
121
125
|
* @param event - Aggregated Stats
|
|
122
126
|
*/
|
|
123
127
|
onVideoStats(event: AggregatedStats): void;
|
|
128
|
+
/**
|
|
129
|
+
* And override event for when latency info is calculated
|
|
130
|
+
* @param latencyInfo - Calculated latency information.
|
|
131
|
+
*/
|
|
132
|
+
onLatencyCalculated(latencyInfo: LatencyInfo): void;
|
|
124
133
|
/**
|
|
125
134
|
* Event to send the RTC offer to the Signaling server
|
|
126
135
|
* @param offer - RTC Offer
|
|
127
136
|
*/
|
|
128
137
|
onSendWebRTCOffer(offer: RTCSessionDescriptionInit): void;
|
|
129
138
|
/**
|
|
130
|
-
* Event
|
|
139
|
+
* Event fired when remote offer description is set.
|
|
140
|
+
* @param offer - RTC Offer
|
|
141
|
+
*/
|
|
142
|
+
onSetRemoteDescription(offer: RTCSessionDescriptionInit): void;
|
|
143
|
+
/**
|
|
144
|
+
* Event fire when local description answer is set.
|
|
131
145
|
* @param answer - RTC Answer
|
|
132
146
|
*/
|
|
133
|
-
|
|
147
|
+
onSetLocalDescription(answer: RTCSessionDescriptionInit): void;
|
|
134
148
|
/**
|
|
135
149
|
* An override for showing the Peer connection connecting Overlay
|
|
136
150
|
*/
|