Commit 3d9a5639 authored by dscho's avatar dscho

Move tightQualityLevel out of the JPEG specific part

The variable tightQualityLevel is used for ZYWRLE compression, too,
so if libjpeg is not present, but libz is, we still need to have
that struct member.
Signed-off-by: 's avatarJohannes Schindelin <johannes.schindelin@gmx.de>
parent ce8d6c24
...@@ -369,9 +369,9 @@ rfbNewTCPOrUDPClient(rfbScreenInfoPtr rfbScreen, ...@@ -369,9 +369,9 @@ rfbNewTCPOrUDPClient(rfbScreenInfoPtr rfbScreen,
UNLOCK(rfbClientListMutex); UNLOCK(rfbClientListMutex);
#ifdef LIBVNCSERVER_HAVE_LIBZ #ifdef LIBVNCSERVER_HAVE_LIBZ
cl->tightQualityLevel = -1;
#ifdef LIBVNCSERVER_HAVE_LIBJPEG #ifdef LIBVNCSERVER_HAVE_LIBJPEG
cl->tightCompressLevel = TIGHT_DEFAULT_COMPRESSION; cl->tightCompressLevel = TIGHT_DEFAULT_COMPRESSION;
cl->tightQualityLevel = -1;
{ {
int i; int i;
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
...@@ -2004,12 +2004,12 @@ rfbProcessClientNormalMessage(rfbClientPtr cl) ...@@ -2004,12 +2004,12 @@ rfbProcessClientNormalMessage(rfbClientPtr cl)
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);
#endif
} else if ( enc >= (uint32_t)rfbEncodingQualityLevel0 && } else if ( enc >= (uint32_t)rfbEncodingQualityLevel0 &&
enc <= (uint32_t)rfbEncodingQualityLevel9 ) { enc <= (uint32_t)rfbEncodingQualityLevel9 ) {
cl->tightQualityLevel = enc & 0x0F; cl->tightQualityLevel = enc & 0x0F;
rfbLog("Using image quality level %d for client %s\n", rfbLog("Using image quality level %d for client %s\n",
cl->tightQualityLevel, cl->host); cl->tightQualityLevel, cl->host);
#endif
} else } else
#endif #endif
{ {
......
...@@ -525,6 +525,8 @@ typedef struct _rfbClientRec { ...@@ -525,6 +525,8 @@ typedef struct _rfbClientRec {
struct z_stream_s compStream; struct z_stream_s compStream;
rfbBool compStreamInited; rfbBool compStreamInited;
uint32_t zlibCompressLevel; uint32_t zlibCompressLevel;
/* the quality level is also used by ZYWRLE */
int tightQualityLevel;
#ifdef LIBVNCSERVER_HAVE_LIBJPEG #ifdef LIBVNCSERVER_HAVE_LIBJPEG
/* tight encoding -- preserve zlib streams' state for each client */ /* tight encoding -- preserve zlib streams' state for each client */
...@@ -532,7 +534,6 @@ typedef struct _rfbClientRec { ...@@ -532,7 +534,6 @@ typedef struct _rfbClientRec {
rfbBool zsActive[4]; rfbBool zsActive[4];
int zsLevel[4]; int zsLevel[4];
int tightCompressLevel; int tightCompressLevel;
int tightQualityLevel;
#endif #endif
#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