This commit is contained in:
Aztup 2026-05-20 09:04:08 +00:00 committed by GitHub
commit 692077688b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 29 additions and 0 deletions

View file

@ -19,6 +19,7 @@ type Settings = {
autoFrameRateMatching: boolean,
bingeWatching: boolean,
hardwareDecoding: boolean,
gpuVideoProcessing: boolean,
videoMode: string | null,
escExitFullscreen: boolean,
interfaceLanguage: string,

View file

@ -411,6 +411,7 @@ const Player = ({ urlParams, queryParams }) => {
maxAudioChannels: settings.surroundSound ? 32 : 2,
hardwareDecoding: settings.hardwareDecoding,
assSubtitlesStyling: settings.assSubtitlesStyling,
gpuVideoProcessing: settings.gpuVideoProcessing,
videoMode: settings.videoMode,
platform: platform.name,
streamingServerURL: streamingServer.baseUrl ?

View file

@ -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 &&
<Option label={'SETTINGS_GPU_VIDEO_PROCESSING'}>
<Toggle
tabIndex={-1}
{...gpuVideoProcessingToggle}
/>
</Option>
}
{
shell.active && platform.name === 'windows' &&
<Option label={'SETTINGS_VIDEO_MODE'}>

View file

@ -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,
};