vnc: split encoding in specific files

This will allow to implement new encodings (tight, zrle, ..)
in a cleaner way. This may hurt performances, because some
functions like vnc_convert_pixel are not static anymore, but
should not be a problem with gcc 4.5 and the new -flto.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Corentin Chary 2010-05-03 14:31:34 +02:00 committed by Anthony Liguori
parent bc47d201d6
commit 70a4568fe0
6 changed files with 300 additions and 211 deletions

29
vnc.h
View file

@ -132,8 +132,6 @@ struct VncState
int last_y;
uint32_t vnc_encoding;
uint8_t tight_quality;
uint8_t tight_compression;
int major;
int minor;
@ -152,7 +150,6 @@ struct VncState
Buffer input;
/* current output mode information */
VncWritePixels *write_pixels;
VncSendHextileTile *send_hextile_tile;
DisplaySurface clientds;
CaptureVoiceOut *audio_cap;
@ -164,6 +161,16 @@ struct VncState
uint8_t modifiers_state[256];
QEMUPutLEDEntry *led;
/* Encoding specific */
/* Tight */
uint8_t tight_quality;
uint8_t tight_compression;
/* Hextile */
VncSendHextileTile *send_hextile_tile;
/* Zlib */
Buffer zlib;
Buffer zlib_tmp;
z_stream zlib_stream[4];
@ -376,4 +383,20 @@ void buffer_append(Buffer *buffer, const void *data, size_t len);
char *vnc_socket_local_addr(const char *format, int fd);
char *vnc_socket_remote_addr(const char *format, int fd);
/* Framebuffer */
void vnc_framebuffer_update(VncState *vs, int x, int y, int w, int h,
int32_t encoding);
void vnc_convert_pixel(VncState *vs, uint8_t *buf, uint32_t v);
/* Encodings */
void vnc_raw_send_framebuffer_update(VncState *vs, int x, int y, int w, int h);
void vnc_hextile_send_framebuffer_update(VncState *vs, int x,
int y, int w, int h);
void vnc_hextile_set_pixel_conversion(VncState *vs, int generic);
void vnc_zlib_init(VncState *vs);
void vnc_zlib_send_framebuffer_update(VncState *vs, int x, int y, int w, int h);
#endif /* __QEMU_VNC_H */