diff options
author | Pierre Ossman <ossman@cendio.se> | 2023-11-20 13:20:46 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2023-11-20 13:20:46 +0100 |
commit | be3d0bc5e97f25d8531d372784b5c6c1e77fca19 (patch) | |
tree | d50d8857ad27470c02da3e2aa4a77150044ba7eb /common | |
parent | 2d0d516dac7a00bdcaf1f020009b38b367fe214b (diff) | |
parent | cd78d50a7353548619af92cdd2d427f54bc6f219 (diff) | |
download | tigervnc-be3d0bc5e97f25d8531d372784b5c6c1e77fca19.tar.gz tigervnc-be3d0bc5e97f25d8531d372784b5c6c1e77fca19.zip |
Merge branch 'zrlee-compression-level' of https://github.com/adamhalim/tigervnc-suite
Diffstat (limited to 'common')
-rw-r--r-- | common/rfb/ZRLEEncoder.cxx | 17 | ||||
-rw-r--r-- | common/rfb/ZRLEEncoder.h | 2 |
2 files changed, 17 insertions, 2 deletions
diff --git a/common/rfb/ZRLEEncoder.cxx b/common/rfb/ZRLEEncoder.cxx index 4e25d49f..ad3aec1a 100644 --- a/common/rfb/ZRLEEncoder.cxx +++ b/common/rfb/ZRLEEncoder.cxx @@ -28,15 +28,23 @@ #include <rfb/SConnection.h> #include <rfb/ZRLEEncoder.h> #include <rfb/Configuration.h> +#include <rfb/LogWriter.h> using namespace rfb; -IntParameter zlibLevel("ZlibLevel","Zlib compression level",-1); +static LogWriter vlog("ZRLEEncoder"); + +IntParameter zlibLevel("ZlibLevel","[DEPRECATED] Zlib compression level",-1); ZRLEEncoder::ZRLEEncoder(SConnection* conn) : Encoder(conn, encodingZRLE, EncoderPlain, 127), - zos(0,zlibLevel), mos(129*1024) + zos(0, 2), mos(129*1024) { + if (zlibLevel != -1) { + vlog.info("Warning: The ZlibLevel option is deprecated and is " + "ignored by the server. The compression level can be set " + "by the client instead."); + } zos.setUnderlying(&mos); } @@ -50,6 +58,11 @@ bool ZRLEEncoder::isSupported() return conn->client.supportsEncoding(encodingZRLE); } +void ZRLEEncoder::setCompressLevel(int level) +{ + zos.setCompressionLevel(level); +} + void ZRLEEncoder::writeRect(const PixelBuffer* pb, const Palette& palette) { int x, y; diff --git a/common/rfb/ZRLEEncoder.h b/common/rfb/ZRLEEncoder.h index 4cfff75d..fa89f10f 100644 --- a/common/rfb/ZRLEEncoder.h +++ b/common/rfb/ZRLEEncoder.h @@ -32,6 +32,8 @@ namespace rfb { virtual bool isSupported(); + virtual void setCompressLevel(int level); + virtual void writeRect(const PixelBuffer* pb, const Palette& palette); virtual void writeSolidRect(int width, int height, const PixelFormat& pf, |