Commit d4cbaa0c authored by Christian Beier's avatar Christian Beier

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.
parent c5821384
...@@ -393,10 +393,8 @@ rfbNewTCPOrUDPClient(rfbScreenInfoPtr rfbScreen, ...@@ -393,10 +393,8 @@ rfbNewTCPOrUDPClient(rfbScreenInfoPtr rfbScreen,
#if defined(LIBVNCSERVER_HAVE_LIBZ) || defined(LIBVNCSERVER_HAVE_LIBPNG) #if defined(LIBVNCSERVER_HAVE_LIBZ) || defined(LIBVNCSERVER_HAVE_LIBPNG)
cl->tightQualityLevel = -1; cl->tightQualityLevel = -1;
#if defined(LIBVNCSERVER_HAVE_LIBJPEG) || defined(LIBVNCSERVER_HAVE_LIBPNG)
cl->tightCompressLevel = TIGHT_DEFAULT_COMPRESSION;
#endif
#ifdef LIBVNCSERVER_HAVE_LIBJPEG #ifdef LIBVNCSERVER_HAVE_LIBJPEG
cl->tightCompressLevel = TIGHT_DEFAULT_COMPRESSION;
cl->turboSubsampLevel = TURBO_DEFAULT_SUBSAMP; cl->turboSubsampLevel = TURBO_DEFAULT_SUBSAMP;
{ {
int i; int i;
...@@ -1983,10 +1981,8 @@ rfbProcessClientNormalMessage(rfbClientPtr cl) ...@@ -1983,10 +1981,8 @@ rfbProcessClientNormalMessage(rfbClientPtr cl)
cl->enableServerIdentity = FALSE; cl->enableServerIdentity = FALSE;
#if defined(LIBVNCSERVER_HAVE_LIBZ) || defined(LIBVNCSERVER_HAVE_LIBPNG) #if defined(LIBVNCSERVER_HAVE_LIBZ) || defined(LIBVNCSERVER_HAVE_LIBPNG)
cl->tightQualityLevel = -1; cl->tightQualityLevel = -1;
#if defined(LIBVNCSERVER_HAVE_LIBJPEG) || defined(LIBVNCSERVER_HAVE_LIBPNG)
cl->tightCompressLevel = TIGHT_DEFAULT_COMPRESSION;
#endif
#ifdef LIBVNCSERVER_HAVE_LIBJPEG #ifdef LIBVNCSERVER_HAVE_LIBJPEG
cl->tightCompressLevel = TIGHT_DEFAULT_COMPRESSION;
cl->turboSubsampLevel = TURBO_DEFAULT_SUBSAMP; cl->turboSubsampLevel = TURBO_DEFAULT_SUBSAMP;
cl->turboQualityLevel = -1; cl->turboQualityLevel = -1;
#endif #endif
...@@ -2115,7 +2111,7 @@ rfbProcessClientNormalMessage(rfbClientPtr cl) ...@@ -2115,7 +2111,7 @@ rfbProcessClientNormalMessage(rfbClientPtr cl)
if ( enc >= (uint32_t)rfbEncodingCompressLevel0 && if ( enc >= (uint32_t)rfbEncodingCompressLevel0 &&
enc <= (uint32_t)rfbEncodingCompressLevel9 ) { enc <= (uint32_t)rfbEncodingCompressLevel9 ) {
cl->zlibCompressLevel = enc & 0x0F; cl->zlibCompressLevel = enc & 0x0F;
#if defined(LIBVNCSERVER_HAVE_LIBJPEG) || defined(LIBVNCSERVER_HAVE_LIBPNG) #ifdef LIBVNCSERVER_HAVE_LIBJPEG
cl->tightCompressLevel = enc & 0x0F; cl->tightCompressLevel = enc & 0x0F;
rfbLog("Using compression level %d for client %s\n", rfbLog("Using compression level %d for client %s\n",
cl->tightCompressLevel, cl->host); cl->tightCompressLevel, cl->host);
...@@ -2856,7 +2852,7 @@ rfbSendFramebufferUpdate(rfbClientPtr cl, ...@@ -2856,7 +2852,7 @@ rfbSendFramebufferUpdate(rfbClientPtr cl,
sraRgnReleaseIterator(i); i=NULL; sraRgnReleaseIterator(i); i=NULL;
#endif #endif
#endif #endif
#ifdef LIBVNCSERVER_HAVE_LIBPNG #if defined(LIBVNCSERVER_HAVE_LIBJPEG) && defined(LIBVNCSERVER_HAVE_LIBPNG)
} else if (cl->preferredEncoding == rfbEncodingTightPng) { } else if (cl->preferredEncoding == rfbEncodingTightPng) {
nUpdateRegionRects = 0; nUpdateRegionRects = 0;
...@@ -2988,25 +2984,23 @@ rfbSendFramebufferUpdate(rfbClientPtr cl, ...@@ -2988,25 +2984,23 @@ rfbSendFramebufferUpdate(rfbClientPtr cl,
if (!rfbSendRectEncodingZlib(cl, x, y, w, h)) if (!rfbSendRectEncodingZlib(cl, x, y, w, h))
goto updateFailed; goto updateFailed;
break; break;
case rfbEncodingZRLE:
case rfbEncodingZYWRLE:
if (!rfbSendRectEncodingZRLE(cl, x, y, w, h))
goto updateFailed;
break;
#endif
#ifdef LIBVNCSERVER_HAVE_LIBJPEG #ifdef LIBVNCSERVER_HAVE_LIBJPEG
case rfbEncodingTight: case rfbEncodingTight:
if (!rfbSendRectEncodingTight(cl, x, y, w, h)) if (!rfbSendRectEncodingTight(cl, x, y, w, h))
goto updateFailed; goto updateFailed;
break; break;
#endif
#endif
#ifdef LIBVNCSERVER_HAVE_LIBPNG #ifdef LIBVNCSERVER_HAVE_LIBPNG
case rfbEncodingTightPng: case rfbEncodingTightPng:
if (!rfbSendRectEncodingTightPng(cl, x, y, w, h)) if (!rfbSendRectEncodingTightPng(cl, x, y, w, h))
goto updateFailed; goto updateFailed;
break; break;
#endif #endif
#ifdef LIBVNCSERVER_HAVE_LIBZ
case rfbEncodingZRLE:
case rfbEncodingZYWRLE:
if (!rfbSendRectEncodingZRLE(cl, x, y, w, h))
goto updateFailed;
break;
#endif #endif
} }
} }
......
...@@ -603,8 +603,6 @@ typedef struct _rfbClientRec { ...@@ -603,8 +603,6 @@ typedef struct _rfbClientRec {
z_stream zsStruct[4]; z_stream zsStruct[4];
rfbBool zsActive[4]; rfbBool zsActive[4];
int zsLevel[4]; int zsLevel[4];
#endif
#if defined(LIBVNCSERVER_HAVE_LIBJPEG) || defined(LIBVNCSERVER_HAVE_LIBPNG)
int tightCompressLevel; int tightCompressLevel;
#endif #endif
#endif #endif
...@@ -880,22 +878,18 @@ extern rfbBool rfbSendRectEncodingUltra(rfbClientPtr cl, int x,int y,int w,int h ...@@ -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, extern rfbBool rfbSendRectEncodingZlib(rfbClientPtr cl, int x, int y, int w,
int h); int h);
#if defined(LIBVNCSERVER_HAVE_LIBJPEG) || defined(LIBVNCSERVER_HAVE_LIBPNG) #ifdef LIBVNCSERVER_HAVE_LIBJPEG
/* tight.c */ /* tight.c */
#define TIGHT_DEFAULT_COMPRESSION 6 #define TIGHT_DEFAULT_COMPRESSION 6
#ifdef LIBVNCSERVER_HAVE_LIBJPEG
#define TURBO_DEFAULT_SUBSAMP 0 #define TURBO_DEFAULT_SUBSAMP 0
#endif
extern rfbBool rfbTightDisableGradient; extern rfbBool rfbTightDisableGradient;
extern int rfbNumCodedRectsTight(rfbClientPtr cl, int x,int y,int w,int h); 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); extern rfbBool rfbSendRectEncodingTight(rfbClientPtr cl, int x,int y,int w,int h);
#endif
#if defined(LIBVNCSERVER_HAVE_LIBPNG) #if defined(LIBVNCSERVER_HAVE_LIBPNG)
extern rfbBool rfbSendRectEncodingTightPng(rfbClientPtr cl, int x,int y,int w,int h); extern rfbBool rfbSendRectEncodingTightPng(rfbClientPtr cl, int x,int y,int w,int h);
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment