Fixing webp usage calculation and updating default value

This commit is contained in:
Rodwin.Spruel 2025-04-24 05:57:25 -04:00
parent f674e2c58d
commit 02852185a8
No known key found for this signature in database
GPG Key ID: 732BE68DCA2B69CA
3 changed files with 29 additions and 17 deletions

View File

@ -395,8 +395,8 @@ void EncodeManager::doUpdate(bool allowLossy, const Region& changed_,
screenArea = pb->getRect().width() * pb->getRect().height();
screenArea *= 1024;
screenArea /= 256 * 256;
screenArea *= screenArea;
screenArea /= Server::webpEncodingTime > 1 ? Server::webpEncodingTime : 1;
screenArea *= webpBenchResult;
screenArea /= Server::webpEncodingTime;
// Encoding the entire screen would take this many 1024*msecs, worst case
// Calculate how many us we can send webp for, before switching to jpeg

View File

@ -37,7 +37,7 @@ user_session:
keyboard:
remap_keys:
# - 0x22->0x40
# - 0x22->0x40
ignore_numlock: false
raw_keyboard: false
@ -92,16 +92,16 @@ data_loss_prevention:
enabled: true
rate_limit: unlimited
watermark:
# image: /etc/kasmvnc/picture.png
# location: 10,10
# tint: 255,20,20,128
# repeat_spacing: 10
#text:
# template: "${USER} %H:%M"
# font: auto
# font_size: 48
# timezone_name: Australia/Adelaide
# angle: 0
# image: /etc/kasmvnc/picture.png
# location: 10,10
# tint: 255,20,20,128
# repeat_spacing: 10
#text:
# template: "${USER} %H:%M"
# font: auto
# font_size: 48
# timezone_name: Australia/Adelaide
# angle: 0
logging:
# "verbose" SETTING LOGS YOUR PRIVATE INFORMATION. Keypresses and clipboard content
level: off
@ -129,7 +129,7 @@ encoding:
logging:
level: off
scaling_algorithm: progressive_bilinear
webp_encoding_time: 1
webp_encoding_time: auto
compare_framebuffer: auto
zrle_zlib_level: auto

View File

@ -2069,13 +2069,25 @@ sub DefineConfigToCLIConversion {
}
}),
KasmVNC::CliOption->new({
name => 'webpEncodingTime',
name => 'WebpEncodingTime',
configKeys => [
KasmVNC::ConfigKey->new({
name => "encoding.video_encoding_mode.webp_encoding_time",
type => KasmVNC::ConfigKey::INT
validator => KasmVNC::PatternValidator->new({
pattern => qr/^(auto|[1-9][0-9]{0,2}|1000)$/,
errorMessage => "must be 'auto' or a number in 1..1000"
}),
})
]
],
deriveValueSub => sub {
my $self = shift;
my $value = $self->configValue();
if ($value eq "auto") {
$value = 1;
}
$value;
}
}),
KasmVNC::CliOption->new({
name => 'CompareFB',