Skip to content

Commit 5fb2c83

Browse files
author
lijiahao
committed
feat: FSR
1 parent 70c1907 commit 5fb2c83

File tree

20 files changed

+154
-47
lines changed

20 files changed

+154
-47
lines changed

app/background.js

Lines changed: 4 additions & 2 deletions
Large diffs are not rendered by default.

app/preload.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flatpak/io.github.Geocld.XStreamingDesktop.metainfo.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@
3434
</screenshot>
3535
</screenshots>
3636
<releases>
37-
<release version="1.8.10" date="2025-10-30">
37+
<release version="1.9.0" date="2025-11-05">
3838
<description>
3939
<ul>
4040
<li>Changes:</li>
41+
<li>FidelityFX Super Resolution 1.0 supported.</li>
4142
<li>Add『background keepalive』option to keep input when app in backgroud.</li>
4243
<li>Update some warning text.</li>
4344
</ul>

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"private": true,
33
"name": "xstreaming",
44
"description": "xstreaming",
5-
"version": "1.8.10",
5+
"version": "1.9.0",
66
"author": "Geocld <lijiahao5372@gmail.com>",
77
"main": "app/background.js",
88
"scripts": {
@@ -37,10 +37,11 @@
3737
"react-i18next": "^15.0.1",
3838
"react-query": "^3.39.3",
3939
"semver": "^7.6.3",
40+
"three": "0.150.1",
4041
"uplot": "^1.6.30",
4142
"uuid-1345": "^1.0.2",
4243
"xbox-webapi": "^1.4.1",
43-
"xstreaming-player": "0.2.21",
44+
"xstreaming-player": "0.2.22",
4445
"xvfb-maybe": "^0.2.1"
4546
},
4647
"devDependencies": {

renderer/common/settings.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,27 @@ const getSettingsMetas = (t) => {
9898
{value: true, label: t('Enable')},
9999
],
100100
},
101+
{
102+
name: 'fsr',
103+
type: 'radio',
104+
title: t('FSR'),
105+
description: t('FSR_desc'),
106+
needRestart: false,
107+
data: [
108+
{value: false, label: t('Disable')},
109+
{value: true, label: t('Enable')},
110+
],
111+
},
112+
{
113+
name: 'fsr_sharpness',
114+
type: 'slider',
115+
min: 0,
116+
max: 10,
117+
step: 1,
118+
title: t('fsr_sharpness_title'),
119+
description: t('fsr_sharpness_desc'),
120+
data: [],
121+
},
101122
],
102123
streaming: [
103124
{

renderer/components/ActionBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function ActionBar(props) {
7474
}
7575

7676
{
77-
props.connectState === CONNECTED && (
77+
(props.connectState === CONNECTED && !settings.fsr) && (
7878
<DropdownItem key="display" onClick={handleDisplay}>
7979
{t("Display settings")}
8080
</DropdownItem>

renderer/context/userContext.defaults.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,7 @@ export const defaultSettings = {
6464
contrast: 100,
6565
brightness: 100,
6666
},
67+
fsr: false,
68+
fsr_sharpness: 2,
6769
debug: false,
6870
};

renderer/pages/[locale]/stream.tsx

Lines changed: 60 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { useTranslation } from "next-i18next";
33
import { useRouter } from "next/router";
44
import { useEffect, useRef, useState } from "react";
55
import xStreamingPlayer from "xstreaming-player";
6+
import { addToast } from "@heroui/react";
67
import ActionBar from "../../components/ActionBar";
78
import Display from "../../components/Display";
89
import Audio from "../../components/Audio";
@@ -147,6 +148,9 @@ function Stream() {
147148
// Set deadzone
148149
xPlayer.setGamepadDeadZone(settings.dead_zone);
149150

151+
// Set fsr sharpness
152+
xPlayer.setFsrSharpness(settings.fsr_sharpness);
153+
150154
// Set gamepad maping
151155
if (settings.gamepad_maping) {
152156
xPlayer.setGamepadMaping(settings.gamepad_maping)
@@ -285,6 +289,22 @@ function Stream() {
285289
if (event.state === "connected") {
286290
setLoadingText(t("Connected"));
287291

292+
if (settings.fsr) {
293+
setTimeout(() => {
294+
xPlayer && xPlayer.startFSR(() => {
295+
addToast({
296+
title: t('FSR started'),
297+
color: 'success'
298+
});
299+
});
300+
301+
const videoHolder = document.getElementById('videoHolder');
302+
const canvasContainer = document.getElementById('canvas-container');
303+
videoHolder.style.visibility = 'hidden';
304+
canvasContainer.style.visibility = 'visible';
305+
}, 3000)
306+
}
307+
288308
setTimeout(() => {
289309
setLoading(false);
290310

@@ -312,38 +332,40 @@ function Stream() {
312332
}
313333

314334
// Refresh video player
315-
setTimeout(() => {
316-
const _displayOptions = window.localStorage.getItem(DISPLAY_KEY);
317-
318-
let displayOptions: any = DEFAULT_OPTIONS;
319-
if (_displayOptions) {
320-
try {
321-
displayOptions = JSON.parse(_displayOptions);
322-
} catch {
323-
displayOptions = DEFAULT_OPTIONS;
335+
if (!settings.fsr) {
336+
setTimeout(() => {
337+
const _displayOptions = window.localStorage.getItem(DISPLAY_KEY);
338+
339+
let displayOptions: any = DEFAULT_OPTIONS;
340+
if (_displayOptions) {
341+
try {
342+
displayOptions = JSON.parse(_displayOptions);
343+
} catch {
344+
displayOptions = DEFAULT_OPTIONS;
345+
}
324346
}
325-
}
326347

327-
const videoStyle = document.getElementById("video-css");
328-
console.log('Refresh video player:', displayOptions)
329-
const filters = getVideoPlayerFilterStyle(displayOptions);
330-
let videoCss = "";
331-
if (filters) {
332-
videoCss += `filter: ${filters} !important;`;
333-
}
334-
let css = "";
335-
if (videoCss) {
336-
css = `#videoHolder video { ${videoCss} }`;
337-
}
348+
const videoStyle = document.getElementById("video-css");
349+
console.log('Refresh video player:', displayOptions)
350+
const filters = getVideoPlayerFilterStyle(displayOptions);
351+
let videoCss = "";
352+
if (filters) {
353+
videoCss += `filter: ${filters} !important;`;
354+
}
355+
let css = "";
356+
if (videoCss) {
357+
css = `#videoHolder video { ${videoCss} }`;
358+
}
338359

339-
videoStyle!.textContent = css;
340-
}, 1000);
360+
videoStyle!.textContent = css;
361+
}, 1000);
362+
}
341363

342-
// const xboxTitleId = window._xboxTitleId || ''
343-
// // inputConfigs
344-
// Ipc.send("streaming", "inputConfigs", {
345-
// xboxTitleId,
346-
// })
364+
const xboxTitleId = window._xboxTitleId || ''
365+
// inputConfigs
366+
Ipc.send("streaming", "inputConfigs", {
367+
xboxTitleId,
368+
})
347369
}, 500);
348370
} else if (event.state === "closed") {
349371
console.log(":: We are disconnected!");
@@ -603,6 +625,11 @@ function Stream() {
603625
setLoadingText(t("Disconnecting..."));
604626
xPlayer && xPlayer.close();
605627

628+
const videoHolder = document.getElementById("videoHolder");
629+
const canvasContainer = document.getElementById("canvas-container");
630+
videoHolder.style.visibility = 'visible';
631+
canvasContainer.style.visibility = 'hidden';
632+
606633
if (streamStateInterval.current) {
607634
clearInterval(streamStateInterval.current);
608635
}
@@ -771,6 +798,11 @@ function Stream() {
771798
<div id="videoHolder" style={videoHolderStyle}>
772799
{/* <video src="https://www.w3schools.com/html/mov_bbb.mp4" autoPlay muted loop playsInline></video> */}
773800
</div>
801+
802+
<div id="canvas-container">
803+
<canvas id="canvas"></canvas>
804+
</div>
805+
774806

775807
<svg id="video-filters" style={{ display: "none" }}>
776808
<defs>

renderer/public/locales/en/cloud.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"Send text": "Send text",
4545
"Open Mic": "Open Mic",
4646
"Close Mic": "Close Mic",
47+
"FSR started": "FSR started",
4748
"WaitingForServerToRegister": "Unable to start stream session on console. The console is not connected to the Xbox servers. This ocasionally happens then there is an update or when the user is not signed in to the console. Please hard reboot your console and try again.",
4849
"XboxstreaminghelperErr": "The host streaming function is not working properly. When you see this error, it does not indicate an issue with XStreaming itself, but rather that the host's streaming functionality has stopped functioning due to certain reasons. You need to press and hold the power button or disconnect the power supply to restart the host and resolve the issue. Specific error:"
4950
}

renderer/public/locales/en/settings.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,5 +130,10 @@
130130
"Save server": "Save server",
131131
"Saved": "Saved",
132132
"Background keepalive": "Background keepalive",
133-
"background_keepalive_desc": "Whether keepalive input when app is in background"
133+
"background_keepalive_desc": "Whether keepalive input when app is in background(This feature is not available on Windows)",
134+
"FSR": "FSR",
135+
"FSR started": "FSR started",
136+
"FSR_desc": "Enable FSR (FidelityFX Super Resolution) to achieve super-resolution, which can improve image clarity without increasing bandwidth, but will increase CPU/GPU load",
137+
"fsr_sharpness_title": "FSR Sharpness",
138+
"fsr_sharpness_desc": "Set FSR sharpness"
134139
}

0 commit comments

Comments
 (0)