@epicgames-ps/lib-pixelstreamingfrontend-ue5.5 0.4.1 → 0.4.3
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.map +1 -1
- package/dist/commonjs/Config/Config.js +30 -6
- package/dist/commonjs/Config/Config.js.map +1 -1
- package/dist/commonjs/Config/SettingBase.js.map +1 -1
- package/dist/commonjs/Config/SettingFlag.js.map +1 -1
- package/dist/commonjs/Config/SettingNumber.js.map +1 -1
- package/dist/commonjs/Config/SettingOption.js.map +1 -1
- package/dist/commonjs/Config/SettingText.js.map +1 -1
- package/dist/commonjs/DataChannel/DataChannelController.js.map +1 -1
- package/dist/commonjs/DataChannel/DataChannelLatencyTestController.js.map +1 -1
- package/dist/commonjs/DataChannel/DataChannelSender.js.map +1 -1
- package/dist/commonjs/DataChannel/InitialSettings.js.map +1 -1
- package/dist/commonjs/DataChannel/LatencyTestResults.js.map +1 -1
- package/dist/commonjs/FreezeFrame/FreezeFrame.js.map +1 -1
- package/dist/commonjs/FreezeFrame/FreezeFrameController.js.map +1 -1
- package/dist/commonjs/Inputs/GamepadController.js +1 -1
- package/dist/commonjs/Inputs/GamepadController.js.map +1 -1
- package/dist/commonjs/Inputs/GamepadTypes.js +1 -2
- package/dist/commonjs/Inputs/GamepadTypes.js.map +1 -1
- package/dist/commonjs/Inputs/InputClassesFactory.js.map +1 -1
- package/dist/commonjs/Inputs/KeyboardController.js.map +1 -1
- package/dist/commonjs/Inputs/MouseController.js.map +1 -1
- package/dist/commonjs/Inputs/MouseControllerHovering.js.map +1 -1
- package/dist/commonjs/Inputs/MouseControllerLocked.js.map +1 -1
- package/dist/commonjs/Inputs/TouchController.js.map +1 -1
- package/dist/commonjs/Inputs/TouchControllerFake.js.map +1 -1
- package/dist/commonjs/Inputs/XRGamepadController.js.map +1 -1
- package/dist/commonjs/PeerConnectionController/AggregatedStats.js.map +1 -1
- package/dist/commonjs/PeerConnectionController/PeerConnectionController.js +4 -4
- package/dist/commonjs/PeerConnectionController/PeerConnectionController.js.map +1 -1
- package/dist/commonjs/PixelStreaming/PixelStreaming.js +66 -10
- package/dist/commonjs/PixelStreaming/PixelStreaming.js.map +1 -1
- package/dist/commonjs/UI/OnScreenKeyboard.js.map +1 -1
- package/dist/commonjs/UeInstanceMessage/SendMessageController.js +1 -0
- package/dist/commonjs/UeInstanceMessage/SendMessageController.js.map +1 -1
- package/dist/commonjs/UeInstanceMessage/StreamMessageController.js +1 -1
- package/dist/commonjs/UeInstanceMessage/StreamMessageController.js.map +1 -1
- package/dist/commonjs/Util/EventEmitter.js.map +1 -1
- package/dist/commonjs/Util/FileUtil.js.map +1 -1
- package/dist/commonjs/Util/IURLSearchParams.js.map +1 -1
- package/dist/commonjs/Util/InputCoordTranslator.js.map +1 -1
- package/dist/commonjs/VideoPlayer/StreamController.js.map +1 -1
- package/dist/commonjs/VideoPlayer/VideoPlayer.js.map +1 -1
- package/dist/commonjs/WebRtcPlayer/WebRtcPlayerController.js +94 -1
- package/dist/commonjs/WebRtcPlayer/WebRtcPlayerController.js.map +1 -1
- package/dist/commonjs/WebXR/WebXRController.js +2 -2
- package/dist/commonjs/WebXR/WebXRController.js.map +1 -1
- package/dist/commonjs/pixelstreamingfrontend.js +5 -1
- package/dist/commonjs/pixelstreamingfrontend.js.map +1 -1
- package/dist/esm/AFK/AFKController.js +20 -16
- package/dist/esm/AFK/AFKController.js.map +1 -1
- package/dist/esm/Config/Config.js +92 -60
- package/dist/esm/Config/Config.js.map +1 -1
- package/dist/esm/Config/SettingBase.js +5 -1
- package/dist/esm/Config/SettingBase.js.map +1 -1
- package/dist/esm/Config/SettingFlag.js +6 -2
- package/dist/esm/Config/SettingFlag.js.map +1 -1
- package/dist/esm/Config/SettingNumber.js +6 -2
- package/dist/esm/Config/SettingNumber.js.map +1 -1
- package/dist/esm/Config/SettingOption.js +8 -4
- package/dist/esm/Config/SettingOption.js.map +1 -1
- package/dist/esm/Config/SettingText.js +6 -2
- package/dist/esm/Config/SettingText.js.map +1 -1
- package/dist/esm/DataChannel/DataChannelController.js +10 -6
- package/dist/esm/DataChannel/DataChannelController.js.map +1 -1
- package/dist/esm/DataChannel/DataChannelLatencyTestController.js +9 -5
- package/dist/esm/DataChannel/DataChannelLatencyTestController.js.map +1 -1
- package/dist/esm/DataChannel/DataChannelLatencyTestResults.js +5 -1
- package/dist/esm/DataChannel/DataChannelLatencyTestResults.js.map +1 -1
- package/dist/esm/DataChannel/DataChannelSender.js +8 -4
- package/dist/esm/DataChannel/DataChannelSender.js.map +1 -1
- package/dist/esm/DataChannel/InitialSettings.js +11 -4
- package/dist/esm/DataChannel/InitialSettings.js.map +1 -1
- package/dist/esm/DataChannel/LatencyTestResults.js +8 -4
- package/dist/esm/DataChannel/LatencyTestResults.js.map +1 -1
- package/dist/esm/FreezeFrame/FreezeFrame.js +5 -1
- package/dist/esm/FreezeFrame/FreezeFrame.js.map +1 -1
- package/dist/esm/FreezeFrame/FreezeFrameController.js +11 -7
- package/dist/esm/FreezeFrame/FreezeFrameController.js.map +1 -1
- package/dist/esm/Inputs/GamepadController.js +11 -7
- package/dist/esm/Inputs/GamepadController.js.map +1 -1
- package/dist/esm/Inputs/GamepadTypes.js +4 -1
- package/dist/esm/Inputs/GamepadTypes.js.map +1 -1
- package/dist/esm/Inputs/IInputController.js +2 -1
- package/dist/esm/Inputs/InputClassesFactory.js +26 -21
- package/dist/esm/Inputs/InputClassesFactory.js.map +1 -1
- package/dist/esm/Inputs/KeyCodes.js +4 -1
- package/dist/esm/Inputs/KeyCodes.js.map +1 -1
- package/dist/esm/Inputs/KeyboardController.js +22 -18
- package/dist/esm/Inputs/KeyboardController.js.map +1 -1
- package/dist/esm/Inputs/MouseButtons.js +7 -2
- package/dist/esm/Inputs/MouseButtons.js.map +1 -1
- package/dist/esm/Inputs/MouseController.js +26 -22
- package/dist/esm/Inputs/MouseController.js.map +1 -1
- package/dist/esm/Inputs/MouseControllerHovering.js +6 -2
- package/dist/esm/Inputs/MouseControllerHovering.js.map +1 -1
- package/dist/esm/Inputs/MouseControllerLocked.js +9 -5
- package/dist/esm/Inputs/MouseControllerLocked.js.map +1 -1
- package/dist/esm/Inputs/SpecialKeyCodes.js +5 -1
- package/dist/esm/Inputs/SpecialKeyCodes.js.map +1 -1
- package/dist/esm/Inputs/TouchController.js +8 -4
- package/dist/esm/Inputs/TouchController.js.map +1 -1
- package/dist/esm/Inputs/TouchControllerFake.js +8 -4
- package/dist/esm/Inputs/TouchControllerFake.js.map +1 -1
- package/dist/esm/Inputs/XRGamepadController.js +8 -4
- package/dist/esm/Inputs/XRGamepadController.js.map +1 -1
- package/dist/esm/PeerConnectionController/AggregatedStats.js +23 -19
- package/dist/esm/PeerConnectionController/AggregatedStats.js.map +1 -1
- package/dist/esm/PeerConnectionController/CandidatePairStats.js +5 -1
- package/dist/esm/PeerConnectionController/CandidatePairStats.js.map +1 -1
- package/dist/esm/PeerConnectionController/CandidateStat.js +5 -1
- package/dist/esm/PeerConnectionController/CandidateStat.js.map +1 -1
- package/dist/esm/PeerConnectionController/CodecStats.js +5 -1
- package/dist/esm/PeerConnectionController/CodecStats.js.map +1 -1
- package/dist/esm/PeerConnectionController/DataChannelStats.js +5 -1
- package/dist/esm/PeerConnectionController/DataChannelStats.js.map +1 -1
- package/dist/esm/PeerConnectionController/InboundRTPStats.js +9 -3
- package/dist/esm/PeerConnectionController/InboundRTPStats.js.map +1 -1
- package/dist/esm/PeerConnectionController/InboundTrackStats.js +5 -1
- package/dist/esm/PeerConnectionController/InboundTrackStats.js.map +1 -1
- package/dist/esm/PeerConnectionController/OutBoundRTPStats.js +7 -2
- package/dist/esm/PeerConnectionController/OutBoundRTPStats.js.map +1 -1
- package/dist/esm/PeerConnectionController/PeerConnectionController.js +45 -41
- package/dist/esm/PeerConnectionController/PeerConnectionController.js.map +1 -1
- package/dist/esm/PeerConnectionController/SessionStats.js +5 -1
- package/dist/esm/PeerConnectionController/SessionStats.js.map +1 -1
- package/dist/esm/PeerConnectionController/StreamStats.js +5 -1
- package/dist/esm/PeerConnectionController/StreamStats.js.map +1 -1
- package/dist/esm/PixelStreaming/PixelStreaming.js +154 -94
- package/dist/esm/PixelStreaming/PixelStreaming.js.map +1 -1
- package/dist/esm/UI/OnScreenKeyboard.js +5 -1
- package/dist/esm/UI/OnScreenKeyboard.js.map +1 -1
- package/dist/esm/UeInstanceMessage/ResponseController.js +8 -4
- package/dist/esm/UeInstanceMessage/ResponseController.js.map +1 -1
- package/dist/esm/UeInstanceMessage/SendMessageController.js +10 -5
- package/dist/esm/UeInstanceMessage/SendMessageController.js.map +1 -1
- package/dist/esm/UeInstanceMessage/StreamMessageController.js +11 -6
- package/dist/esm/UeInstanceMessage/StreamMessageController.js.map +1 -1
- package/dist/esm/UeInstanceMessage/ToStreamerMessagesController.js +5 -1
- package/dist/esm/UeInstanceMessage/ToStreamerMessagesController.js.map +1 -1
- package/dist/esm/Util/EventEmitter.js +79 -38
- package/dist/esm/Util/EventEmitter.js.map +1 -1
- package/dist/esm/Util/FileUtil.js +16 -11
- package/dist/esm/Util/FileUtil.js.map +1 -1
- package/dist/esm/Util/IURLSearchParams.js +5 -1
- package/dist/esm/Util/IURLSearchParams.js.map +1 -1
- package/dist/esm/Util/InputCoordTranslator.js +5 -1
- package/dist/esm/Util/InputCoordTranslator.js.map +1 -1
- package/dist/esm/Util/RTCUtils.js +5 -1
- package/dist/esm/Util/RTCUtils.js.map +1 -1
- package/dist/esm/VideoPlayer/StreamController.js +10 -6
- package/dist/esm/VideoPlayer/StreamController.js.map +1 -1
- package/dist/esm/VideoPlayer/VideoPlayer.js +11 -7
- package/dist/esm/VideoPlayer/VideoPlayer.js.map +1 -1
- package/dist/esm/WebRtcPlayer/WebRtcPlayerController.js +312 -215
- package/dist/esm/WebRtcPlayer/WebRtcPlayerController.js.map +1 -1
- package/dist/esm/WebXR/WebXRController.js +16 -12
- package/dist/esm/WebXR/WebXRController.js.map +1 -1
- package/dist/esm/pixelstreamingfrontend.js +73 -23
- package/dist/esm/pixelstreamingfrontend.js.map +1 -1
- package/dist/types/Config/Config.d.ts +9 -0
- package/dist/types/DataChannel/DataChannelController.d.ts +1 -1
- package/dist/types/DataChannel/InitialSettings.d.ts +2 -0
- package/dist/types/Inputs/XRGamepadController.d.ts +0 -1
- package/dist/types/PixelStreaming/PixelStreaming.d.ts +1 -1
- package/dist/types/Util/EventEmitter.d.ts +0 -1
- package/dist/types/VideoPlayer/VideoPlayer.d.ts +1 -1
- package/dist/types/WebRtcPlayer/WebRtcPlayerController.d.ts +17 -0
- package/dist/types/WebXR/WebXRController.d.ts +0 -1
- package/dist/types/pixelstreamingfrontend.d.ts +1 -1
- package/package.json +8 -8
- package/src/Config/Config.ts +83 -4
- package/src/Config/SettingFlag.ts +3 -3
- package/src/Config/SettingNumber.ts +3 -3
- package/src/Config/SettingOption.ts +3 -3
- package/src/Config/SettingText.ts +4 -4
- package/src/DataChannel/DataChannelController.ts +2 -2
- package/src/DataChannel/InitialSettings.ts +2 -0
- package/src/Inputs/MouseControllerHovering.ts +2 -2
- package/src/Inputs/MouseControllerLocked.ts +2 -2
- package/src/PeerConnectionController/PeerConnectionController.ts +5 -5
- package/src/PixelStreaming/PixelStreaming.ts +94 -15
- package/src/UeInstanceMessage/SendMessageController.ts +1 -0
- package/src/Util/EventEmitter.ts +40 -40
- package/src/VideoPlayer/VideoPlayer.ts +1 -1
- package/src/WebRtcPlayer/WebRtcPlayerController.ts +120 -1
- package/src/WebXR/WebXRController.ts +1 -1
- package/src/__test__/mockRTCRtpReceiver.ts +1 -1
- package/src/__test__/mockWebSocket.ts +3 -3
- package/src/pixelstreamingfrontend.ts +6 -1
- package/tsconfig.esm.json +2 -1
- package/tsconfig.json +6 -2
|
@@ -50,6 +50,7 @@ export declare class WebRtcPlayerController {
|
|
|
50
50
|
gamePadController: GamepadController;
|
|
51
51
|
coordinateConverter: InputCoordTranslator;
|
|
52
52
|
isUsingSFU: boolean;
|
|
53
|
+
isUsingSVC: boolean;
|
|
53
54
|
isQualityController: boolean;
|
|
54
55
|
statsTimerHandle: number;
|
|
55
56
|
file: FileTemplate;
|
|
@@ -273,6 +274,22 @@ export declare class WebRtcPlayerController {
|
|
|
273
274
|
* to drop quality as low as needed on the given network link.
|
|
274
275
|
*/
|
|
275
276
|
sendEncoderMaxQP(maxQP: number): void;
|
|
277
|
+
/**
|
|
278
|
+
* Send the MinQuality encoder setting to the UE Instance.
|
|
279
|
+
* @param minQuality - The lower bound for quality when encoding
|
|
280
|
+
* valid values are (0-100) where:
|
|
281
|
+
* 0 = Worst quality.
|
|
282
|
+
* 100 = Best quality.
|
|
283
|
+
*/
|
|
284
|
+
sendEncoderMinQuality(minQuality: number): void;
|
|
285
|
+
/**
|
|
286
|
+
* Send the MaxQuality encoder setting to the UE Instance.
|
|
287
|
+
* @param maxQuality - The upper bound for quality when encoding
|
|
288
|
+
* valid values are (0-100) where:
|
|
289
|
+
* 0 = Worst quality.
|
|
290
|
+
* 100 = Best quality.
|
|
291
|
+
*/
|
|
292
|
+
sendEncoderMaxQuality(maxQuality: number): void;
|
|
276
293
|
/**
|
|
277
294
|
* Send the { WebRTC.MinBitrate: SomeNumber }} command to UE to set
|
|
278
295
|
* the minimum bitrate that we allow WebRTC to use
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { WebRtcPlayerController } from './WebRtcPlayer/WebRtcPlayerController';
|
|
2
2
|
export { WebXRController } from './WebXR/WebXRController';
|
|
3
|
-
export { Config, ControlSchemeType, Flags, NumericParameters, TextParameters, OptionParameters, FlagsIds, NumericParametersIds, TextParametersIds, OptionParametersIds, AllSettings } from './Config/Config';
|
|
3
|
+
export { Config, ControlSchemeType, Flags, NumericParameters, TextParameters, OptionParameters, FlagsIds, NumericParametersIds, TextParametersIds, OptionParametersIds, AllSettings, OptionIds, isFlagId, isNumericId, isOptionId, isTextId } from './Config/Config';
|
|
4
4
|
export { SettingBase } from './Config/SettingBase';
|
|
5
5
|
export { SettingFlag } from './Config/SettingFlag';
|
|
6
6
|
export { SettingNumber } from './Config/SettingNumber';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epicgames-ps/lib-pixelstreamingfrontend-ue5.5",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "Frontend library for Unreal Engine 5.5 Pixel Streaming",
|
|
5
5
|
"main": "dist/commonjs/pixelstreamingfrontend.js",
|
|
6
6
|
"module": "dist/esm/pixelstreamingfrontend.js",
|
|
@@ -15,22 +15,22 @@
|
|
|
15
15
|
"spellcheck": "cspell \"{README.md,.github/*.md,src/**/*.ts}\""
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@types/jest": "
|
|
18
|
+
"@types/jest": "^29.5.14",
|
|
19
19
|
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
20
20
|
"cspell": "^4.1.0",
|
|
21
21
|
"eslint": "^8.11.0",
|
|
22
22
|
"eslint-config-prettier": "^9.1.0",
|
|
23
23
|
"eslint-plugin-prettier": "^5.2.1",
|
|
24
|
-
"jest": "^
|
|
25
|
-
"jest-environment-jsdom": "
|
|
24
|
+
"jest": "^29.7.0",
|
|
25
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
26
26
|
"prettier": "3.3.3",
|
|
27
|
-
"ts-jest": "
|
|
28
|
-
"typedoc": "^0.
|
|
29
|
-
"typescript": "^
|
|
27
|
+
"ts-jest": "^29.2.5",
|
|
28
|
+
"typedoc": "^0.27.4",
|
|
29
|
+
"typescript": "^5.0.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
+
"@epicgames-ps/lib-pixelstreamingcommon-ue5.5": "^0.1.4",
|
|
32
33
|
"@types/webxr": "^0.5.1",
|
|
33
|
-
"@epicgames-ps/lib-pixelstreamingcommon-ue5.5": "^0.1.2",
|
|
34
34
|
"sdp": "^3.1.0"
|
|
35
35
|
},
|
|
36
36
|
"repository": {
|
package/src/Config/Config.ts
CHANGED
|
@@ -38,7 +38,7 @@ export class Flags {
|
|
|
38
38
|
export type FlagsKeys = Exclude<keyof typeof Flags, 'prototype'>;
|
|
39
39
|
export type FlagsIds = (typeof Flags)[FlagsKeys];
|
|
40
40
|
|
|
41
|
-
const isFlagId = (id: string): id is FlagsIds =>
|
|
41
|
+
export const isFlagId = (id: string): id is FlagsIds =>
|
|
42
42
|
Object.getOwnPropertyNames(Flags).some((name: FlagsKeys) => Flags[name] === id);
|
|
43
43
|
|
|
44
44
|
/**
|
|
@@ -50,6 +50,10 @@ export class NumericParameters {
|
|
|
50
50
|
static AFKCountdownSecs = 'AFKCountdown' as const;
|
|
51
51
|
static MinQP = 'MinQP' as const;
|
|
52
52
|
static MaxQP = 'MaxQP' as const;
|
|
53
|
+
static MinQuality = 'MinQuality' as const;
|
|
54
|
+
static MaxQuality = 'MaxQuality' as const;
|
|
55
|
+
static CompatQualityMin = 'CompatQualityMin' as const;
|
|
56
|
+
static CompatQualityMax = 'CompatQualityMax' as const;
|
|
53
57
|
static WebRTCFPS = 'WebRTCFPS' as const;
|
|
54
58
|
static WebRTCMinBitrate = 'WebRTCMinBitrate' as const;
|
|
55
59
|
static WebRTCMaxBitrate = 'WebRTCMaxBitrate' as const;
|
|
@@ -60,7 +64,7 @@ export class NumericParameters {
|
|
|
60
64
|
export type NumericParametersKeys = Exclude<keyof typeof NumericParameters, 'prototype'>;
|
|
61
65
|
export type NumericParametersIds = (typeof NumericParameters)[NumericParametersKeys];
|
|
62
66
|
|
|
63
|
-
const isNumericId = (id: string): id is NumericParametersIds =>
|
|
67
|
+
export const isNumericId = (id: string): id is NumericParametersIds =>
|
|
64
68
|
Object.getOwnPropertyNames(NumericParameters).some(
|
|
65
69
|
(name: NumericParametersKeys) => NumericParameters[name] === id
|
|
66
70
|
);
|
|
@@ -76,7 +80,7 @@ export class TextParameters {
|
|
|
76
80
|
export type TextParametersKeys = Exclude<keyof typeof TextParameters, 'prototype'>;
|
|
77
81
|
export type TextParametersIds = (typeof TextParameters)[TextParametersKeys];
|
|
78
82
|
|
|
79
|
-
const isTextId = (id: string): id is TextParametersIds =>
|
|
83
|
+
export const isTextId = (id: string): id is TextParametersIds =>
|
|
80
84
|
Object.getOwnPropertyNames(TextParameters).some(
|
|
81
85
|
(name: TextParametersKeys) => TextParameters[name] === id
|
|
82
86
|
);
|
|
@@ -88,12 +92,13 @@ const isTextId = (id: string): id is TextParametersIds =>
|
|
|
88
92
|
export class OptionParameters {
|
|
89
93
|
static PreferredCodec = 'PreferredCodec' as const;
|
|
90
94
|
static StreamerId = 'StreamerId' as const;
|
|
95
|
+
static PreferredQuality = 'PreferredQuality' as const;
|
|
91
96
|
}
|
|
92
97
|
|
|
93
98
|
export type OptionParametersKeys = Exclude<keyof typeof OptionParameters, 'prototype'>;
|
|
94
99
|
export type OptionParametersIds = (typeof OptionParameters)[OptionParametersKeys];
|
|
95
100
|
|
|
96
|
-
const isOptionId = (id: string): id is OptionParametersIds =>
|
|
101
|
+
export const isOptionId = (id: string): id is OptionParametersIds =>
|
|
97
102
|
Object.getOwnPropertyNames(OptionParameters).some(
|
|
98
103
|
(name: OptionParametersKeys) => OptionParameters[name] === id
|
|
99
104
|
);
|
|
@@ -277,6 +282,20 @@ export class Config {
|
|
|
277
282
|
)
|
|
278
283
|
);
|
|
279
284
|
|
|
285
|
+
this.optionParameters.set(
|
|
286
|
+
OptionParameters.PreferredQuality,
|
|
287
|
+
new SettingOption(
|
|
288
|
+
OptionParameters.PreferredQuality,
|
|
289
|
+
'Preferred Quality',
|
|
290
|
+
'The preferred quality of the stream (only applicable when using the SFU)',
|
|
291
|
+
settings && Object.prototype.hasOwnProperty.call(settings, OptionParameters.PreferredQuality)
|
|
292
|
+
? settings[OptionParameters.PreferredQuality]!
|
|
293
|
+
: 'Default',
|
|
294
|
+
['Default'],
|
|
295
|
+
useUrlParams
|
|
296
|
+
)
|
|
297
|
+
);
|
|
298
|
+
|
|
280
299
|
/**
|
|
281
300
|
* Boolean parameters
|
|
282
301
|
*/
|
|
@@ -622,6 +641,66 @@ export class Config {
|
|
|
622
641
|
)
|
|
623
642
|
);
|
|
624
643
|
|
|
644
|
+
this.numericParameters.set(
|
|
645
|
+
NumericParameters.MinQuality,
|
|
646
|
+
new SettingNumber(
|
|
647
|
+
NumericParameters.MinQuality,
|
|
648
|
+
'Min Quality',
|
|
649
|
+
'The lower bound for the quality factor of the encoder. 0 = Worst quality, 100 = Best quality.',
|
|
650
|
+
0 /*min*/,
|
|
651
|
+
100 /*max*/,
|
|
652
|
+
settings && Object.prototype.hasOwnProperty.call(settings, NumericParameters.MinQuality)
|
|
653
|
+
? settings[NumericParameters.MinQuality]
|
|
654
|
+
: 0 /*value*/,
|
|
655
|
+
useUrlParams
|
|
656
|
+
)
|
|
657
|
+
);
|
|
658
|
+
|
|
659
|
+
this.numericParameters.set(
|
|
660
|
+
NumericParameters.MaxQuality,
|
|
661
|
+
new SettingNumber(
|
|
662
|
+
NumericParameters.MaxQuality,
|
|
663
|
+
'Max Quality',
|
|
664
|
+
'The upper bound for the quality factor of the encoder. 0 = Worst quality, 100 = Best quality.',
|
|
665
|
+
0 /*min*/,
|
|
666
|
+
100 /*max*/,
|
|
667
|
+
settings && Object.prototype.hasOwnProperty.call(settings, NumericParameters.MaxQuality)
|
|
668
|
+
? settings[NumericParameters.MaxQuality]
|
|
669
|
+
: 100 /*value*/,
|
|
670
|
+
useUrlParams
|
|
671
|
+
)
|
|
672
|
+
);
|
|
673
|
+
|
|
674
|
+
this.numericParameters.set(
|
|
675
|
+
NumericParameters.CompatQualityMin,
|
|
676
|
+
new SettingNumber(
|
|
677
|
+
NumericParameters.CompatQualityMin,
|
|
678
|
+
'Min Quality',
|
|
679
|
+
'The lower bound for encoding quality. 0 = Worst, 100 = Best.',
|
|
680
|
+
0 /*min*/,
|
|
681
|
+
100 /*max*/,
|
|
682
|
+
settings && Object.prototype.hasOwnProperty.call(settings, NumericParameters.CompatQualityMin)
|
|
683
|
+
? settings[NumericParameters.CompatQualityMin]
|
|
684
|
+
: 0 /*value*/,
|
|
685
|
+
useUrlParams
|
|
686
|
+
)
|
|
687
|
+
);
|
|
688
|
+
|
|
689
|
+
this.numericParameters.set(
|
|
690
|
+
NumericParameters.CompatQualityMax,
|
|
691
|
+
new SettingNumber(
|
|
692
|
+
NumericParameters.CompatQualityMax,
|
|
693
|
+
'Max Quality',
|
|
694
|
+
'The upper bound for encoding quality. 0 = Worst, 100 = Best.',
|
|
695
|
+
0 /*min*/,
|
|
696
|
+
100 /*max*/,
|
|
697
|
+
settings && Object.prototype.hasOwnProperty.call(settings, NumericParameters.CompatQualityMax)
|
|
698
|
+
? settings[NumericParameters.CompatQualityMax]
|
|
699
|
+
: 100 /*value*/,
|
|
700
|
+
useUrlParams
|
|
701
|
+
)
|
|
702
|
+
);
|
|
703
|
+
|
|
625
704
|
this.numericParameters.set(
|
|
626
705
|
NumericParameters.WebRTCFPS,
|
|
627
706
|
new SettingNumber(
|
|
@@ -7,8 +7,8 @@ import { SettingBase } from './SettingBase';
|
|
|
7
7
|
* A boolean flag setting object with a text label.
|
|
8
8
|
*/
|
|
9
9
|
export class SettingFlag<CustomIds extends string = FlagsIds> extends SettingBase {
|
|
10
|
-
id: FlagsIds | CustomIds;
|
|
11
|
-
onChangeEmit: (changedValue: boolean) => void;
|
|
10
|
+
override id: FlagsIds | CustomIds;
|
|
11
|
+
override onChangeEmit: (changedValue: boolean) => void;
|
|
12
12
|
|
|
13
13
|
constructor(
|
|
14
14
|
id: FlagsIds | CustomIds,
|
|
@@ -33,7 +33,7 @@ export class SettingFlag<CustomIds extends string = FlagsIds> extends SettingBas
|
|
|
33
33
|
this.useUrlParams = useUrlParams;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
protected getValueAsString(): string {
|
|
36
|
+
protected override getValueAsString(): string {
|
|
37
37
|
return this.flag ? 'true' : 'false';
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -10,8 +10,8 @@ export class SettingNumber<CustomIds extends string = NumericParametersIds> exte
|
|
|
10
10
|
_min: number | null;
|
|
11
11
|
_max: number | null;
|
|
12
12
|
|
|
13
|
-
id: NumericParametersIds | CustomIds;
|
|
14
|
-
onChangeEmit: (changedValue: number) => void;
|
|
13
|
+
override id: NumericParametersIds | CustomIds;
|
|
14
|
+
override onChangeEmit: (changedValue: number) => void;
|
|
15
15
|
|
|
16
16
|
constructor(
|
|
17
17
|
id: NumericParametersIds | CustomIds,
|
|
@@ -41,7 +41,7 @@ export class SettingNumber<CustomIds extends string = NumericParametersIds> exte
|
|
|
41
41
|
this.useUrlParams = useUrlParams;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
protected getValueAsString(): string {
|
|
44
|
+
protected override getValueAsString(): string {
|
|
45
45
|
return this.number.toString();
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -8,8 +8,8 @@ import { SettingBase } from './SettingBase';
|
|
|
8
8
|
* An Option setting object with a text label. Allows you to specify an array of options and select one of them.
|
|
9
9
|
*/
|
|
10
10
|
export class SettingOption<CustomIds extends string = OptionParametersIds> extends SettingBase {
|
|
11
|
-
id: OptionParametersIds | CustomIds;
|
|
12
|
-
onChangeEmit: (changedValue: string) => void;
|
|
11
|
+
override id: OptionParametersIds | CustomIds;
|
|
12
|
+
override onChangeEmit: (changedValue: string) => void;
|
|
13
13
|
_options: Array<string>;
|
|
14
14
|
|
|
15
15
|
/* Transforms the url parameter value into something else, by default no transformation is made, the url param is returned as-is. */
|
|
@@ -45,7 +45,7 @@ export class SettingOption<CustomIds extends string = OptionParametersIds> exten
|
|
|
45
45
|
this.useUrlParams = useUrlParams;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
protected getValueAsString(): string {
|
|
48
|
+
protected override getValueAsString(): string {
|
|
49
49
|
return this.selected;
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -7,9 +7,9 @@ import { SettingBase } from './SettingBase';
|
|
|
7
7
|
* A text setting object with a text label.
|
|
8
8
|
*/
|
|
9
9
|
export class SettingText<CustomIds extends string = TextParametersIds> extends SettingBase {
|
|
10
|
-
id: TextParametersIds | CustomIds;
|
|
11
|
-
onChangeEmit: (changedValue: string) => void;
|
|
12
|
-
useUrlParams: boolean;
|
|
10
|
+
override id: TextParametersIds | CustomIds;
|
|
11
|
+
override onChangeEmit: (changedValue: string) => void;
|
|
12
|
+
override useUrlParams: boolean;
|
|
13
13
|
|
|
14
14
|
constructor(
|
|
15
15
|
id: TextParametersIds | CustomIds,
|
|
@@ -33,7 +33,7 @@ export class SettingText<CustomIds extends string = TextParametersIds> extends S
|
|
|
33
33
|
this.useUrlParams = useUrlParams;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
protected getValueAsString(): string {
|
|
36
|
+
protected override getValueAsString(): string {
|
|
37
37
|
return this.text;
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -49,7 +49,7 @@ export class DataChannelController {
|
|
|
49
49
|
this.dataChannel.onopen = (ev: Event) => this.handleOnOpen(ev);
|
|
50
50
|
this.dataChannel.onclose = (ev: Event) => this.handleOnClose(ev);
|
|
51
51
|
this.dataChannel.onmessage = (ev: MessageEvent) => this.handleOnMessage(ev);
|
|
52
|
-
this.dataChannel.onerror = (ev:
|
|
52
|
+
this.dataChannel.onerror = (ev: Event) => this.handleOnError(ev);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
/**
|
|
@@ -81,7 +81,7 @@ export class DataChannelController {
|
|
|
81
81
|
* Handles when an error is thrown
|
|
82
82
|
* @param event - Error Event
|
|
83
83
|
*/
|
|
84
|
-
handleOnError(event:
|
|
84
|
+
handleOnError(event: Event) {
|
|
85
85
|
Logger.Info(`Data Channel (${this.label}) error: ${event}`);
|
|
86
86
|
this.onError(this.dataChannel?.label, event);
|
|
87
87
|
}
|
|
@@ -33,7 +33,7 @@ export class MouseControllerHovering extends MouseController {
|
|
|
33
33
|
this.onContextMenuListener = this.onContextMenu.bind(this);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
register(): void {
|
|
36
|
+
override register(): void {
|
|
37
37
|
super.register();
|
|
38
38
|
|
|
39
39
|
this.videoElementParent.addEventListener('mousemove', this.onMouseMoveListener);
|
|
@@ -44,7 +44,7 @@ export class MouseControllerHovering extends MouseController {
|
|
|
44
44
|
this.videoElementParent.addEventListener('dblclick', this.onMouseDblClickListener);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
unregister(): void {
|
|
47
|
+
override unregister(): void {
|
|
48
48
|
this.videoElementParent.removeEventListener('mousemove', this.onMouseMoveListener);
|
|
49
49
|
this.videoElementParent.removeEventListener('mousedown', this.onMouseDownListener);
|
|
50
50
|
this.videoElementParent.removeEventListener('mouseup', this.onMouseUpListener);
|
|
@@ -44,7 +44,7 @@ export class MouseControllerLocked extends MouseController {
|
|
|
44
44
|
this.onMouseMoveListener = this.onMouseMove.bind(this);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
register() {
|
|
47
|
+
override register() {
|
|
48
48
|
super.register();
|
|
49
49
|
|
|
50
50
|
this.videoElementParent.requestPointerLock =
|
|
@@ -64,7 +64,7 @@ export class MouseControllerLocked extends MouseController {
|
|
|
64
64
|
this.videoElementParent.addEventListener('dblclick', this.onMouseDblClickListener);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
unregister() {
|
|
67
|
+
override unregister() {
|
|
68
68
|
const pointerLockElement = document.pointerLockElement || document.mozPointerLockElement;
|
|
69
69
|
if (document.exitPointerLock && pointerLockElement === this.videoElementParent) {
|
|
70
70
|
document.exitPointerLock();
|
|
@@ -428,18 +428,18 @@ export class PeerConnectionController {
|
|
|
428
428
|
) {
|
|
429
429
|
// Get our preferred codec from the codecs options drop down
|
|
430
430
|
const preferredRTPCodec = this.preferredCodec.split(' ');
|
|
431
|
-
const preferredRTCRtpCodecCapability:
|
|
431
|
+
const preferredRTCRtpCodecCapability: RTCRtpCodec = {
|
|
432
432
|
mimeType: 'video/' + preferredRTPCodec[0] /* Name */,
|
|
433
433
|
clockRate: 90000 /* All current video formats in browsers have 90khz clock rate */,
|
|
434
434
|
sdpFmtpLine: preferredRTPCodec[1] ? preferredRTPCodec[1] : ''
|
|
435
435
|
};
|
|
436
436
|
|
|
437
437
|
// Populate a list of codecs we will support with our preferred one in the first position
|
|
438
|
-
const ourSupportedCodecs: Array<
|
|
438
|
+
const ourSupportedCodecs: Array<RTCRtpCodec> = [preferredRTCRtpCodecCapability];
|
|
439
439
|
|
|
440
440
|
// Go through all codecs the browser supports and add them to the list (in any order)
|
|
441
441
|
RTCRtpReceiver.getCapabilities('video').codecs.forEach(
|
|
442
|
-
(browserSupportedCodec:
|
|
442
|
+
(browserSupportedCodec: RTCRtpCodec) => {
|
|
443
443
|
// Don't add our preferred codec again, but add everything else
|
|
444
444
|
if (browserSupportedCodec.mimeType != preferredRTCRtpCodecCapability.mimeType) {
|
|
445
445
|
ourSupportedCodecs.push(browserSupportedCodec);
|
|
@@ -626,11 +626,11 @@ export class PeerConnectionController {
|
|
|
626
626
|
const sections = splitSections(rtcSessionDescription.sdp);
|
|
627
627
|
// discard the session information as we only want media related info
|
|
628
628
|
sections.shift();
|
|
629
|
-
sections.forEach((mediaSection) => {
|
|
629
|
+
sections.forEach((mediaSection: any) => {
|
|
630
630
|
const { codecs } = parseRtpParameters(mediaSection);
|
|
631
631
|
// Filter only for VPX / H26X / AV1
|
|
632
632
|
const matcher = /(VP\d|H26\d|AV1).*/;
|
|
633
|
-
codecs.forEach((c) => {
|
|
633
|
+
codecs.forEach((c: any) => {
|
|
634
634
|
const str =
|
|
635
635
|
c.name +
|
|
636
636
|
' ' +
|
|
@@ -183,19 +183,58 @@ export class PixelStreaming {
|
|
|
183
183
|
this._webRtcController.setGamePadInputEnabled(isEnabled);
|
|
184
184
|
});
|
|
185
185
|
|
|
186
|
-
//
|
|
186
|
+
// direct qp settings
|
|
187
187
|
this.config._addOnNumericSettingChangedListener(NumericParameters.MinQP, (newValue: number) => {
|
|
188
188
|
Logger.Info('-------- Sending MinQP --------');
|
|
189
189
|
this._webRtcController.sendEncoderMinQP(newValue);
|
|
190
190
|
Logger.Info('-------------------------------------------');
|
|
191
|
+
const quality = Math.trunc(100 * (1 - newValue / 51));
|
|
192
|
+
this.config.setNumericSetting(NumericParameters.CompatQualityMax, quality);
|
|
191
193
|
});
|
|
192
194
|
|
|
193
195
|
this.config._addOnNumericSettingChangedListener(NumericParameters.MaxQP, (newValue: number) => {
|
|
194
|
-
Logger.Info('-------- Sending
|
|
196
|
+
Logger.Info('-------- Sending MaxQP --------');
|
|
195
197
|
this._webRtcController.sendEncoderMaxQP(newValue);
|
|
196
198
|
Logger.Info('-------------------------------------------');
|
|
199
|
+
const quality = Math.trunc(100 * (1 - newValue / 51));
|
|
200
|
+
this.config.setNumericSetting(NumericParameters.CompatQualityMin, quality);
|
|
197
201
|
});
|
|
198
202
|
|
|
203
|
+
// direct quality factor settings
|
|
204
|
+
this.config._addOnNumericSettingChangedListener(NumericParameters.MinQuality, (newValue: number) => {
|
|
205
|
+
Logger.Info('-------- Sending MinQuality --------');
|
|
206
|
+
this._webRtcController.sendEncoderMinQuality(newValue);
|
|
207
|
+
Logger.Info('-------------------------------------------');
|
|
208
|
+
this.config.setNumericSetting(NumericParameters.CompatQualityMin, newValue);
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
this.config._addOnNumericSettingChangedListener(NumericParameters.MaxQuality, (newValue: number) => {
|
|
212
|
+
Logger.Info('-------- Sending MaxQuality --------');
|
|
213
|
+
this._webRtcController.sendEncoderMaxQuality(newValue);
|
|
214
|
+
Logger.Info('-------------------------------------------');
|
|
215
|
+
this.config.setNumericSetting(NumericParameters.CompatQualityMax, newValue);
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
// new quality value that gets scaled to qp for legacy reasons
|
|
219
|
+
this.config._addOnNumericSettingChangedListener(
|
|
220
|
+
NumericParameters.CompatQualityMin,
|
|
221
|
+
(newValue: number) => {
|
|
222
|
+
newValue = 51 - (newValue / 100) * 51;
|
|
223
|
+
Logger.Info('-------- Sending MinQP from quality value --------');
|
|
224
|
+
this._webRtcController.sendEncoderMaxQP(newValue);
|
|
225
|
+
Logger.Info('-------------------------------------------');
|
|
226
|
+
}
|
|
227
|
+
);
|
|
228
|
+
|
|
229
|
+
this.config._addOnNumericSettingChangedListener(
|
|
230
|
+
NumericParameters.CompatQualityMax,
|
|
231
|
+
(newValue: number) => {
|
|
232
|
+
newValue = 51 - (newValue / 100) * 51;
|
|
233
|
+
Logger.Info('-------- Sending MaxQP from quality value --------');
|
|
234
|
+
this._webRtcController.sendEncoderMinQP(newValue);
|
|
235
|
+
Logger.Info('-------------------------------------------');
|
|
236
|
+
}
|
|
237
|
+
);
|
|
199
238
|
// WebRTC settings
|
|
200
239
|
this.config._addOnNumericSettingChangedListener(
|
|
201
240
|
NumericParameters.WebRTCMinBitrate,
|
|
@@ -531,20 +570,60 @@ export class PixelStreaming {
|
|
|
531
570
|
const urlParams = new IURLSearchParams(window.location.search);
|
|
532
571
|
Logger.Info(`using URL parameters ${useUrlParams}`);
|
|
533
572
|
if (settings.EncoderSettings) {
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
573
|
+
// here we should either get Min/MaxQP from PS1
|
|
574
|
+
// or Min/MaxQuality from PS2
|
|
575
|
+
// we only want to set one set or the other as they converge in CompatQualityMin/Max and
|
|
576
|
+
// we dont want to have them conflict with default values.
|
|
577
|
+
if (settings.EncoderSettings.MinQP) {
|
|
578
|
+
this.config.setNumericSetting(
|
|
579
|
+
NumericParameters.MinQP,
|
|
580
|
+
// If a setting is set in the URL, make sure we respect that value as opposed to what the application sends us
|
|
581
|
+
useUrlParams && urlParams.has(NumericParameters.MinQP)
|
|
582
|
+
? Number.parseFloat(urlParams.get(NumericParameters.MinQP))
|
|
583
|
+
: settings.EncoderSettings.MinQP || 0
|
|
584
|
+
);
|
|
541
585
|
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
586
|
+
this.config.setNumericSetting(
|
|
587
|
+
NumericParameters.MaxQP,
|
|
588
|
+
useUrlParams && urlParams.has(NumericParameters.MaxQP)
|
|
589
|
+
? Number.parseFloat(urlParams.get(NumericParameters.MaxQP))
|
|
590
|
+
: settings.EncoderSettings.MaxQP || 51
|
|
591
|
+
);
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
if (settings.EncoderSettings.MinQuality) {
|
|
595
|
+
this.config.setNumericSetting(
|
|
596
|
+
NumericParameters.MinQuality,
|
|
597
|
+
// If a setting is set in the URL, make sure we respect that value as opposed to what the application sends us
|
|
598
|
+
useUrlParams && urlParams.has(NumericParameters.MinQuality)
|
|
599
|
+
? Number.parseFloat(urlParams.get(NumericParameters.MinQuality))
|
|
600
|
+
: settings.EncoderSettings.MinQuality || 0
|
|
601
|
+
);
|
|
602
|
+
|
|
603
|
+
this.config.setNumericSetting(
|
|
604
|
+
NumericParameters.MaxQuality,
|
|
605
|
+
useUrlParams && urlParams.has(NumericParameters.MaxQuality)
|
|
606
|
+
? Number.parseFloat(urlParams.get(NumericParameters.MaxQuality))
|
|
607
|
+
: settings.EncoderSettings.MaxQuality || 100
|
|
608
|
+
);
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
// these two are just used to converge quality and qp and behave slightly differently since they
|
|
612
|
+
// shouldnt exist in EncoderSettings
|
|
613
|
+
if (useUrlParams) {
|
|
614
|
+
if (urlParams.has(NumericParameters.CompatQualityMin)) {
|
|
615
|
+
this.config.setNumericSetting(
|
|
616
|
+
NumericParameters.CompatQualityMin,
|
|
617
|
+
Number.parseFloat(urlParams.get(NumericParameters.CompatQualityMin))
|
|
618
|
+
);
|
|
619
|
+
}
|
|
620
|
+
if (urlParams.has(NumericParameters.CompatQualityMax)) {
|
|
621
|
+
this.config.setNumericSetting(
|
|
622
|
+
NumericParameters.CompatQualityMax,
|
|
623
|
+
Number.parseFloat(urlParams.get(NumericParameters.CompatQualityMax))
|
|
624
|
+
);
|
|
625
|
+
}
|
|
626
|
+
}
|
|
548
627
|
}
|
|
549
628
|
if (settings.WebRTCSettings) {
|
|
550
629
|
this.config.setNumericSetting(
|