Skip to content

Commit

Permalink
Merge pull request #28 from EpicGamesExt/master
Browse files Browse the repository at this point in the history
Merging main into 5.4
  • Loading branch information
mcottontensor committed Mar 12, 2024
2 parents a56174b + fd24a45 commit 4f8383c
Show file tree
Hide file tree
Showing 14 changed files with 104 additions and 46 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/run-signalling-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Run signalling tests

on:
workflow_dispatch:
push:
branches: ['signalling_tester']
paths: ['SignallingWebServer/**']
pull_request:
branches: ['signalling_tester']
paths: ['SS_Test/**']

jobs:

build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./

permissions:
contents: write

steps:
- name: "Checkout source code"
uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'

- name: Run signalling server
working-directory: ./SignallingWebServer
run: ./platform_scripts/bash/run_local.sh &

- name: Install library deps
working-directory: ./SS_Test
run: npm ci

- name: Run frontend lib tests
working-directory: ./SS_Test
run: npm run start
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The changelog is a summary of commits between releases of Unreal Engine.

As a reminder each UE-X branch/tag in this repository corresponds to a version of Unreal Engine.

## [UE 5.3 (Current)](https://github.com/EpicGames/PixelStreamingInfrastructure/commits/UE5.3)
## [UE 5.3 (Current)](https://github.com/EpicGamesExt/PixelStreamingInfrastructure/commits/UE5.3)

### Features
- Protocol structures can now contain strings by @Belchy06 in https://github.com/EpicGames/PixelStreamingInfrastructure/pull/336
Expand Down
14 changes: 7 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Please remain patient, courteous, and professional at all times. Any form of spa
### Creating issues

If you have encountered a bug, have suggestions for our documentation or infrastructure, or would like to propose a feature that could enhance Pixel Streaming in various use case scenarios, you can raise this with us by creating a new issue.
1. First, search all open and closed issues [here](https://github.com/EpicGames/PixelStreamingInfrastructure/issues?q=is%3Aissue+) - your issue may have already been discussed or addressed.
2. If your issue doesn't exist, open a new issue [here](https://github.com/EpicGames/PixelStreamingInfrastructure/issues/new/choose) by selecting a bug or feature request.
1. First, search all open and closed issues [here](https://github.com/EpicGamesExt/PixelStreamingInfrastructure/issues?q=is%3Aissue+) or in the [legacy repository](https://github.com/EpicGames/PixelStreamingInfrastructure/issues?q=is%3Aissue+is%3Aclosed) - your issue may have already been discussed or addressed.
2. If your issue doesn't exist, open a new issue [here](https://github.com/EpicGamesExt/PixelStreamingInfrastructure/issues/new/choose) by selecting a bug or feature request.
3. Make sure to fill in the template as much as possible; any information you can provide, such as repro steps, crash stacks, screenshots, etc., can help us triage and fix the problem as quickly as possible.
4. Keep an eye on the status of your issue; our developers or other users might reach out with requests for more information. If this happens, issues that have not received a response in over 30 days will be automatically closed.
5. Be patient while waiting on a resolution; we prioritize the issues internally and some less critical features (however much we'd love to implement them!) will take a backseat to more pressing priorities, so some issues can take a while to get resolved.
Expand All @@ -27,17 +27,17 @@ If you have a solution to a problem you've encountered or to any other open issu
1. Fork the repo and branch off of the `main` branch in your fork.
2. Implement your changes in your branch and make sure your commits are Verified! Signed commits are required for merging! [Github Signing Documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification)
3. Do as much testing as you can, and when you are happy, tidy up your work and commit the update.
4. Create a [pull request](https://github.com/EpicGames/PixelStreamingInfrastructure/pulls) and don't forget to link it to an issue if there's an existing one. Add as much information as possible to your PR: describe the problem your change solves, mention any testing you have done and attach any relevant documents and screenshots.
4. Create a [pull request](https://github.com/EpicGamesExt/PixelStreamingInfrastructure/pulls) and don't forget to link it to an issue if there's an existing one. Add as much information as possible to your PR: describe the problem your change solves, mention any testing you have done and attach any relevant documents and screenshots.
5. If your are contributing a PR for a new feature, we strongly encourage you to accompany it with relevant documentation and a detailed description of the tests you have done. PRs that don't have this information may take a long time to be addressed, since our team will have to do the testing.
6. If your PR is good to go, we will merge it in. Woohoo! Thank you for your time and efforts! 🎉
7. Keep a close eye on your PR - quite often, our developers will review your PR and leave comments; we might request some minor code changes and modifications, style unification, or leave any general comments and questions that are preventing us from merging the PR.
8. If we do not hear from you after requesting more information within 30 days, the PR will auto-close. In this case, we might elect to open our own PR and re-use some of the changes that you proposed, supplemented with anything else that was required to be added in your original PR.
9. If your PR fixes a problem in the previous [still-supported UE branches](https://github.com/EpicGames/PixelStreamingInfrastructure#versions), feel free to add the `auto-backport` and `auto-backport-to-UEX.X` labels. You'll need to add a `auto-backport-to-UEX.X` label for each branch you wish your change to be merged back to. Note that if a change to any of the previous branches is not trivial and requires a lot of testing and compatibility checks, we might elect to close it if we do not think that it brings enough value to the branch.
9. If your PR fixes a problem in the previous [still-supported UE branches](https://github.com/EpicGamesExt/PixelStreamingInfrastructure#versions), feel free to add the `auto-backport` and `auto-backport-to-UEX.X` labels. You'll need to add a `auto-backport-to-UEX.X` label for each branch you wish your change to be merged back to. Note that if a change to any of the previous branches is not trivial and requires a lot of testing and compatibility checks, we might elect to close it if we do not think that it brings enough value to the branch.

### Other ways to contribute

- Keep an eye on our repo and stay active on existing issues and PRs; you can help by adding informative comments to the discussions, additional repro steps, repros in different environments, or any suggestions as to what could be causing the issue and how it could be solved.
- Work on [issues labeled for community](https://github.com/EpicGames/PixelStreamingInfrastructure/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22). We specifically created this label to mark issues that we would love the community to help us with.
- Work on [issues labeled for community](https://github.com/EpicGamesExt/PixelStreamingInfrastructure/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22). We specifically created this label to mark issues that we would love the community to help us with.
- Create documentation for undocumented features. Please open an issue first, so our developers can provide you with some guidance.
- Write more unit test coverage.
- Document functions in the public API that are not documented.
Expand All @@ -46,10 +46,10 @@ If you have a solution to a problem you've encountered or to any other open issu

## Coding style
- TypeScript should be used over JavaScript.
- All TypeScript should adhere to the following [linting rules](https://github.com/EpicGames/PixelStreamingInfrastructure/blob/master/Frontend/library/.eslintrc.js).
- All TypeScript should adhere to the following [linting rules](https://github.com/EpicGamesExt/PixelStreamingInfrastructure/blob/master/Frontend/library/.eslintrc.js).
- Names should follow US English spelling.
- All public functions/API should have comments.
- Code formatting should adhere to the following [whitespace and indentation rules](https://github.com/EpicGames/PixelStreamingInfrastructure/blob/master/Frontend/library/.prettierrc.json).
- Code formatting should adhere to the following [whitespace and indentation rules](https://github.com/EpicGamesExt/PixelStreamingInfrastructure/blob/master/Frontend/library/.prettierrc.json).
- All new features should have accompanying unit tests and documentation when they are submitted.
- Prefer early returns in `if` statements to decrease indentation.
- Prefer functions to not exceed ~20 lines.
Expand Down
4 changes: 2 additions & 2 deletions Frontend/Docs/Timing Out Inactive Connections.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ If the user continues not to respond, the AFK system waits 10 more seconds befor

Any user interaction with the player panel resets the AFK timer. This includes mouse moves and drags, mouse button presses, keyboard presses, touch events on mobile devices, and custom interactions you set up with the `emitCommand` and `emitUIInteraction` functions.

To use the AFK system, set the following properties in the [`Config`](https://github.com/EpicGames/PixelStreamingInfrastructure/blob/master/Frontend/library/src/Config/Config.ts) object passed used to create a [`PixelStreaming`](https://github.com/EpicGames/PixelStreamingInfrastructure/blob/master/Frontend/library/src/PixelStreaming/PixelStreaming.tx) stream.
To use the AFK system, set the following properties in the [`Config`](https://github.com/EpicGamesExt/PixelStreamingInfrastructure/blob/master/Frontend/library/src/Config/Config.ts) object passed used to create a [`PixelStreaming`](https://github.com/EpicGamesExt/PixelStreamingInfrastructure/blob/master/Frontend/library/src/PixelStreaming/PixelStreaming.tx) stream.

| Property | Default | Description |
| --- | --- |
Expand All @@ -30,5 +30,5 @@ const stream = new PixelStreaming(config);
```

**_Tip:_**
If you want to customize the content of the overlay, you can replace the [`AFKOverlay`](https://github.com/EpicGames/PixelStreamingInfrastructure/blob/master/Frontend/ui-library/src/Overlay/AFKOverlay.ts) class. You must then also extend the [`Application`](https://github.com/EpicGames/PixelStreamingInfrastructure/blob/master/Frontend/ui-library/src/Application/Application.ts) class in order to use the new overlay.
If you want to customize the content of the overlay, you can replace the [`AFKOverlay`](https://github.com/EpicGamesExt/PixelStreamingInfrastructure/blob/master/Frontend/ui-library/src/Overlay/AFKOverlay.ts) class. You must then also extend the [`Application`](https://github.com/EpicGamesExt/PixelStreamingInfrastructure/blob/master/Frontend/ui-library/src/Application/Application.ts) class in order to use the new overlay.

4 changes: 2 additions & 2 deletions Frontend/library/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Frontend/library/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
},
"repository": {
"type": "git",
"url": "https://github.com/EpicGames/PixelStreamingInfrastructure.git"
"url": "https://github.com/EpicGamesExt/PixelStreamingInfrastructure.git"
},
"author": "Epic Games",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion Frontend/library/src/Config/SettingOption.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class SettingOption<
// eslint-disable-next-line @typescript-eslint/no-empty-function
defaultOnChangeListener: (changedValue: unknown, setting: SettingBase) => void = () => { /* Do nothing, to be overridden. */ }
) {
super(id, label, description, [defaultTextValue], defaultOnChangeListener);
super(id, label, description, defaultTextValue, defaultOnChangeListener);

this.options = options;
const urlParams = new URLSearchParams(window.location.search);
Expand Down
17 changes: 16 additions & 1 deletion Frontend/library/src/PeerConnectionController/AggregatedStats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export class AggregatedStats {
sessionStats: SessionStats;
streamStats: StreamStats;
codecs: Map<string, string>;
transportStats: RTCTransportStats;

constructor() {
this.inboundVideoStats = new InboundVideoStats();
Expand Down Expand Up @@ -94,6 +95,7 @@ export class AggregatedStats {
this.handleTrack(stat);
break;
case 'transport':
this.handleTransport(stat);
break;
case 'stream':
this.handleStream(stat);
Expand Down Expand Up @@ -267,6 +269,11 @@ export class AggregatedStats {
}
}

handleTransport(stat: RTCTransportStats){
this.transportStats = stat;
}


handleCodec(stat: CodecStats) {
const codecId = stat.id;
const codecType = `${stat.mimeType
Expand Down Expand Up @@ -312,6 +319,14 @@ export class AggregatedStats {
* @returns The candidate pair that is currently receiving data
*/
public getActiveCandidatePair(): CandidatePairStats | null {
return this.candidatePairs.find((candidatePair) => candidatePair.bytesReceived > 0, null)

// Check if the RTCTransport stat is not undefined
if (this.transportStats){
// Return the candidate pair that matches the transport candidate pair id
return this.candidatePairs.find((candidatePair) => candidatePair.id === this.transportStats.selectedCandidatePairId, null);
}

// Fall back to the selected candidate pair
return this.candidatePairs.find((candidatePair) => candidatePair.selected, null);
}
}
2 changes: 1 addition & 1 deletion Frontend/ui-library/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
"repository": {
"type": "git",
"url": "https://github.com/EpicGames/PixelStreamingInfrastructure.git"
"url": "https://github.com/EpicGamesExt/PixelStreamingInfrastructure.git"
},
"author": "Epic Games",
"license": "MIT",
Expand Down

0 comments on commit 4f8383c

Please sign in to comment.