@epicgames-ps/lib-pixelstreamingfrontend-ue5.5 0.3.0 → 0.3.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/dist/commonjs/AFK/AFKController.js +109 -109
- package/dist/commonjs/Config/Config.js +559 -559
- package/dist/commonjs/Config/SettingBase.js +98 -98
- package/dist/commonjs/Config/SettingFlag.js +49 -49
- package/dist/commonjs/Config/SettingNumber.js +83 -83
- package/dist/commonjs/Config/SettingOption.js +84 -84
- package/dist/commonjs/Config/SettingText.js +42 -42
- package/dist/commonjs/DataChannel/DataChannelController.js +106 -106
- package/dist/commonjs/DataChannel/DataChannelLatencyTestController.js +94 -94
- package/dist/commonjs/DataChannel/DataChannelLatencyTestResults.js +18 -18
- package/dist/commonjs/DataChannel/DataChannelSender.js +43 -43
- package/dist/commonjs/DataChannel/InitialSettings.js +41 -41
- package/dist/commonjs/DataChannel/LatencyTestResults.js +60 -60
- package/dist/commonjs/FreezeFrame/FreezeFrame.js +93 -93
- package/dist/commonjs/FreezeFrame/FreezeFrameController.js +95 -95
- package/dist/commonjs/Inputs/GamepadController.js +188 -188
- package/dist/commonjs/Inputs/GamepadTypes.js +21 -21
- package/dist/commonjs/Inputs/IInputController.js +2 -2
- package/dist/commonjs/Inputs/InputClassesFactory.js +96 -96
- package/dist/commonjs/Inputs/KeyCodes.js +112 -112
- package/dist/commonjs/Inputs/KeyboardController.js +137 -137
- package/dist/commonjs/Inputs/MouseButtons.js +28 -28
- package/dist/commonjs/Inputs/MouseController.js +97 -97
- package/dist/commonjs/Inputs/MouseControllerHovering.js +93 -93
- package/dist/commonjs/Inputs/MouseControllerLocked.js +153 -153
- package/dist/commonjs/Inputs/SpecialKeyCodes.js +19 -19
- package/dist/commonjs/Inputs/TouchController.js +123 -123
- package/dist/commonjs/Inputs/TouchControllerFake.js +91 -91
- package/dist/commonjs/Inputs/XRGamepadController.js +124 -124
- package/dist/commonjs/PeerConnectionController/AggregatedStats.js +252 -252
- package/dist/commonjs/PeerConnectionController/CandidatePairStats.js +10 -10
- package/dist/commonjs/PeerConnectionController/CandidateStat.js +10 -10
- package/dist/commonjs/PeerConnectionController/CodecStats.js +10 -10
- package/dist/commonjs/PeerConnectionController/DataChannelStats.js +10 -10
- package/dist/commonjs/PeerConnectionController/InboundRTPStats.js +22 -22
- package/dist/commonjs/PeerConnectionController/InboundTrackStats.js +10 -10
- package/dist/commonjs/PeerConnectionController/OutBoundRTPStats.js +16 -16
- package/dist/commonjs/PeerConnectionController/PeerConnectionController.js +584 -584
- package/dist/commonjs/PeerConnectionController/SessionStats.js +10 -10
- package/dist/commonjs/PeerConnectionController/StreamStats.js +10 -10
- package/dist/commonjs/PixelStreaming/PixelStreaming.js +607 -607
- package/dist/commonjs/UI/OnScreenKeyboard.js +82 -82
- package/dist/commonjs/UeInstanceMessage/ResponseController.js +38 -38
- package/dist/commonjs/UeInstanceMessage/SendMessageController.js +120 -120
- package/dist/commonjs/UeInstanceMessage/StreamMessageController.js +210 -210
- package/dist/commonjs/UeInstanceMessage/ToStreamerMessagesController.js +49 -49
- package/dist/commonjs/Util/EventEmitter.js +386 -386
- package/dist/commonjs/Util/FileUtil.js +108 -108
- package/dist/commonjs/Util/IURLSearchParams.js +25 -25
- package/dist/commonjs/Util/InputCoordTranslator.js +49 -49
- package/dist/commonjs/Util/RTCUtils.js +40 -40
- package/dist/commonjs/VideoPlayer/StreamController.js +67 -67
- package/dist/commonjs/VideoPlayer/VideoPlayer.js +177 -177
- package/dist/commonjs/WebRtcPlayer/WebRtcPlayerController.js +1221 -1221
- package/dist/commonjs/WebXR/WebXRController.js +335 -335
- package/dist/commonjs/pixelstreamingfrontend.js +70 -70
- package/dist/esm/AFK/AFKController.js +105 -105
- package/dist/esm/Config/Config.js +551 -551
- package/dist/esm/Config/SettingBase.js +94 -94
- package/dist/esm/Config/SettingFlag.js +45 -45
- package/dist/esm/Config/SettingNumber.js +79 -79
- package/dist/esm/Config/SettingOption.js +80 -80
- package/dist/esm/Config/SettingText.js +38 -38
- package/dist/esm/DataChannel/DataChannelController.js +102 -102
- package/dist/esm/DataChannel/DataChannelLatencyTestController.js +90 -90
- package/dist/esm/DataChannel/DataChannelLatencyTestResults.js +14 -14
- package/dist/esm/DataChannel/DataChannelSender.js +39 -39
- package/dist/esm/DataChannel/InitialSettings.js +34 -34
- package/dist/esm/DataChannel/LatencyTestResults.js +56 -56
- package/dist/esm/FreezeFrame/FreezeFrame.js +89 -89
- package/dist/esm/FreezeFrame/FreezeFrameController.js +91 -91
- package/dist/esm/Inputs/GamepadController.js +184 -184
- package/dist/esm/Inputs/GamepadTypes.js +17 -17
- package/dist/esm/Inputs/IInputController.js +1 -1
- package/dist/esm/Inputs/InputClassesFactory.js +91 -91
- package/dist/esm/Inputs/KeyCodes.js +109 -109
- package/dist/esm/Inputs/KeyboardController.js +133 -133
- package/dist/esm/Inputs/MouseButtons.js +23 -23
- package/dist/esm/Inputs/MouseController.js +93 -93
- package/dist/esm/Inputs/MouseControllerHovering.js +89 -89
- package/dist/esm/Inputs/MouseControllerLocked.js +149 -149
- package/dist/esm/Inputs/SpecialKeyCodes.js +15 -15
- package/dist/esm/Inputs/TouchController.js +119 -119
- package/dist/esm/Inputs/TouchControllerFake.js +87 -87
- package/dist/esm/Inputs/XRGamepadController.js +120 -120
- package/dist/esm/PeerConnectionController/AggregatedStats.js +248 -248
- package/dist/esm/PeerConnectionController/CandidatePairStats.js +6 -6
- package/dist/esm/PeerConnectionController/CandidateStat.js +6 -6
- package/dist/esm/PeerConnectionController/CodecStats.js +6 -6
- package/dist/esm/PeerConnectionController/DataChannelStats.js +6 -6
- package/dist/esm/PeerConnectionController/InboundRTPStats.js +16 -16
- package/dist/esm/PeerConnectionController/InboundTrackStats.js +6 -6
- package/dist/esm/PeerConnectionController/OutBoundRTPStats.js +11 -11
- package/dist/esm/PeerConnectionController/PeerConnectionController.js +580 -580
- package/dist/esm/PeerConnectionController/SessionStats.js +6 -6
- package/dist/esm/PeerConnectionController/StreamStats.js +6 -6
- package/dist/esm/PixelStreaming/PixelStreaming.js +603 -603
- package/dist/esm/UI/OnScreenKeyboard.js +78 -78
- package/dist/esm/UeInstanceMessage/ResponseController.js +34 -34
- package/dist/esm/UeInstanceMessage/SendMessageController.js +116 -116
- package/dist/esm/UeInstanceMessage/StreamMessageController.js +205 -205
- package/dist/esm/UeInstanceMessage/ToStreamerMessagesController.js +45 -45
- package/dist/esm/Util/EventEmitter.js +345 -345
- package/dist/esm/Util/FileUtil.js +103 -103
- package/dist/esm/Util/IURLSearchParams.js +21 -21
- package/dist/esm/Util/InputCoordTranslator.js +45 -45
- package/dist/esm/Util/RTCUtils.js +36 -36
- package/dist/esm/VideoPlayer/StreamController.js +63 -63
- package/dist/esm/VideoPlayer/VideoPlayer.js +173 -173
- package/dist/esm/WebRtcPlayer/WebRtcPlayerController.js +1217 -1217
- package/dist/esm/WebXR/WebXRController.js +331 -331
- package/dist/esm/pixelstreamingfrontend.js +24 -24
- package/dist/types/AFK/AFKController.d.ts +38 -38
- package/dist/types/Config/Config.d.ts +220 -220
- package/dist/types/Config/SettingBase.d.ts +43 -43
- package/dist/types/Config/SettingFlag.d.ts +24 -24
- package/dist/types/Config/SettingNumber.d.ts +41 -41
- package/dist/types/Config/SettingOption.d.ts +41 -41
- package/dist/types/Config/SettingText.d.ts +21 -21
- package/dist/types/DataChannel/DataChannelController.d.ts +59 -59
- package/dist/types/DataChannel/DataChannelLatencyTestController.d.ts +25 -25
- package/dist/types/DataChannel/DataChannelLatencyTestResults.d.ts +46 -46
- package/dist/types/DataChannel/DataChannelSender.d.ts +21 -21
- package/dist/types/DataChannel/InitialSettings.d.ts +44 -44
- package/dist/types/DataChannel/LatencyTestResults.d.ts +31 -31
- package/dist/types/FreezeFrame/FreezeFrame.d.ts +36 -36
- package/dist/types/FreezeFrame/FreezeFrameController.d.ts +37 -37
- package/dist/types/Inputs/GamepadController.d.ts +61 -61
- package/dist/types/Inputs/GamepadTypes.d.ts +15 -15
- package/dist/types/Inputs/IInputController.d.ts +16 -16
- package/dist/types/Inputs/InputClassesFactory.d.ts +53 -53
- package/dist/types/Inputs/KeyCodes.d.ts +5 -5
- package/dist/types/Inputs/KeyboardController.d.ts +34 -34
- package/dist/types/Inputs/MouseButtons.d.ts +22 -22
- package/dist/types/Inputs/MouseController.d.ts +40 -40
- package/dist/types/Inputs/MouseControllerHovering.d.ts +26 -26
- package/dist/types/Inputs/MouseControllerLocked.d.ts +31 -31
- package/dist/types/Inputs/SpecialKeyCodes.d.ts +14 -14
- package/dist/types/Inputs/TouchController.d.ts +28 -28
- package/dist/types/Inputs/TouchControllerFake.d.ts +29 -29
- package/dist/types/Inputs/XRGamepadController.d.ts +15 -15
- package/dist/types/PeerConnectionController/AggregatedStats.d.ts +82 -82
- package/dist/types/PeerConnectionController/CandidatePairStats.d.ts +22 -22
- package/dist/types/PeerConnectionController/CandidateStat.d.ts +13 -13
- package/dist/types/PeerConnectionController/CodecStats.d.ts +14 -14
- package/dist/types/PeerConnectionController/DataChannelStats.d.ts +15 -15
- package/dist/types/PeerConnectionController/InboundRTPStats.d.ts +141 -141
- package/dist/types/PeerConnectionController/InboundTrackStats.d.ts +32 -32
- package/dist/types/PeerConnectionController/OutBoundRTPStats.d.ts +23 -23
- package/dist/types/PeerConnectionController/PeerConnectionController.d.ts +143 -143
- package/dist/types/PeerConnectionController/SessionStats.d.ts +8 -8
- package/dist/types/PeerConnectionController/StreamStats.d.ts +9 -9
- package/dist/types/PixelStreaming/PixelStreaming.d.ts +271 -271
- package/dist/types/UI/OnScreenKeyboard.d.ts +30 -30
- package/dist/types/UeInstanceMessage/ResponseController.d.ts +19 -19
- package/dist/types/UeInstanceMessage/SendMessageController.d.ts +18 -18
- package/dist/types/UeInstanceMessage/StreamMessageController.d.ts +29 -29
- package/dist/types/UeInstanceMessage/ToStreamerMessagesController.d.ts +32 -32
- package/dist/types/Util/EventEmitter.d.ts +429 -429
- package/dist/types/Util/FileUtil.d.ts +32 -32
- package/dist/types/Util/IURLSearchParams.d.ts +9 -9
- package/dist/types/Util/InputCoordTranslator.d.ts +29 -29
- package/dist/types/Util/RTCUtils.d.ts +8 -8
- package/dist/types/VideoPlayer/StreamController.d.ts +22 -22
- package/dist/types/VideoPlayer/VideoPlayer.d.ts +78 -78
- package/dist/types/WebRtcPlayer/WebRtcPlayerController.d.ts +379 -379
- package/dist/types/WebXR/WebXRController.d.ts +42 -42
- package/dist/types/pixelstreamingfrontend.d.ts +23 -23
- package/package.json +45 -45
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.WebRTCSettings = exports.EncoderSettings = exports.PixelStreamingSettings = exports.InitialSettings = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* Latency Test Results Data
|
|
7
|
-
*/
|
|
8
|
-
class InitialSettings {
|
|
9
|
-
constructor() {
|
|
10
|
-
this.PixelStreamingSettings = new PixelStreamingSettings();
|
|
11
|
-
this.EncoderSettings = new EncoderSettings();
|
|
12
|
-
this.WebRTCSettings = new WebRTCSettings();
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Checks for compatibility with the FPS and MaxFPS stats between 4.27 and 5
|
|
16
|
-
*/
|
|
17
|
-
ueCompatible() {
|
|
18
|
-
if (this.WebRTCSettings.MaxFPS != null) {
|
|
19
|
-
this.WebRTCSettings.FPS = this.WebRTCSettings.MaxFPS;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
exports.InitialSettings = InitialSettings;
|
|
24
|
-
/**
|
|
25
|
-
* A class for handling Pixel Streaming details
|
|
26
|
-
*/
|
|
27
|
-
class PixelStreamingSettings {
|
|
28
|
-
}
|
|
29
|
-
exports.PixelStreamingSettings = PixelStreamingSettings;
|
|
30
|
-
/**
|
|
31
|
-
* A class for handling encoder stats
|
|
32
|
-
*/
|
|
33
|
-
class EncoderSettings {
|
|
34
|
-
}
|
|
35
|
-
exports.EncoderSettings = EncoderSettings;
|
|
36
|
-
/**
|
|
37
|
-
* A class for handling web rtc stats
|
|
38
|
-
*/
|
|
39
|
-
class WebRTCSettings {
|
|
40
|
-
}
|
|
41
|
-
exports.WebRTCSettings = WebRTCSettings;
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.WebRTCSettings = exports.EncoderSettings = exports.PixelStreamingSettings = exports.InitialSettings = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Latency Test Results Data
|
|
7
|
+
*/
|
|
8
|
+
class InitialSettings {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.PixelStreamingSettings = new PixelStreamingSettings();
|
|
11
|
+
this.EncoderSettings = new EncoderSettings();
|
|
12
|
+
this.WebRTCSettings = new WebRTCSettings();
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Checks for compatibility with the FPS and MaxFPS stats between 4.27 and 5
|
|
16
|
+
*/
|
|
17
|
+
ueCompatible() {
|
|
18
|
+
if (this.WebRTCSettings.MaxFPS != null) {
|
|
19
|
+
this.WebRTCSettings.FPS = this.WebRTCSettings.MaxFPS;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.InitialSettings = InitialSettings;
|
|
24
|
+
/**
|
|
25
|
+
* A class for handling Pixel Streaming details
|
|
26
|
+
*/
|
|
27
|
+
class PixelStreamingSettings {
|
|
28
|
+
}
|
|
29
|
+
exports.PixelStreamingSettings = PixelStreamingSettings;
|
|
30
|
+
/**
|
|
31
|
+
* A class for handling encoder stats
|
|
32
|
+
*/
|
|
33
|
+
class EncoderSettings {
|
|
34
|
+
}
|
|
35
|
+
exports.EncoderSettings = EncoderSettings;
|
|
36
|
+
/**
|
|
37
|
+
* A class for handling web rtc stats
|
|
38
|
+
*/
|
|
39
|
+
class WebRTCSettings {
|
|
40
|
+
}
|
|
41
|
+
exports.WebRTCSettings = WebRTCSettings;
|
|
42
42
|
//# sourceMappingURL=InitialSettings.js.map
|
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.LatencyTestResults = void 0;
|
|
5
|
-
const lib_pixelstreamingcommon_ue5_5_1 = require("@epicgames-ps/lib-pixelstreamingcommon-ue5.5");
|
|
6
|
-
/**
|
|
7
|
-
* Latency Test Results Data
|
|
8
|
-
*/
|
|
9
|
-
class LatencyTestResults {
|
|
10
|
-
constructor() {
|
|
11
|
-
//Fields Set from the latency payload regardless of version
|
|
12
|
-
this.ReceiptTimeMs = null;
|
|
13
|
-
this.TransmissionTimeMs = null;
|
|
14
|
-
//Fields Set from the latency payload from 4.27.2
|
|
15
|
-
this.PreCaptureTimeMs = null;
|
|
16
|
-
this.PostCaptureTimeMs = null;
|
|
17
|
-
this.PreEncodeTimeMs = null;
|
|
18
|
-
this.PostEncodeTimeMs = null;
|
|
19
|
-
//Fields Set from the latency payload from 5.0
|
|
20
|
-
this.EncodeMs = null;
|
|
21
|
-
this.CaptureToSendMs = null;
|
|
22
|
-
//Fields Set when processed
|
|
23
|
-
this.testStartTimeMs = 0;
|
|
24
|
-
this.browserReceiptTimeMs = 0;
|
|
25
|
-
//Fields set from calculations
|
|
26
|
-
this.latencyExcludingDecode = 0;
|
|
27
|
-
this.testDuration = 0;
|
|
28
|
-
//ueLatency: number = 0;
|
|
29
|
-
this.networkLatency = 0;
|
|
30
|
-
this.browserSendLatency = 0;
|
|
31
|
-
this.frameDisplayDeltaTimeMs = 0;
|
|
32
|
-
this.endToEndLatency = 0;
|
|
33
|
-
//uePixelStreamLatency: number = 0;
|
|
34
|
-
this.encodeLatency = 0;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Sets the Delta Time Milliseconds
|
|
38
|
-
* @param DeltaTimeMs - Delta Time Milliseconds
|
|
39
|
-
*/
|
|
40
|
-
setFrameDisplayDeltaTime(DeltaTimeMs) {
|
|
41
|
-
if (this.frameDisplayDeltaTimeMs == 0) {
|
|
42
|
-
this.frameDisplayDeltaTimeMs = Math.round(DeltaTimeMs);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Process the encoder times and set them
|
|
47
|
-
*/
|
|
48
|
-
processFields() {
|
|
49
|
-
if (this.EncodeMs == null && (this.PreEncodeTimeMs != null || this.PostEncodeTimeMs != null)) {
|
|
50
|
-
lib_pixelstreamingcommon_ue5_5_1.Logger.Info(`Setting Encode Ms \n ${this.PostEncodeTimeMs} \n ${this.PreEncodeTimeMs}`);
|
|
51
|
-
this.EncodeMs = this.PostEncodeTimeMs - this.PreEncodeTimeMs;
|
|
52
|
-
}
|
|
53
|
-
if (this.CaptureToSendMs == null &&
|
|
54
|
-
(this.PreCaptureTimeMs != null || this.PostCaptureTimeMs != null)) {
|
|
55
|
-
lib_pixelstreamingcommon_ue5_5_1.Logger.Info(`Setting CaptureToSendMs Ms \n ${this.PostCaptureTimeMs} \n ${this.PreCaptureTimeMs}`);
|
|
56
|
-
this.CaptureToSendMs = this.PostCaptureTimeMs - this.PreCaptureTimeMs;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
exports.LatencyTestResults = LatencyTestResults;
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.LatencyTestResults = void 0;
|
|
5
|
+
const lib_pixelstreamingcommon_ue5_5_1 = require("@epicgames-ps/lib-pixelstreamingcommon-ue5.5");
|
|
6
|
+
/**
|
|
7
|
+
* Latency Test Results Data
|
|
8
|
+
*/
|
|
9
|
+
class LatencyTestResults {
|
|
10
|
+
constructor() {
|
|
11
|
+
//Fields Set from the latency payload regardless of version
|
|
12
|
+
this.ReceiptTimeMs = null;
|
|
13
|
+
this.TransmissionTimeMs = null;
|
|
14
|
+
//Fields Set from the latency payload from 4.27.2
|
|
15
|
+
this.PreCaptureTimeMs = null;
|
|
16
|
+
this.PostCaptureTimeMs = null;
|
|
17
|
+
this.PreEncodeTimeMs = null;
|
|
18
|
+
this.PostEncodeTimeMs = null;
|
|
19
|
+
//Fields Set from the latency payload from 5.0
|
|
20
|
+
this.EncodeMs = null;
|
|
21
|
+
this.CaptureToSendMs = null;
|
|
22
|
+
//Fields Set when processed
|
|
23
|
+
this.testStartTimeMs = 0;
|
|
24
|
+
this.browserReceiptTimeMs = 0;
|
|
25
|
+
//Fields set from calculations
|
|
26
|
+
this.latencyExcludingDecode = 0;
|
|
27
|
+
this.testDuration = 0;
|
|
28
|
+
//ueLatency: number = 0;
|
|
29
|
+
this.networkLatency = 0;
|
|
30
|
+
this.browserSendLatency = 0;
|
|
31
|
+
this.frameDisplayDeltaTimeMs = 0;
|
|
32
|
+
this.endToEndLatency = 0;
|
|
33
|
+
//uePixelStreamLatency: number = 0;
|
|
34
|
+
this.encodeLatency = 0;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Sets the Delta Time Milliseconds
|
|
38
|
+
* @param DeltaTimeMs - Delta Time Milliseconds
|
|
39
|
+
*/
|
|
40
|
+
setFrameDisplayDeltaTime(DeltaTimeMs) {
|
|
41
|
+
if (this.frameDisplayDeltaTimeMs == 0) {
|
|
42
|
+
this.frameDisplayDeltaTimeMs = Math.round(DeltaTimeMs);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Process the encoder times and set them
|
|
47
|
+
*/
|
|
48
|
+
processFields() {
|
|
49
|
+
if (this.EncodeMs == null && (this.PreEncodeTimeMs != null || this.PostEncodeTimeMs != null)) {
|
|
50
|
+
lib_pixelstreamingcommon_ue5_5_1.Logger.Info(`Setting Encode Ms \n ${this.PostEncodeTimeMs} \n ${this.PreEncodeTimeMs}`);
|
|
51
|
+
this.EncodeMs = this.PostEncodeTimeMs - this.PreEncodeTimeMs;
|
|
52
|
+
}
|
|
53
|
+
if (this.CaptureToSendMs == null &&
|
|
54
|
+
(this.PreCaptureTimeMs != null || this.PostCaptureTimeMs != null)) {
|
|
55
|
+
lib_pixelstreamingcommon_ue5_5_1.Logger.Info(`Setting CaptureToSendMs Ms \n ${this.PostCaptureTimeMs} \n ${this.PreCaptureTimeMs}`);
|
|
56
|
+
this.CaptureToSendMs = this.PostCaptureTimeMs - this.PreCaptureTimeMs;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.LatencyTestResults = LatencyTestResults;
|
|
61
61
|
//# sourceMappingURL=LatencyTestResults.js.map
|
|
@@ -1,94 +1,94 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.FreezeFrame = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* A class for managing the freeze frame object
|
|
7
|
-
*/
|
|
8
|
-
class FreezeFrame {
|
|
9
|
-
/**
|
|
10
|
-
* Construct a freeze frame
|
|
11
|
-
* @param rootDiv the div that a freeze frame element will be injected into
|
|
12
|
-
*/
|
|
13
|
-
constructor(rootDiv) {
|
|
14
|
-
this.freezeFrameHeight = 0;
|
|
15
|
-
this.freezeFrameWidth = 0;
|
|
16
|
-
this.rootDiv = rootDiv;
|
|
17
|
-
// create the overlay
|
|
18
|
-
this.rootElement = document.createElement('div');
|
|
19
|
-
this.rootElement.id = 'freezeFrame';
|
|
20
|
-
this.rootElement.style.display = 'none';
|
|
21
|
-
this.rootElement.style.pointerEvents = 'none';
|
|
22
|
-
this.rootElement.style.position = 'absolute';
|
|
23
|
-
this.rootElement.style.zIndex = '20';
|
|
24
|
-
// create the image place holder
|
|
25
|
-
this.imageElement = document.createElement('img');
|
|
26
|
-
this.imageElement.style.position = 'absolute';
|
|
27
|
-
// append the image into the root element and append the element to the root div
|
|
28
|
-
this.rootElement.appendChild(this.imageElement);
|
|
29
|
-
this.rootDiv.appendChild(this.rootElement);
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Set the freeze frame element for showing
|
|
33
|
-
*/
|
|
34
|
-
setElementForShow() {
|
|
35
|
-
this.rootElement.style.display = 'block';
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Set the freeze frame element for hiding
|
|
39
|
-
*/
|
|
40
|
-
setElementForHide() {
|
|
41
|
-
this.rootElement.style.display = 'none';
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Update the freeze frames image source
|
|
45
|
-
* @param jpeg - the freeze frame image as a byte array data
|
|
46
|
-
*/
|
|
47
|
-
updateImageElementSource(jpeg) {
|
|
48
|
-
const base64 = btoa(jpeg.reduce((data, byte) => data + String.fromCharCode(byte), ''));
|
|
49
|
-
this.imageElement.src = 'data:image/jpeg;base64,' + base64;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Set the dimensions for the freeze frame from the element and resize it
|
|
53
|
-
*/
|
|
54
|
-
setDimensionsFromElementAndResize() {
|
|
55
|
-
this.freezeFrameHeight = this.imageElement.naturalHeight;
|
|
56
|
-
this.freezeFrameWidth = this.imageElement.naturalWidth;
|
|
57
|
-
this.resize();
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Resize a freeze frame element
|
|
61
|
-
*/
|
|
62
|
-
resize() {
|
|
63
|
-
if (this.freezeFrameWidth !== 0 && this.freezeFrameHeight !== 0) {
|
|
64
|
-
let displayWidth = 0;
|
|
65
|
-
let displayHeight = 0;
|
|
66
|
-
let displayTop = 0;
|
|
67
|
-
let displayLeft = 0;
|
|
68
|
-
const parentAspectRatio = this.rootDiv.clientWidth / this.rootDiv.clientHeight;
|
|
69
|
-
const videoAspectRatio = this.freezeFrameWidth / this.freezeFrameHeight;
|
|
70
|
-
if (parentAspectRatio < videoAspectRatio) {
|
|
71
|
-
displayWidth = this.rootDiv.clientWidth;
|
|
72
|
-
displayHeight = Math.floor(this.rootDiv.clientWidth / videoAspectRatio);
|
|
73
|
-
displayTop = Math.floor((this.rootDiv.clientHeight - displayHeight) * 0.5);
|
|
74
|
-
displayLeft = 0;
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
displayWidth = Math.floor(this.rootDiv.clientHeight * videoAspectRatio);
|
|
78
|
-
displayHeight = this.rootDiv.clientHeight;
|
|
79
|
-
displayTop = 0;
|
|
80
|
-
displayLeft = Math.floor((this.rootDiv.clientWidth - displayWidth) * 0.5);
|
|
81
|
-
}
|
|
82
|
-
this.rootElement.style.width = this.rootDiv.offsetWidth + 'px';
|
|
83
|
-
this.rootElement.style.height = this.rootDiv.offsetHeight + 'px';
|
|
84
|
-
this.rootElement.style.left = 0 + 'px';
|
|
85
|
-
this.rootElement.style.top = 0 + 'px';
|
|
86
|
-
this.imageElement.style.width = displayWidth + 'px';
|
|
87
|
-
this.imageElement.style.height = displayHeight + 'px';
|
|
88
|
-
this.imageElement.style.left = displayLeft + 'px';
|
|
89
|
-
this.imageElement.style.top = displayTop + 'px';
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
exports.FreezeFrame = FreezeFrame;
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.FreezeFrame = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* A class for managing the freeze frame object
|
|
7
|
+
*/
|
|
8
|
+
class FreezeFrame {
|
|
9
|
+
/**
|
|
10
|
+
* Construct a freeze frame
|
|
11
|
+
* @param rootDiv the div that a freeze frame element will be injected into
|
|
12
|
+
*/
|
|
13
|
+
constructor(rootDiv) {
|
|
14
|
+
this.freezeFrameHeight = 0;
|
|
15
|
+
this.freezeFrameWidth = 0;
|
|
16
|
+
this.rootDiv = rootDiv;
|
|
17
|
+
// create the overlay
|
|
18
|
+
this.rootElement = document.createElement('div');
|
|
19
|
+
this.rootElement.id = 'freezeFrame';
|
|
20
|
+
this.rootElement.style.display = 'none';
|
|
21
|
+
this.rootElement.style.pointerEvents = 'none';
|
|
22
|
+
this.rootElement.style.position = 'absolute';
|
|
23
|
+
this.rootElement.style.zIndex = '20';
|
|
24
|
+
// create the image place holder
|
|
25
|
+
this.imageElement = document.createElement('img');
|
|
26
|
+
this.imageElement.style.position = 'absolute';
|
|
27
|
+
// append the image into the root element and append the element to the root div
|
|
28
|
+
this.rootElement.appendChild(this.imageElement);
|
|
29
|
+
this.rootDiv.appendChild(this.rootElement);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Set the freeze frame element for showing
|
|
33
|
+
*/
|
|
34
|
+
setElementForShow() {
|
|
35
|
+
this.rootElement.style.display = 'block';
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Set the freeze frame element for hiding
|
|
39
|
+
*/
|
|
40
|
+
setElementForHide() {
|
|
41
|
+
this.rootElement.style.display = 'none';
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Update the freeze frames image source
|
|
45
|
+
* @param jpeg - the freeze frame image as a byte array data
|
|
46
|
+
*/
|
|
47
|
+
updateImageElementSource(jpeg) {
|
|
48
|
+
const base64 = btoa(jpeg.reduce((data, byte) => data + String.fromCharCode(byte), ''));
|
|
49
|
+
this.imageElement.src = 'data:image/jpeg;base64,' + base64;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Set the dimensions for the freeze frame from the element and resize it
|
|
53
|
+
*/
|
|
54
|
+
setDimensionsFromElementAndResize() {
|
|
55
|
+
this.freezeFrameHeight = this.imageElement.naturalHeight;
|
|
56
|
+
this.freezeFrameWidth = this.imageElement.naturalWidth;
|
|
57
|
+
this.resize();
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Resize a freeze frame element
|
|
61
|
+
*/
|
|
62
|
+
resize() {
|
|
63
|
+
if (this.freezeFrameWidth !== 0 && this.freezeFrameHeight !== 0) {
|
|
64
|
+
let displayWidth = 0;
|
|
65
|
+
let displayHeight = 0;
|
|
66
|
+
let displayTop = 0;
|
|
67
|
+
let displayLeft = 0;
|
|
68
|
+
const parentAspectRatio = this.rootDiv.clientWidth / this.rootDiv.clientHeight;
|
|
69
|
+
const videoAspectRatio = this.freezeFrameWidth / this.freezeFrameHeight;
|
|
70
|
+
if (parentAspectRatio < videoAspectRatio) {
|
|
71
|
+
displayWidth = this.rootDiv.clientWidth;
|
|
72
|
+
displayHeight = Math.floor(this.rootDiv.clientWidth / videoAspectRatio);
|
|
73
|
+
displayTop = Math.floor((this.rootDiv.clientHeight - displayHeight) * 0.5);
|
|
74
|
+
displayLeft = 0;
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
displayWidth = Math.floor(this.rootDiv.clientHeight * videoAspectRatio);
|
|
78
|
+
displayHeight = this.rootDiv.clientHeight;
|
|
79
|
+
displayTop = 0;
|
|
80
|
+
displayLeft = Math.floor((this.rootDiv.clientWidth - displayWidth) * 0.5);
|
|
81
|
+
}
|
|
82
|
+
this.rootElement.style.width = this.rootDiv.offsetWidth + 'px';
|
|
83
|
+
this.rootElement.style.height = this.rootDiv.offsetHeight + 'px';
|
|
84
|
+
this.rootElement.style.left = 0 + 'px';
|
|
85
|
+
this.rootElement.style.top = 0 + 'px';
|
|
86
|
+
this.imageElement.style.width = displayWidth + 'px';
|
|
87
|
+
this.imageElement.style.height = displayHeight + 'px';
|
|
88
|
+
this.imageElement.style.left = displayLeft + 'px';
|
|
89
|
+
this.imageElement.style.top = displayTop + 'px';
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
exports.FreezeFrame = FreezeFrame;
|
|
94
94
|
//# sourceMappingURL=FreezeFrame.js.map
|
|
@@ -1,96 +1,96 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.FreezeFrameController = void 0;
|
|
5
|
-
const lib_pixelstreamingcommon_ue5_5_1 = require("@epicgames-ps/lib-pixelstreamingcommon-ue5.5");
|
|
6
|
-
const FreezeFrame_1 = require("./FreezeFrame");
|
|
7
|
-
/**
|
|
8
|
-
* A class for controlling freeze frame functionality
|
|
9
|
-
*/
|
|
10
|
-
class FreezeFrameController {
|
|
11
|
-
/**
|
|
12
|
-
* Construct a freeze frame controller
|
|
13
|
-
* @param rootDiv - the div that a freeze frame element will be injected into
|
|
14
|
-
*/
|
|
15
|
-
constructor(rootDiv) {
|
|
16
|
-
this.receiving = false;
|
|
17
|
-
this.size = 0;
|
|
18
|
-
this.jpeg = undefined;
|
|
19
|
-
this.valid = false;
|
|
20
|
-
this.freezeFrameDelay = 50;
|
|
21
|
-
this.freezeFrame = new FreezeFrame_1.FreezeFrame(rootDiv);
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Show the freeze frame if it is valid
|
|
25
|
-
*/
|
|
26
|
-
showFreezeFrame() {
|
|
27
|
-
if (this.valid) {
|
|
28
|
-
this.freezeFrame.setElementForShow();
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Hide the freeze frame and set the validity to false
|
|
33
|
-
*/
|
|
34
|
-
hideFreezeFrame() {
|
|
35
|
-
this.valid = false;
|
|
36
|
-
this.freezeFrame.setElementForHide();
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Update the freeze frames image source and load it
|
|
40
|
-
* @param jpeg - the freeze frame image as a byte array data
|
|
41
|
-
* @param onLoadCallBack - a call back for managing if the play overlay needs to be shown or not
|
|
42
|
-
*/
|
|
43
|
-
updateFreezeFrameAndShow(jpeg, onLoadCallBack) {
|
|
44
|
-
this.freezeFrame.updateImageElementSource(jpeg);
|
|
45
|
-
this.freezeFrame.imageElement.onload = () => {
|
|
46
|
-
this.freezeFrame.setDimensionsFromElementAndResize();
|
|
47
|
-
onLoadCallBack();
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Process the new freeze frame image and update it
|
|
52
|
-
* @param view - the freeze frame image as a byte array data
|
|
53
|
-
* @param onLoadCallBack - a call back for managing if the play overlay needs to be shown or not
|
|
54
|
-
*/
|
|
55
|
-
processFreezeFrameMessage(view, onLoadCallBack) {
|
|
56
|
-
// Reset freeze frame if we got a freeze frame message and we are not "receiving" yet.
|
|
57
|
-
if (!this.receiving) {
|
|
58
|
-
this.receiving = true;
|
|
59
|
-
this.valid = false;
|
|
60
|
-
this.size = 0;
|
|
61
|
-
this.jpeg = undefined;
|
|
62
|
-
}
|
|
63
|
-
// Extract total size of freeze frame (across all chunks)
|
|
64
|
-
this.size = new DataView(view.slice(1, 5).buffer).getInt32(0, true);
|
|
65
|
-
// Get the jpeg part of the payload
|
|
66
|
-
const jpegBytes = view.slice(1 + 4);
|
|
67
|
-
// Append to existing jpeg that holds the freeze frame
|
|
68
|
-
if (this.jpeg) {
|
|
69
|
-
const jpeg = new Uint8Array(this.jpeg.length + jpegBytes.length);
|
|
70
|
-
jpeg.set(this.jpeg, 0);
|
|
71
|
-
jpeg.set(jpegBytes, this.jpeg.length);
|
|
72
|
-
this.jpeg = jpeg;
|
|
73
|
-
}
|
|
74
|
-
// No existing freeze frame jpeg, make one
|
|
75
|
-
else {
|
|
76
|
-
this.jpeg = jpegBytes;
|
|
77
|
-
this.receiving = true;
|
|
78
|
-
lib_pixelstreamingcommon_ue5_5_1.Logger.Info(`received first chunk of freeze frame: ${this.jpeg.length}/${this.size}`);
|
|
79
|
-
}
|
|
80
|
-
// Finished receiving freeze frame, we can show it now
|
|
81
|
-
if (this.jpeg.length === this.size) {
|
|
82
|
-
this.receiving = false;
|
|
83
|
-
this.valid = true;
|
|
84
|
-
lib_pixelstreamingcommon_ue5_5_1.Logger.Info(`received complete freeze frame ${this.size}`);
|
|
85
|
-
this.updateFreezeFrameAndShow(this.jpeg, onLoadCallBack);
|
|
86
|
-
}
|
|
87
|
-
// We received more data than the freeze frame payload message indicate (this is an error)
|
|
88
|
-
else if (this.jpeg.length > this.size) {
|
|
89
|
-
lib_pixelstreamingcommon_ue5_5_1.Logger.Error(`received bigger freeze frame than advertised: ${this.jpeg.length}/${this.size}`);
|
|
90
|
-
this.jpeg = undefined;
|
|
91
|
-
this.receiving = false;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
exports.FreezeFrameController = FreezeFrameController;
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.FreezeFrameController = void 0;
|
|
5
|
+
const lib_pixelstreamingcommon_ue5_5_1 = require("@epicgames-ps/lib-pixelstreamingcommon-ue5.5");
|
|
6
|
+
const FreezeFrame_1 = require("./FreezeFrame");
|
|
7
|
+
/**
|
|
8
|
+
* A class for controlling freeze frame functionality
|
|
9
|
+
*/
|
|
10
|
+
class FreezeFrameController {
|
|
11
|
+
/**
|
|
12
|
+
* Construct a freeze frame controller
|
|
13
|
+
* @param rootDiv - the div that a freeze frame element will be injected into
|
|
14
|
+
*/
|
|
15
|
+
constructor(rootDiv) {
|
|
16
|
+
this.receiving = false;
|
|
17
|
+
this.size = 0;
|
|
18
|
+
this.jpeg = undefined;
|
|
19
|
+
this.valid = false;
|
|
20
|
+
this.freezeFrameDelay = 50;
|
|
21
|
+
this.freezeFrame = new FreezeFrame_1.FreezeFrame(rootDiv);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Show the freeze frame if it is valid
|
|
25
|
+
*/
|
|
26
|
+
showFreezeFrame() {
|
|
27
|
+
if (this.valid) {
|
|
28
|
+
this.freezeFrame.setElementForShow();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Hide the freeze frame and set the validity to false
|
|
33
|
+
*/
|
|
34
|
+
hideFreezeFrame() {
|
|
35
|
+
this.valid = false;
|
|
36
|
+
this.freezeFrame.setElementForHide();
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Update the freeze frames image source and load it
|
|
40
|
+
* @param jpeg - the freeze frame image as a byte array data
|
|
41
|
+
* @param onLoadCallBack - a call back for managing if the play overlay needs to be shown or not
|
|
42
|
+
*/
|
|
43
|
+
updateFreezeFrameAndShow(jpeg, onLoadCallBack) {
|
|
44
|
+
this.freezeFrame.updateImageElementSource(jpeg);
|
|
45
|
+
this.freezeFrame.imageElement.onload = () => {
|
|
46
|
+
this.freezeFrame.setDimensionsFromElementAndResize();
|
|
47
|
+
onLoadCallBack();
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Process the new freeze frame image and update it
|
|
52
|
+
* @param view - the freeze frame image as a byte array data
|
|
53
|
+
* @param onLoadCallBack - a call back for managing if the play overlay needs to be shown or not
|
|
54
|
+
*/
|
|
55
|
+
processFreezeFrameMessage(view, onLoadCallBack) {
|
|
56
|
+
// Reset freeze frame if we got a freeze frame message and we are not "receiving" yet.
|
|
57
|
+
if (!this.receiving) {
|
|
58
|
+
this.receiving = true;
|
|
59
|
+
this.valid = false;
|
|
60
|
+
this.size = 0;
|
|
61
|
+
this.jpeg = undefined;
|
|
62
|
+
}
|
|
63
|
+
// Extract total size of freeze frame (across all chunks)
|
|
64
|
+
this.size = new DataView(view.slice(1, 5).buffer).getInt32(0, true);
|
|
65
|
+
// Get the jpeg part of the payload
|
|
66
|
+
const jpegBytes = view.slice(1 + 4);
|
|
67
|
+
// Append to existing jpeg that holds the freeze frame
|
|
68
|
+
if (this.jpeg) {
|
|
69
|
+
const jpeg = new Uint8Array(this.jpeg.length + jpegBytes.length);
|
|
70
|
+
jpeg.set(this.jpeg, 0);
|
|
71
|
+
jpeg.set(jpegBytes, this.jpeg.length);
|
|
72
|
+
this.jpeg = jpeg;
|
|
73
|
+
}
|
|
74
|
+
// No existing freeze frame jpeg, make one
|
|
75
|
+
else {
|
|
76
|
+
this.jpeg = jpegBytes;
|
|
77
|
+
this.receiving = true;
|
|
78
|
+
lib_pixelstreamingcommon_ue5_5_1.Logger.Info(`received first chunk of freeze frame: ${this.jpeg.length}/${this.size}`);
|
|
79
|
+
}
|
|
80
|
+
// Finished receiving freeze frame, we can show it now
|
|
81
|
+
if (this.jpeg.length === this.size) {
|
|
82
|
+
this.receiving = false;
|
|
83
|
+
this.valid = true;
|
|
84
|
+
lib_pixelstreamingcommon_ue5_5_1.Logger.Info(`received complete freeze frame ${this.size}`);
|
|
85
|
+
this.updateFreezeFrameAndShow(this.jpeg, onLoadCallBack);
|
|
86
|
+
}
|
|
87
|
+
// We received more data than the freeze frame payload message indicate (this is an error)
|
|
88
|
+
else if (this.jpeg.length > this.size) {
|
|
89
|
+
lib_pixelstreamingcommon_ue5_5_1.Logger.Error(`received bigger freeze frame than advertised: ${this.jpeg.length}/${this.size}`);
|
|
90
|
+
this.jpeg = undefined;
|
|
91
|
+
this.receiving = false;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
exports.FreezeFrameController = FreezeFrameController;
|
|
96
96
|
//# sourceMappingURL=FreezeFrameController.js.map
|