diff options
author | steven_carr <steven_carr> | 2006-05-02 20:53:25 +0000 |
---|---|---|
committer | steven_carr <steven_carr> | 2006-05-02 20:53:25 +0000 |
commit | afa9fae0248650cb358463c37756c3560da4b57a (patch) | |
tree | 4e34bcd908ed5c32e0f2863d19615a27a2f2278d /libvncserver/rfbserver.c | |
parent | e57c4dcd714b74ff84d5817197e80ca5d0fcff3e (diff) | |
download | libtdevnc-afa9fae0248650cb358463c37756c3560da4b57a.tar.gz libtdevnc-afa9fae0248650cb358463c37756c3560da4b57a.zip |
Ultra Encoding added. Tested against UltraVNC V1.01
Diffstat (limited to 'libvncserver/rfbserver.c')
-rw-r--r-- | libvncserver/rfbserver.c | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/libvncserver/rfbserver.c b/libvncserver/rfbserver.c index 93b6c0f..9c52382 100644 --- a/libvncserver/rfbserver.c +++ b/libvncserver/rfbserver.c @@ -884,6 +884,13 @@ rfbProcessClientNormalMessage(rfbClientPtr cl) cl->host); } break; + case rfbEncodingUltra: + if (cl->preferredEncoding == -1) { + cl->preferredEncoding = enc; + rfbLog("Using Ultra encoding for client %s\n", + cl->host); + } + break; #ifdef LIBVNCSERVER_HAVE_LIBZ case rfbEncodingZlib: if (cl->preferredEncoding == -1) { @@ -1399,6 +1406,17 @@ rfbSendFramebufferUpdate(rfbClientPtr cl, nUpdateRegionRects += rectsPerRow*rows; } sraRgnReleaseIterator(i); + } else if (cl->preferredEncoding == rfbEncodingUltra) { + nUpdateRegionRects = 0; + + for(i = sraRgnGetIterator(updateRegion); sraRgnIteratorNext(i,&rect);){ + int x = rect.x1; + int y = rect.y1; + int w = rect.x2 - x; + int h = rect.y2 - y; + nUpdateRegionRects += (((h-1) / (ULTRA_MAX_SIZE( w ) / w)) + 1); + } + sraRgnReleaseIterator(i); #ifdef LIBVNCSERVER_HAVE_LIBZ } else if (cl->preferredEncoding == rfbEncodingZlib) { nUpdateRegionRects = 0; @@ -1437,14 +1455,16 @@ rfbSendFramebufferUpdate(rfbClientPtr cl, fu->type = rfbFramebufferUpdate; if (nUpdateRegionRects != 0xFFFF) { if(cl->screen->maxRectsPerUpdate>0 + /* CoRRE splits the screen into smaller squares */ + && cl->preferredEncoding != rfbEncodingCoRRE + /* Ultra encoding splits rectangles up into smaller chunks */ + && cl->preferredEncoding != rfbEncodingUltra #ifdef LIBVNCSERVER_HAVE_LIBZ + /* Zlib encoding splits rectangles up into smaller chunks */ + && cl->preferredEncoding != rfbEncodingZlib #ifdef LIBVNCSERVER_HAVE_LIBJPEG /* Tight encoding counts the rectangles differently */ && cl->preferredEncoding != rfbEncodingTight - /* XXX Should rfbEncodingCoRRE be in here? */ - && cl->preferredEncoding != rfbEncodingCoRRE - /* Zlib encoding splits rectangles up into smaller chunks */ - && cl->preferredEncoding != rfbEncodingZlib #endif #endif && nUpdateRegionRects>cl->screen->maxRectsPerUpdate) { @@ -1510,6 +1530,10 @@ rfbSendFramebufferUpdate(rfbClientPtr cl, if (!rfbSendRectEncodingHextile(cl, x, y, w, h)) goto updateFailed; break; + case rfbEncodingUltra: + if (!rfbSendRectEncodingUltra(cl, x, y, w, h)) + goto updateFailed; + break; #ifdef LIBVNCSERVER_HAVE_LIBZ case rfbEncodingZlib: if (!rfbSendRectEncodingZlib(cl, x, y, w, h)) |