#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);
}
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;
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,
the screen. Default is on.
.
.TP
-.B \-ZlibLevel \fIlevel\fP
-Zlib compression level for ZRLE encoding (it does not affect Tight encoding).
-Acceptable values are between 0 and 9. Default is to use the standard
-compression level provided by the \fBzlib\fP(3) compression library.
-.
-.TP
.B \-ImprovedHextile
Use improved compression algorithm for Hextile encoding which achieves better
compression ratios by the cost of using slightly more CPU time. Default is
\fB2\fP.
.
.TP
-.B \-ZlibLevel \fIlevel\fP
-Zlib compression level for ZRLE encoding (it does not affect Tight encoding).
-Acceptable values are between 0 and 9. Default is to use the standard
-compression level provided by the \fBzlib\fP(3) compression library.
-.
-.TP
.B \-ImprovedHextile
Use improved compression algorithm for Hextile encoding which achieves better
compression ratios by the cost of using slightly more CPU time. Default is