mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2025-06-27 21:21:56 +02:00
Adding ability to override webp benchmark value
This commit is contained in:
parent
3cc739adb3
commit
2dbcd28354
@ -395,7 +395,7 @@ void EncodeManager::doUpdate(bool allowLossy, const Region& changed_,
|
||||
screenArea = pb->getRect().width() * pb->getRect().height();
|
||||
screenArea *= 1024;
|
||||
screenArea /= 256 * 256;
|
||||
screenArea *= webpBenchResult;
|
||||
screenArea *= screenArea *= Server::webpEncodingTime > 0 ? Server::webpEncodingTime : webpBenchResult;
|
||||
// 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
|
||||
|
@ -287,3 +287,8 @@ rfb::PresetParameter rfb::Server::preferBandwidth
|
||||
("PreferBandwidth",
|
||||
"Set various options for lower bandwidth use. The default is off, aka to prefer quality.",
|
||||
false, bandwidthPreset);
|
||||
|
||||
rfb::IntParameter rfb::Server::webpEncodingTime
|
||||
("udpPort",
|
||||
"Sets the benchmak WebP encoding time in KasmVNC. Default is calculated in TightWEBPEncoder benchmark function",
|
||||
0, 0, 10000);
|
||||
|
@ -91,6 +91,7 @@ namespace rfb {
|
||||
static BoolParameter ignoreClientSettingsKasm;
|
||||
static BoolParameter selfBench;
|
||||
static PresetParameter preferBandwidth;
|
||||
static IntParameter webpEncodingTime;
|
||||
};
|
||||
|
||||
};
|
||||
|
@ -259,13 +259,14 @@ void TightWEBPEncoder::writeRect(const PixelBuffer* pb, const Palette& palette)
|
||||
WebPMemoryWriterClear(&wrt);
|
||||
}
|
||||
|
||||
// How many milliseconds would it take to encode a 256x256 block at quality 8
|
||||
// How many milliseconds would it take to encode a 256x256 block at quality 5
|
||||
rdr::U32 TightWEBPEncoder::benchmark() const
|
||||
{
|
||||
rdr::U8* buffer;
|
||||
struct timeval start;
|
||||
int stride, i;
|
||||
const uint8_t quality = 8, method = 2;
|
||||
// the minimum WebP quality settings used in KasmVNC
|
||||
const uint8_t quality = 5, method = 0;
|
||||
WebPConfig cfg;
|
||||
WebPPicture pic;
|
||||
WebPMemoryWriter wrt;
|
||||
|
@ -2068,6 +2068,15 @@ sub DefineConfigToCLIConversion {
|
||||
$value;
|
||||
}
|
||||
}),
|
||||
KasmVNC::CliOption->new({
|
||||
name => 'webpEncodingTime',
|
||||
configKeys => [
|
||||
KasmVNC::ConfigKey->new({
|
||||
name => "encoding.video_encoding_mode.webp_encoding_time",
|
||||
type => KasmVNC::ConfigKey::INT
|
||||
})
|
||||
]
|
||||
}),
|
||||
KasmVNC::CliOption->new({
|
||||
name => 'CompareFB',
|
||||
configKeys => [
|
||||
|
Loading…
x
Reference in New Issue
Block a user