mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2025-06-27 05:01:41 +02:00
KASM-7125 fixed issue with rebuilding Xvnc, switched to simplier webp mix math.
This commit is contained in:
parent
02852185a8
commit
00b8d025db
@ -76,46 +76,49 @@ if [ ! -d unix/xserver/include ]; then
|
|||||||
patch -s -p0 < ../CVE-2022-2320-v1.19.patch
|
patch -s -p0 < ../CVE-2022-2320-v1.19.patch
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
else
|
||||||
autoreconf -i
|
cd unix/xserver
|
||||||
# Configuring Xorg is long and has many distro-specific paths.
|
|
||||||
# The distro paths start after prefix and end with the font path,
|
|
||||||
# everything after that is based on BUILDING.txt to remove unneeded
|
|
||||||
# components.
|
|
||||||
# remove gl check for opensuse
|
|
||||||
if [ "${KASMVNC_BUILD_OS}" == "opensuse" ] || ([ "${KASMVNC_BUILD_OS}" == "oracle" ] && [ "${KASMVNC_BUILD_OS_CODENAME}" == 9 ]); then
|
|
||||||
sed -i 's/LIBGL="gl >= 7.1.0"/LIBGL="gl >= 1.1"/g' configure
|
|
||||||
fi
|
|
||||||
|
|
||||||
# build X11
|
|
||||||
./configure \
|
|
||||||
--disable-config-hal \
|
|
||||||
--disable-config-udev \
|
|
||||||
--disable-dmx \
|
|
||||||
--disable-dri \
|
|
||||||
--disable-dri2 \
|
|
||||||
--disable-kdrive \
|
|
||||||
--disable-static \
|
|
||||||
--disable-xephyr \
|
|
||||||
--disable-xinerama \
|
|
||||||
--disable-xnest \
|
|
||||||
--disable-xorg \
|
|
||||||
--disable-xvfb \
|
|
||||||
--disable-xwayland \
|
|
||||||
--disable-xwin \
|
|
||||||
--enable-glx \
|
|
||||||
--prefix=/opt/kasmweb \
|
|
||||||
--with-default-font-path="/usr/share/fonts/X11/misc,/usr/share/fonts/X11/cyrillic,/usr/share/fonts/X11/100dpi/:unscaled,/usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/Type1,/usr/share/fonts/X11/100dpi,/usr/share/fonts/X11/75dpi,built-ins" \
|
|
||||||
--without-dtrace \
|
|
||||||
--with-sha1=libcrypto \
|
|
||||||
--with-xkb-bin-directory=/usr/bin \
|
|
||||||
--with-xkb-output=/var/lib/xkb \
|
|
||||||
--with-xkb-path=/usr/share/X11/xkb "${CONFIG_OPTIONS}"
|
|
||||||
|
|
||||||
# remove array bounds errors for new versions of GCC
|
|
||||||
find . -name "Makefile" -exec sed -i 's/-Werror=array-bounds//g' {} \;
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
autoreconf -i
|
||||||
|
# Configuring Xorg is long and has many distro-specific paths.
|
||||||
|
# The distro paths start after prefix and end with the font path,
|
||||||
|
# everything after that is based on BUILDING.txt to remove unneeded
|
||||||
|
# components.
|
||||||
|
# remove gl check for opensuse
|
||||||
|
if [ "${KASMVNC_BUILD_OS}" == "opensuse" ] || ([ "${KASMVNC_BUILD_OS}" == "oracle" ] && [ "${KASMVNC_BUILD_OS_CODENAME}" == 9 ]); then
|
||||||
|
sed -i 's/LIBGL="gl >= 7.1.0"/LIBGL="gl >= 1.1"/g' configure
|
||||||
|
fi
|
||||||
|
|
||||||
|
# build X11
|
||||||
|
./configure \
|
||||||
|
--disable-config-hal \
|
||||||
|
--disable-config-udev \
|
||||||
|
--disable-dmx \
|
||||||
|
--disable-dri \
|
||||||
|
--disable-dri2 \
|
||||||
|
--disable-kdrive \
|
||||||
|
--disable-static \
|
||||||
|
--disable-xephyr \
|
||||||
|
--disable-xinerama \
|
||||||
|
--disable-xnest \
|
||||||
|
--disable-xorg \
|
||||||
|
--disable-xvfb \
|
||||||
|
--disable-xwayland \
|
||||||
|
--disable-xwin \
|
||||||
|
--enable-glx \
|
||||||
|
--prefix=/opt/kasmweb \
|
||||||
|
--with-default-font-path="/usr/share/fonts/X11/misc,/usr/share/fonts/X11/cyrillic,/usr/share/fonts/X11/100dpi/:unscaled,/usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/Type1,/usr/share/fonts/X11/100dpi,/usr/share/fonts/X11/75dpi,built-ins" \
|
||||||
|
--without-dtrace \
|
||||||
|
--with-sha1=libcrypto \
|
||||||
|
--with-xkb-bin-directory=/usr/bin \
|
||||||
|
--with-xkb-output=/var/lib/xkb \
|
||||||
|
--with-xkb-path=/usr/share/X11/xkb "${CONFIG_OPTIONS}"
|
||||||
|
|
||||||
|
# remove array bounds errors for new versions of GCC
|
||||||
|
find . -name "Makefile" -exec sed -i 's/-Werror=array-bounds//g' {} \;
|
||||||
|
|
||||||
|
|
||||||
make -j"$(nproc)"
|
make -j"$(nproc)"
|
||||||
|
|
||||||
# modifications for the servertarball
|
# modifications for the servertarball
|
||||||
|
@ -360,7 +360,6 @@ void EncodeManager::doUpdate(bool allowLossy, const Region& changed_,
|
|||||||
int nRects;
|
int nRects;
|
||||||
Region changed, cursorRegion;
|
Region changed, cursorRegion;
|
||||||
struct timeval start;
|
struct timeval start;
|
||||||
unsigned screenArea;
|
|
||||||
|
|
||||||
updates++;
|
updates++;
|
||||||
if (conn->cp.supportsUdp)
|
if (conn->cp.supportsUdp)
|
||||||
@ -390,17 +389,7 @@ void EncodeManager::doUpdate(bool allowLossy, const Region& changed_,
|
|||||||
memset(&webpstats, 0, sizeof(codecstats_t));
|
memset(&webpstats, 0, sizeof(codecstats_t));
|
||||||
|
|
||||||
if (allowLossy && activeEncoders[encoderFullColour] == encoderTightWEBP) {
|
if (allowLossy && activeEncoders[encoderFullColour] == encoderTightWEBP) {
|
||||||
const unsigned rate = 1024 * 1000 / rfb::Server::frameRate;
|
webpFallbackUs = (1000 * 1000 / rfb::Server::frameRate) * (static_cast<double>(Server::webpEncodingTime) / 100.0);
|
||||||
|
|
||||||
screenArea = pb->getRect().width() * pb->getRect().height();
|
|
||||||
screenArea *= 1024;
|
|
||||||
screenArea /= 256 * 256;
|
|
||||||
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
|
|
||||||
webpFallbackUs = rate * rate / screenArea;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -884,7 +873,7 @@ void EncodeManager::findSolidRect(const Rect& rect, Region *changed,
|
|||||||
void EncodeManager::checkWebpFallback(const timeval *start) {
|
void EncodeManager::checkWebpFallback(const timeval *start) {
|
||||||
// Have we taken too long for the frame? If so, drop from WEBP to JPEG
|
// Have we taken too long for the frame? If so, drop from WEBP to JPEG
|
||||||
if (start && activeEncoders[encoderFullColour] == encoderTightWEBP && !webpTookTooLong.load(std::memory_order_relaxed)) {
|
if (start && activeEncoders[encoderFullColour] == encoderTightWEBP && !webpTookTooLong.load(std::memory_order_relaxed)) {
|
||||||
const auto us = msSince(start) * 1024;
|
const auto us = msSince(start) * 1000;
|
||||||
if (us > webpFallbackUs)
|
if (us > webpFallbackUs)
|
||||||
webpTookTooLong.store(true, std::memory_order_relaxed);
|
webpTookTooLong.store(true, std::memory_order_relaxed);
|
||||||
}
|
}
|
||||||
|
@ -290,5 +290,5 @@ rfb::PresetParameter rfb::Server::preferBandwidth
|
|||||||
|
|
||||||
rfb::IntParameter rfb::Server::webpEncodingTime
|
rfb::IntParameter rfb::Server::webpEncodingTime
|
||||||
("webpEncodingTime",
|
("webpEncodingTime",
|
||||||
"Sets a weighted value that determines how much webp is used to balance bandwidth and CPU usage.",
|
"Percentage of time allotted for encoding a frame, that can be used for encoding rects in webp.",
|
||||||
1, 1, 1000);
|
30, 0, 100);
|
||||||
|
@ -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: auto
|
webp_encoding_time: 30
|
||||||
|
|
||||||
compare_framebuffer: auto
|
compare_framebuffer: auto
|
||||||
zrle_zlib_level: auto
|
zrle_zlib_level: auto
|
||||||
|
@ -2068,27 +2068,15 @@ sub DefineConfigToCLIConversion {
|
|||||||
$value;
|
$value;
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
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",
|
||||||
validator => KasmVNC::PatternValidator->new({
|
type => KasmVNC::ConfigKey::INT
|
||||||
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',
|
||||||
configKeys => [
|
configKeys => [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user