From 4f630eeb2647dbe761f3ec8962ef6d4723c45746 Mon Sep 17 00:00:00 2001 From: gnattu Date: Sat, 24 Aug 2024 02:30:28 +0800 Subject: [PATCH] Enable software tonemapping options (#5784) * Enable software tonemappin options * Remove debugging log * Apply suggestions from code review Co-authored-by: Bill Thornton * use "camelCase" for CSS classes * use toggle for switching * no comments --------- Co-authored-by: Bill Thornton --- src/controllers/dashboard/encodingsettings.html | 5 +++-- src/controllers/dashboard/encodingsettings.js | 7 ++++++- src/strings/en-us.json | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/controllers/dashboard/encodingsettings.html b/src/controllers/dashboard/encodingsettings.html index bf51ad8d74..f0dbb52528 100644 --- a/src/controllers/dashboard/encodingsettings.html +++ b/src/controllers/dashboard/encodingsettings.html @@ -173,7 +173,8 @@ ${EnableTonemapping} -
${AllowTonemappingHelp}
+
${AllowTonemappingHelp}
+
${AllowTonemappingSoftwareHelp}
diff --git a/src/controllers/dashboard/encodingsettings.js b/src/controllers/dashboard/encodingsettings.js index d76a78027f..a1a1d25815 100644 --- a/src/controllers/dashboard/encodingsettings.js +++ b/src/controllers/dashboard/encodingsettings.js @@ -194,12 +194,17 @@ $(document).on('pageinit', '#encodingSettingsPage', function () { page.querySelector('.fld10bitHevcVp9HwDecoding').classList.add('hide'); } - if (this.value == 'amf' || this.value == 'nvenc' || this.value == 'qsv' || this.value == 'vaapi' || this.value == 'rkmpp' || this.value == 'videotoolbox') { + const isHwaSelected = [ 'amf', 'nvenc', 'qsv', 'vaapi', 'rkmpp', 'videotoolbox' ].includes(this.value); + if (this.value === '' || isHwaSelected) { page.querySelector('.tonemappingOptions').classList.remove('hide'); } else { page.querySelector('.tonemappingOptions').classList.add('hide'); } + page.querySelector('.tonemappingModeOptions').classList.toggle('hide', !isHwaSelected); + page.querySelector('.allowTonemappingHardwareHelp').classList.toggle('hide', !isHwaSelected); + page.querySelector('.allowTonemappingSoftwareHelp').classList.toggle('hide', isHwaSelected); + if (this.value == 'qsv' || this.value == 'vaapi') { page.querySelector('.fldIntelLp').classList.remove('hide'); } else { diff --git a/src/strings/en-us.json b/src/strings/en-us.json index e26afb936d..da956eb93a 100644 --- a/src/strings/en-us.json +++ b/src/strings/en-us.json @@ -44,6 +44,7 @@ "AllowRemoteAccess": "Allow remote connections to this server", "AllowRemoteAccessHelp": "If unchecked, all remote connections will be blocked.", "AllowTonemappingHelp": "Tone-mapping can transform the dynamic range of a video from HDR to SDR while maintaining image details and colors, which are very important information for representing the original scene. Currently works only with 10bit HDR10, HLG and DoVi videos. This requires the corresponding GPGPU runtime.", + "AllowTonemappingSoftwareHelp": "Tone-mapping can transform the dynamic range of a video from HDR to SDR while maintaining image details and colors, which are very important information for representing the original scene. Currently works only with 10bit HDR10 and HLG videos.", "AlwaysPlaySubtitles": "Always Play", "AlwaysPlaySubtitlesHelp": "Subtitles matching the language preference will be loaded regardless of the audio language.", "AndOtherArtists": "{0} and {1} other artists.",