mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-07-26 15:12:14 +00:00
Merge pull request #1274 from Aztup/feat/nvidiaVideoProcessing
Some checks failed
Build / build (push) Has been cancelled
Some checks failed
Build / build (push) Has been cancelled
Settings: Add Nvidia GPU Video Processing option
This commit is contained in:
commit
93defccd76
8 changed files with 53 additions and 8 deletions
|
|
@ -47,7 +47,7 @@
|
|||
"react-router": "6.30.0",
|
||||
"react-router-dom": "6.30.0",
|
||||
"spatial-navigation-polyfill": "github:Stremio/spatial-navigation#64871b1422466f5f45d24ebc8bbd315b2ebab6a6",
|
||||
"stremio-translations": "github:Stremio/stremio-translations#e40729413eee88d71908dcbb5d21c7925a99f4a2",
|
||||
"stremio-translations": "github:Stremio/stremio-translations#89e695effcd165b6b1f2133d9bc5c4ffe37ba4be",
|
||||
"url": "0.11.4",
|
||||
"use-long-press": "^3.3.0"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -96,8 +96,8 @@ importers:
|
|||
specifier: github:Stremio/spatial-navigation#64871b1422466f5f45d24ebc8bbd315b2ebab6a6
|
||||
version: https://codeload.github.com/Stremio/spatial-navigation/tar.gz/64871b1422466f5f45d24ebc8bbd315b2ebab6a6
|
||||
stremio-translations:
|
||||
specifier: github:Stremio/stremio-translations#e40729413eee88d71908dcbb5d21c7925a99f4a2
|
||||
version: https://codeload.github.com/Stremio/stremio-translations/tar.gz/e40729413eee88d71908dcbb5d21c7925a99f4a2
|
||||
specifier: github:Stremio/stremio-translations#89e695effcd165b6b1f2133d9bc5c4ffe37ba4be
|
||||
version: https://codeload.github.com/Stremio/stremio-translations/tar.gz/89e695effcd165b6b1f2133d9bc5c4ffe37ba4be
|
||||
url:
|
||||
specifier: 0.11.4
|
||||
version: 0.11.4
|
||||
|
|
@ -4457,8 +4457,8 @@ packages:
|
|||
resolution: {integrity: sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
stremio-translations@https://codeload.github.com/Stremio/stremio-translations/tar.gz/e40729413eee88d71908dcbb5d21c7925a99f4a2:
|
||||
resolution: {gitHosted: true, tarball: https://codeload.github.com/Stremio/stremio-translations/tar.gz/e40729413eee88d71908dcbb5d21c7925a99f4a2}
|
||||
stremio-translations@https://codeload.github.com/Stremio/stremio-translations/tar.gz/89e695effcd165b6b1f2133d9bc5c4ffe37ba4be:
|
||||
resolution: {gitHosted: true, tarball: https://codeload.github.com/Stremio/stremio-translations/tar.gz/89e695effcd165b6b1f2133d9bc5c4ffe37ba4be}
|
||||
version: 1.52.0
|
||||
|
||||
string-length@4.0.2:
|
||||
|
|
@ -10050,7 +10050,7 @@ snapshots:
|
|||
es-errors: 1.3.0
|
||||
internal-slot: 1.1.0
|
||||
|
||||
stremio-translations@https://codeload.github.com/Stremio/stremio-translations/tar.gz/e40729413eee88d71908dcbb5d21c7925a99f4a2: {}
|
||||
stremio-translations@https://codeload.github.com/Stremio/stremio-translations/tar.gz/89e695effcd165b6b1f2133d9bc5c4ffe37ba4be: {}
|
||||
|
||||
string-length@4.0.2:
|
||||
dependencies:
|
||||
|
|
|
|||
5
src/common/Platform/shell/shell.d.ts
vendored
5
src/common/Platform/shell/shell.d.ts
vendored
|
|
@ -14,12 +14,17 @@ type MediaStatus = {
|
|||
|
||||
interface Shell {
|
||||
active: boolean,
|
||||
capabilities: ShellCapabilities,
|
||||
state: ShellState,
|
||||
on: (name: string, listener: (arg: any) => void) => void;
|
||||
off: (name: string, listener: (arg: any) => void) => void;
|
||||
send: (method: string, ...args: (string | number | object)[]) => void;
|
||||
}
|
||||
|
||||
type ShellCapabilities = {
|
||||
gpuVideoProcessing: boolean;
|
||||
};
|
||||
|
||||
type ShellState = {
|
||||
initialized: boolean;
|
||||
version: string | null;
|
||||
|
|
|
|||
|
|
@ -41,6 +41,9 @@ const useShell = (): Shell => {
|
|||
windowClosed: false,
|
||||
windowHidden: false,
|
||||
});
|
||||
const [capabilities, setCapabilities] = useState<ShellCapabilities>({
|
||||
gpuVideoProcessing: false,
|
||||
});
|
||||
|
||||
const on = (name: string, listener: (arg: any) => void) => events.on(name, listener);
|
||||
const off = (name: string, listener: (arg: any) => void) => events.off(name, listener);
|
||||
|
|
@ -88,9 +91,16 @@ const useShell = (): Shell => {
|
|||
|
||||
if (event.type === ShellEventType.INIT) {
|
||||
const { data } = event as ShellEventInit;
|
||||
const [, [,,, version]] = data.transport.properties;
|
||||
const [, [,,, version], [,,, gpuVideoProcessing] = []] = data.transport.properties;
|
||||
|
||||
setState((state) => ({ ...state, initialized: true, version }));
|
||||
setState((state) => ({
|
||||
...state,
|
||||
initialized: true,
|
||||
version,
|
||||
}));
|
||||
setCapabilities({
|
||||
gpuVideoProcessing: gpuVideoProcessing === 'true',
|
||||
});
|
||||
}
|
||||
|
||||
if (event.type === ShellEventType.SIGNAL) {
|
||||
|
|
@ -118,6 +128,7 @@ const useShell = (): Shell => {
|
|||
on,
|
||||
off,
|
||||
state,
|
||||
capabilities,
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
1
src/core/types/models/Ctx.d.ts
vendored
1
src/core/types/models/Ctx.d.ts
vendored
|
|
@ -20,6 +20,7 @@ type Settings = {
|
|||
bingeWatching: boolean,
|
||||
discordRpcEnabled: boolean,
|
||||
hardwareDecoding: boolean,
|
||||
gpuVideoProcessing: boolean,
|
||||
videoMode: string | null,
|
||||
escExitFullscreen: boolean,
|
||||
interfaceLanguage: string,
|
||||
|
|
|
|||
|
|
@ -414,6 +414,7 @@ const Player = () => {
|
|||
maxAudioChannels: settings.surroundSound ? 32 : 2,
|
||||
hardwareDecoding: settings.hardwareDecoding,
|
||||
assSubtitlesStyling: settings.assSubtitlesStyling,
|
||||
gpuVideoProcessing: settings.gpuVideoProcessing && platform.shell.capabilities.gpuVideoProcessing,
|
||||
videoMode: settings.videoMode,
|
||||
platform: platform.name,
|
||||
streamingServerURL: streamingServer.baseUrl ?
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ const Player = forwardRef<HTMLDivElement, Props>(({ profile }: Props, ref) => {
|
|||
bingeWatchingToggle,
|
||||
playInBackgroundToggle,
|
||||
hardwareDecodingToggle,
|
||||
gpuVideoProcessingToggle,
|
||||
videoModeSelect,
|
||||
pauseOnMinimizeToggle,
|
||||
} = usePlayerOptions(profile);
|
||||
|
|
@ -131,6 +132,15 @@ const Player = forwardRef<HTMLDivElement, Props>(({ profile }: Props, ref) => {
|
|||
/>
|
||||
</Option>
|
||||
}
|
||||
{
|
||||
shell.active && shell.capabilities.gpuVideoProcessing &&
|
||||
<Option label={'SETTINGS_GPU_VIDEO_PROCESSING'}>
|
||||
<Toggle
|
||||
tabIndex={-1}
|
||||
{...gpuVideoProcessingToggle}
|
||||
/>
|
||||
</Option>
|
||||
}
|
||||
{
|
||||
shell.active && platform.name === 'windows' &&
|
||||
<Option label={'SETTINGS_VIDEO_MODE'}>
|
||||
|
|
|
|||
|
|
@ -303,6 +303,22 @@ const usePlayerOptions = (profile: Profile) => {
|
|||
}
|
||||
}), [profile.settings]);
|
||||
|
||||
const gpuVideoProcessingToggle = useMemo(() => ({
|
||||
checked: profile.settings.gpuVideoProcessing,
|
||||
onClick: () => {
|
||||
core.transport.dispatch({
|
||||
action: 'Ctx',
|
||||
args: {
|
||||
action: 'UpdateSettings',
|
||||
args: {
|
||||
...profile.settings,
|
||||
gpuVideoProcessing: !profile.settings.gpuVideoProcessing
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}), [profile.settings]);
|
||||
|
||||
const videoModeSelect = useMemo(() => ({
|
||||
options: [
|
||||
{
|
||||
|
|
@ -367,6 +383,7 @@ const usePlayerOptions = (profile: Profile) => {
|
|||
bingeWatchingToggle,
|
||||
playInBackgroundToggle,
|
||||
hardwareDecodingToggle,
|
||||
gpuVideoProcessingToggle,
|
||||
videoModeSelect,
|
||||
pauseOnMinimizeToggle,
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue