summaryrefslogtreecommitdiffstats
path: root/x11vnc/misc/turbovnc/convert_rfbserver
diff options
context:
space:
mode:
authorrunge <runge>2009-03-07 22:30:43 +0000
committerrunge <runge>2009-03-07 22:30:43 +0000
commite7152a7f68063a86887a9059728ca26b5404ce51 (patch)
treef7ac5e878e0655840337f10946868231e10dd9ba /x11vnc/misc/turbovnc/convert_rfbserver
parenteb1cc7608b91996199dae88663ee0d14d5d5b3f7 (diff)
downloadlibvncserver-e7152a7f68063a86887a9059728ca26b5404ce51.zip
libvncserver-e7152a7f68063a86887a9059728ca26b5404ce51.tar.gz
Allow range for X11VNC_SKIP_DISPLAY, document grab
Xserver issue. Add progress_client() to proceed more quickly thru handshake. Improvements to turbovnc hack.
Diffstat (limited to 'x11vnc/misc/turbovnc/convert_rfbserver')
-rwxr-xr-xx11vnc/misc/turbovnc/convert_rfbserver49
1 files changed, 49 insertions, 0 deletions
diff --git a/x11vnc/misc/turbovnc/convert_rfbserver b/x11vnc/misc/turbovnc/convert_rfbserver
new file mode 100755
index 0000000..135a1e9
--- /dev/null
+++ b/x11vnc/misc/turbovnc/convert_rfbserver
@@ -0,0 +1,49 @@
+#!/usr/bin/perl
+
+$saw_mark = 0;
+$done = 0;
+
+while (<>) {
+ if (! $saw_mark && /case rfbEncodingServerIdentity:/) {
+ $saw_mark = 1;
+ }
+ if ($saw_mark && !$done && /default:/) {
+ print;
+
+ print <<END;
+ /* for turbovnc */
+#define rfbJpegQualityLevel1 0xFFFFFE01
+#define rfbJpegQualityLevel100 0xFFFFFE64
+#define rfbJpegSubsamp1X 0xFFFFFD00
+#define rfbJpegSubsamp4X 0xFFFFFD01
+#define rfbJpegSubsamp2X 0xFFFFFD02
+#define rfbJpegSubsampGray 0xFFFFFD03
+
+ if ( enc >= (uint32_t)rfbJpegSubsamp1X &&
+ enc <= (uint32_t)rfbJpegSubsampGray ) {
+ /* XXX member really should be tightSubsample not correMaxWidth */
+ cl->correMaxWidth = enc & 0xFF;
+ rfbLog("Using JPEG subsampling %d for client %s\\n",
+ cl->correMaxWidth, cl->host);
+ } else if ( enc >= (uint32_t)rfbEncodingQualityLevel0 &&
+ enc <= (uint32_t)rfbEncodingQualityLevel9 ) {
+ static int JPEG_QUAL[10] = {
+ 5, 10, 15, 25, 37, 50, 60, 70, 75, 80
+ };
+ cl->tightQualityLevel = JPEG_QUAL[enc & 0x0F];
+ /* XXX member really should be tightSubsample not correMaxWidth */
+ cl->correMaxWidth = 2;
+ rfbLog("Using image level Subsample %d Quality %d for client %s\\n",
+ cl->correMaxWidth, cl->tightQualityLevel, cl->host);
+ } else if ( enc >= (uint32_t)rfbJpegQualityLevel1 &&
+ enc <= (uint32_t)rfbJpegQualityLevel100 ) {
+ cl->tightQualityLevel = enc & 0xFF;
+ rfbLog("Using image quality level %d for client %s\\n",
+ cl->tightQualityLevel, cl->host);
+ } else
+END
+ $done = 1;
+ next;
+ }
+ print;
+}
OpenPOWER on IntegriCloud