Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Add TCP+Relay detection event #485

Merged
merged 22 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
8b5bbd8
Change the label for the remote candidate
david-macpherson Feb 13, 2024
daff998
Added the following missing properties id,timestamp,type,lastPacketRe…
david-macpherson Feb 13, 2024
5542d91
Added relayProtocol and transport ID to the candidate Stat
david-macpherson Feb 13, 2024
1be9ed5
Added relayProtocol and transport ID to the candidate Stat
david-macpherson Feb 13, 2024
03ee5b6
Set the parsed candidate pair stat to the nominated and selected pair
david-macpherson Feb 13, 2024
7d97eb1
Implemeneted a stream waring event
david-macpherson Feb 14, 2024
f05ce78
Implemented the emitting of the stream warning event when if the loca…
david-macpherson Feb 14, 2024
5b9f8b0
Fixed up styling
david-macpherson Feb 14, 2024
1b8e9c3
Refactored the candidate pair to an array, Implemneted a helper funct…
david-macpherson Feb 15, 2024
86fbdb2
Refactored to use Array.find
david-macpherson Feb 15, 2024
0e89638
Replaced the stream warning event with WebRtcTCPRelayDetectedEvent
david-macpherson Feb 15, 2024
bdf41af
Implemeneted the WebRtcTCPRelayDetectedEvent to dispatch if the web r…
david-macpherson Feb 15, 2024
55d02d6
Refactored the stats panel to use the getActiveCandidatePair
david-macpherson Feb 15, 2024
fb6bf16
Refactored the webrtc tcp detect check to act on an event instead of …
david-macpherson Feb 15, 2024
533d88a
Refactored the getting of the active candidate pair to be stored as a…
david-macpherson Feb 15, 2024
9d26239
Updated the candidate pair to the candidate pairs array
david-macpherson Feb 15, 2024
7eab39d
Added a warning if the stream is relayed over tcp
david-macpherson Feb 15, 2024
51babfd
Moved the logic for emitting the webrtc tcp relay detect event to it'…
david-macpherson Feb 15, 2024
d00bf75
Refactored the binding of the stats recieved event to the setup web r…
david-macpherson Feb 16, 2024
8567df6
Removed un needed new lines
david-macpherson Feb 16, 2024
15ed4ad
Added a check if the get active candidate is null to return a new can…
david-macpherson Feb 16, 2024
ad24cc9
Reverted the refactor the binding of the stats recieved event function
david-macpherson Feb 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions Frontend/library/src/PixelStreaming/PixelStreaming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,11 @@ export class PixelStreaming {

this._webXrController = new WebXRController(this._webRtcController);

this._setupWebRtcTCPRelayDetection = this._setupWebRtcTCPRelayDetection.bind(this)

// Add event listener for the webRtcConnected event
this._eventEmitter.addEventListener("webRtcConnected", (webRtcConnectedEvent: WebRtcConnectedEvent) => {

// Bind to the stats received event
this._eventEmitter.addEventListener("statsReceived", this._setupWebRtcTCPRelayDetection);

this._eventEmitter.addEventListener("statsReceived", (statsReceivedEvent: StatsReceivedEvent) => { this._setupWebRtcTCPRelayDetection(statsReceivedEvent)});
});
}

Expand Down Expand Up @@ -657,7 +654,7 @@ export class PixelStreaming {
this._eventEmitter.dispatchEvent(new WebRtcTCPRelayDetectedEvent());
}
// The check is completed and the stats listen event can be removed
this._eventEmitter.removeEventListener("statsReceived", this._setupWebRtcTCPRelayDetection);
this._eventEmitter.removeEventListener("statsReceived", (statsReceivedEvent: StatsReceivedEvent) => { this._setupWebRtcTCPRelayDetection(statsReceivedEvent)});
lukehb marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down
6 changes: 3 additions & 3 deletions Frontend/ui-library/src/UI/StatsPanel.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright Epic Games, Inc. All Rights Reserved.

import { LatencyTest } from './LatencyTest';
import { InitialSettings, Logger, PixelStreaming } from '@epicgames-ps/lib-pixelstreamingfrontend-ue5.4';
import { CandidatePairStats, InitialSettings, Logger, PixelStreaming } from '@epicgames-ps/lib-pixelstreamingfrontend-ue5.4';
import { AggregatedStats } from '@epicgames-ps/lib-pixelstreamingfrontend-ue5.4';
import { MathUtils } from '../Util/MathUtils';
import {DataChannelLatencyTest} from "./DataChannelLatencyTest";
Expand Down Expand Up @@ -318,8 +318,8 @@ export class StatsPanel {
);
}

// Store the active candidate pair
let activeCandidatePair = stats.getActiveCandidatePair();
// Store the active candidate pair return a new Candidate pair stat if getActiveCandidate is null
let activeCandidatePair = stats.getActiveCandidatePair() != null ? stats.getActiveCandidatePair() : new CandidatePairStats();

// RTT
const netRTT =
Expand Down
Loading