summaryrefslogtreecommitdiffstats
path: root/rfb
diff options
context:
space:
mode:
authordscho <dscho>2005-05-23 19:26:12 +0000
committerdscho <dscho>2005-05-23 19:26:12 +0000
commit669b4c86855cc11a8904f4acb4039a14b91cbf6d (patch)
tree9575e388cfbac5bcdd63aa54ae053c465d93dc62 /rfb
parentdc1094f03c10c2d863a15f1d8638ea8742e42f32 (diff)
downloadlibvncserver-669b4c86855cc11a8904f4acb4039a14b91cbf6d.zip
libvncserver-669b4c86855cc11a8904f4acb4039a14b91cbf6d.tar.gz
make zlib and tight handling thread safe (static -> rfbClient)
Diffstat (limited to 'rfb')
-rw-r--r--rfb/rfbclient.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/rfb/rfbclient.h b/rfb/rfbclient.h
index b094ce2..5d34526 100644
--- a/rfb/rfbclient.h
+++ b/rfb/rfbclient.h
@@ -132,6 +132,50 @@ typedef struct _rfbClient {
char *bufoutptr;
int buffered;
+ /* The zlib encoding requires expansion/decompression/deflation of the
+ compressed data in the "buffer" above into another, result buffer.
+ However, the size of the result buffer can be determined precisely
+ based on the bitsPerPixel, height and width of the rectangle. We
+ allocate this buffer one time to be the full size of the buffer. */
+
+#ifdef LIBVNCSERVER_HAVE_LIBZ
+ int raw_buffer_size;
+ char *raw_buffer;
+
+ z_stream decompStream;
+ rfbBool decompStreamInited;
+
+#endif
+
+
+#ifdef LIBVNCSERVER_HAVE_LIBJPEG
+ /*
+ * Variables for the ``tight'' encoding implementation.
+ */
+
+ /* Separate buffer for compressed data. */
+#define ZLIB_BUFFER_SIZE 30000
+ char zlib_buffer[ZLIB_BUFFER_SIZE];
+
+ /* Four independent compression streams for zlib library. */
+ z_stream zlibStream[4];
+ rfbBool zlibStreamActive[4];
+
+ /* Filter stuff. Should be initialized by filter initialization code. */
+ rfbBool cutZeros;
+ int rectWidth, rectColors;
+ char tightPalette[256*4];
+ uint8_t tightPrevRow[2048*3*sizeof(uint16_t)];
+
+ /* JPEG decoder state. */
+ rfbBool jpegError;
+
+ struct jpeg_source_mgr* jpegSrcManager;
+ void* jpegBufferPtr;
+ size_t jpegBufferLen;
+
+#endif
+
/* cursor.c */
uint8_t *rcSource, *rcMask;
OpenPOWER on IntegriCloud