From 34305e99563dc4a722514dff0f209a5714caf59e Mon Sep 17 00:00:00 2001 From: Ryan Kuba Date: Mon, 14 Nov 2022 04:09:10 -0800 Subject: [PATCH] KASM-3535 code to disable workers on jpeg quality change more qoi threads (#47) Added more QOI worker threads --- core/decoders/tight.js | 7 +++---- core/rfb.js | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/decoders/tight.js b/core/decoders/tight.js index 47b2d486..979eeb3c 100644 --- a/core/decoders/tight.js +++ b/core/decoders/tight.js @@ -54,7 +54,7 @@ export default class TightDecoder { // Figure out filter this._ctl = this._ctl >> 4; } - + let ret; if (this._ctl === 0x08) { @@ -404,12 +404,11 @@ export default class TightDecoder { let sabTest = typeof SharedArrayBuffer; if (sabTest !== 'undefined') { this._enableQOI = true; - if ((window.navigator.hardwareConcurrency) && (window.navigator.hardwareConcurrency > 8)) { - this._threads = window.navigator.hardwareConcurrency; + if ((window.navigator.hardwareConcurrency) && (window.navigator.hardwareConcurrency >= 4)) { + this._threads = 16; } else { this._threads = 8; } - this._workerEnabled = false; this._workers = []; this._availableWorkers = []; this._sabs = []; diff --git a/core/rfb.js b/core/rfb.js index df62822a..918acd5b 100644 --- a/core/rfb.js +++ b/core/rfb.js @@ -497,6 +497,7 @@ export default class RFB extends EventTargetMixin { return; } } + this._enableQOI = enabled; this._pendingApplyEncodingChanges = true; }