diff options
author | Christian Beier <dontmind@freeshell.org> | 2012-04-30 21:26:58 +0200 |
---|---|---|
committer | Christian Beier <dontmind@freeshell.org> | 2012-04-30 21:26:58 +0200 |
commit | d4cbaa0c17c512c9bd1de429779a9ee0ed927aed (patch) | |
tree | ff7663b65c25ac89ac3d73f8d7a0d1316a21fb4e | |
parent | c58213846eb962718a2435f65e02345d3f132f5b (diff) | |
download | libtdevnc-d4cbaa0c17c512c9bd1de429779a9ee0ed927aed.tar.gz libtdevnc-d4cbaa0c17c512c9bd1de429779a9ee0ed927aed.zip |
Only try to build TightPNG stuff when libjpeg is available.
TightPNG replaces the ZLIB stuff int Tight encoding with PNG. It still
uses JPEG rects as well. Theoretically, we could build TightPNG with only
libpng and libjpeg - without zlib - but libpng depends on zlib, so this is
kinda moot.
-rw-r--r-- | libvncserver/rfbserver.c | 26 | ||||
-rw-r--r-- | rfb/rfb.h | 10 |
2 files changed, 12 insertions, 24 deletions
diff --git a/libvncserver/rfbserver.c b/libvncserver/rfbserver.c index 9b0673c..51921dc 100644 --- a/libvncserver/rfbserver.c +++ b/libvncserver/rfbserver.c @@ -393,10 +393,8 @@ rfbNewTCPOrUDPClient(rfbScreenInfoPtr rfbScreen, #if defined(LIBVNCSERVER_HAVE_LIBZ) || defined(LIBVNCSERVER_HAVE_LIBPNG) cl->tightQualityLevel = -1; -#if defined(LIBVNCSERVER_HAVE_LIBJPEG) || defined(LIBVNCSERVER_HAVE_LIBPNG) - cl->tightCompressLevel = TIGHT_DEFAULT_COMPRESSION; -#endif #ifdef LIBVNCSERVER_HAVE_LIBJPEG + cl->tightCompressLevel = TIGHT_DEFAULT_COMPRESSION; cl->turboSubsampLevel = TURBO_DEFAULT_SUBSAMP; { int i; @@ -1983,10 +1981,8 @@ rfbProcessClientNormalMessage(rfbClientPtr cl) cl->enableServerIdentity = FALSE; #if defined(LIBVNCSERVER_HAVE_LIBZ) || defined(LIBVNCSERVER_HAVE_LIBPNG) cl->tightQualityLevel = -1; -#if defined(LIBVNCSERVER_HAVE_LIBJPEG) || defined(LIBVNCSERVER_HAVE_LIBPNG) - cl->tightCompressLevel = TIGHT_DEFAULT_COMPRESSION; -#endif #ifdef LIBVNCSERVER_HAVE_LIBJPEG + cl->tightCompressLevel = TIGHT_DEFAULT_COMPRESSION; cl->turboSubsampLevel = TURBO_DEFAULT_SUBSAMP; cl->turboQualityLevel = -1; #endif @@ -2115,7 +2111,7 @@ rfbProcessClientNormalMessage(rfbClientPtr cl) if ( enc >= (uint32_t)rfbEncodingCompressLevel0 && enc <= (uint32_t)rfbEncodingCompressLevel9 ) { cl->zlibCompressLevel = enc & 0x0F; -#if defined(LIBVNCSERVER_HAVE_LIBJPEG) || defined(LIBVNCSERVER_HAVE_LIBPNG) +#ifdef LIBVNCSERVER_HAVE_LIBJPEG cl->tightCompressLevel = enc & 0x0F; rfbLog("Using compression level %d for client %s\n", cl->tightCompressLevel, cl->host); @@ -2856,7 +2852,7 @@ rfbSendFramebufferUpdate(rfbClientPtr cl, sraRgnReleaseIterator(i); i=NULL; #endif #endif -#ifdef LIBVNCSERVER_HAVE_LIBPNG +#if defined(LIBVNCSERVER_HAVE_LIBJPEG) && defined(LIBVNCSERVER_HAVE_LIBPNG) } else if (cl->preferredEncoding == rfbEncodingTightPng) { nUpdateRegionRects = 0; @@ -2988,25 +2984,23 @@ rfbSendFramebufferUpdate(rfbClientPtr cl, if (!rfbSendRectEncodingZlib(cl, x, y, w, h)) goto updateFailed; break; + case rfbEncodingZRLE: + case rfbEncodingZYWRLE: + if (!rfbSendRectEncodingZRLE(cl, x, y, w, h)) + goto updateFailed; + break; +#endif #ifdef LIBVNCSERVER_HAVE_LIBJPEG case rfbEncodingTight: if (!rfbSendRectEncodingTight(cl, x, y, w, h)) goto updateFailed; break; -#endif -#endif #ifdef LIBVNCSERVER_HAVE_LIBPNG case rfbEncodingTightPng: if (!rfbSendRectEncodingTightPng(cl, x, y, w, h)) goto updateFailed; break; #endif -#ifdef LIBVNCSERVER_HAVE_LIBZ - case rfbEncodingZRLE: - case rfbEncodingZYWRLE: - if (!rfbSendRectEncodingZRLE(cl, x, y, w, h)) - goto updateFailed; - break; #endif } } @@ -603,8 +603,6 @@ typedef struct _rfbClientRec { z_stream zsStruct[4]; rfbBool zsActive[4]; int zsLevel[4]; -#endif -#if defined(LIBVNCSERVER_HAVE_LIBJPEG) || defined(LIBVNCSERVER_HAVE_LIBPNG) int tightCompressLevel; #endif #endif @@ -880,22 +878,18 @@ extern rfbBool rfbSendRectEncodingUltra(rfbClientPtr cl, int x,int y,int w,int h extern rfbBool rfbSendRectEncodingZlib(rfbClientPtr cl, int x, int y, int w, int h); -#if defined(LIBVNCSERVER_HAVE_LIBJPEG) || defined(LIBVNCSERVER_HAVE_LIBPNG) +#ifdef LIBVNCSERVER_HAVE_LIBJPEG /* tight.c */ #define TIGHT_DEFAULT_COMPRESSION 6 - -#ifdef LIBVNCSERVER_HAVE_LIBJPEG #define TURBO_DEFAULT_SUBSAMP 0 -#endif extern rfbBool rfbTightDisableGradient; extern int rfbNumCodedRectsTight(rfbClientPtr cl, int x,int y,int w,int h); -#if defined(LIBVNCSERVER_HAVE_LIBJPEG) extern rfbBool rfbSendRectEncodingTight(rfbClientPtr cl, int x,int y,int w,int h); -#endif + #if defined(LIBVNCSERVER_HAVE_LIBPNG) extern rfbBool rfbSendRectEncodingTightPng(rfbClientPtr cl, int x,int y,int w,int h); #endif |