Skip to content

Commit

Permalink
allow hybird vpp tonemapping for QSV on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
nyanmisaka committed Jan 29, 2021
1 parent d78cd0d commit 200741a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/controllers/dashboard/encodingsettings.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ <h3 class="checkboxListLabel">${LabelEnableHardwareDecodingFor}</h3>
</div>
</div>

<div class="checkboxListContainer checkboxContainer-withDescription fldVppTonemapping hide">
<label>
<input type="checkbox" is="emby-checkbox" id="chkVppTonemapping" />
<span>${EnableVppTonemapping}</span>
</label>
<div class="fieldDescription checkboxFieldDescription">${AllowVppTonemappingHelp}</div>
</div>
<div class="tonemappingOptions hide">
<div class="checkboxListContainer checkboxContainer-withDescription">
<label>
Expand All @@ -118,13 +125,6 @@ <h3 class="checkboxListLabel">${LabelEnableHardwareDecodingFor}</h3>
</label>
<div class="fieldDescription checkboxFieldDescription">${AllowTonemappingHelp}</div>
</div>
<div class="checkboxListContainer checkboxContainer-withDescription fldVppTonemapping hide">
<label>
<input type="checkbox" is="emby-checkbox" id="chkVppTonemapping" />
<span>${EnableVppTonemapping}</span>
</label>
<div class="fieldDescription checkboxFieldDescription">${AllowVppTonemappingHelp}</div>
</div>
<div class="selectContainer">
<select is="emby-select" id="selectTonemappingAlgorithm" label="${LabelTonemappingAlgorithm}">
<option value="none">None</option>
Expand Down
13 changes: 12 additions & 1 deletion src/controllers/dashboard/encodingsettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,19 @@ import alert from '../../components/alert';
}];
}

let systemInfo;
function getSystemInfo() {
return systemInfo ? Promise.resolve(systemInfo) : ApiClient.getPublicSystemInfo().then(
info => {
systemInfo = info;
return info;
}
);
}

$(document).on('pageinit', '#encodingSettingsPage', function () {
const page = this;
getSystemInfo();
page.querySelector('#selectVideoDecoder').addEventListener('change', function () {
if (this.value == 'vaapi') {
page.querySelector('.fldVaapiDevice').classList.remove('hide');
Expand Down Expand Up @@ -191,7 +202,7 @@ import alert from '../../components/alert';
page.querySelector('.fldEnhancedNvdec').classList.add('hide');
}

if (this.value == 'vaapi') {
if (systemInfo.OperatingSystem.toLowerCase() === 'linux' && (this.value == 'vaapi' || this.value == 'qsv')) {
page.querySelector('.fldVppTonemapping').classList.remove('hide');
} else {
page.querySelector('.fldVppTonemapping').classList.add('hide');
Expand Down

0 comments on commit 200741a

Please sign in to comment.