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 = pb->getRect().width() * pb->getRect().height();
screenArea *= 1024; screenArea *= 1024;
screenArea /= 256 * 256; screenArea /= 256 * 256;
screenArea *= screenArea; screenArea *= webpBenchResult;
screenArea /= Server::webpEncodingTime > 1 ? Server::webpEncodingTime : 1; screenArea /= Server::webpEncodingTime;
// Encoding the entire screen would take this many 1024*msecs, worst case // 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 // Calculate how many us we can send webp for, before switching to jpeg

View File

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

View File

@ -2069,13 +2069,25 @@ sub DefineConfigToCLIConversion {
} }
}), }),
KasmVNC::CliOption->new({ KasmVNC::CliOption->new({
name => 'webpEncodingTime', name => 'WebpEncodingTime',
configKeys => [ configKeys => [
KasmVNC::ConfigKey->new({ KasmVNC::ConfigKey->new({
name => "encoding.video_encoding_mode.webp_encoding_time", 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({ KasmVNC::CliOption->new({
name => 'CompareFB', name => 'CompareFB',