diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | gst/librfb/rfbdecoder.c | 33 |
2 files changed, 35 insertions, 3 deletions
@@ -1,5 +1,10 @@ 2007-10-16 Thijs Vermeir <thijsvermeir@gmail.com> + * gst/librfb/rfbdecoder.c: + Add the set encodings client message + +2007-10-16 Thijs Vermeir <thijsvermeir@gmail.com> + * gst/librfb/Makefile.am: * gst/librfb/rfb.h: * gst/librfb/rfbbytestream.c: diff --git a/gst/librfb/rfbdecoder.c b/gst/librfb/rfbdecoder.c index f8f9b02d..85658bd4 100644 --- a/gst/librfb/rfbdecoder.c +++ b/gst/librfb/rfbdecoder.c @@ -377,6 +377,33 @@ rfb_decoder_state_security_result (RfbDecoder * decoder) return TRUE; } +/** + * rfb_decoder_state_set_encodings: + * @decoder: The rfb context + * + * Sends the encoding types that the client can decode to the server + * + * Returns: TRUE if initialization was succesfull, FALSE on fail. + */ +static gboolean +rfb_decoder_state_set_encodings (RfbDecoder * decoder) +{ + guint8 *buffer = g_malloc0 (8); // 4 + 4 * nr_of_encodings + + buffer[0] = 2; // message-type + buffer[3] = 1; // number of encodings + + /* RAW encoding (0) */ + + rfb_decoder_send (decoder, buffer, 8); + + g_free (buffer); + + decoder->state = rfb_decoder_state_normal; + + return TRUE; +} + static gboolean rfb_decoder_state_send_client_initialisation (RfbDecoder * decoder) { @@ -433,9 +460,6 @@ rfb_decoder_state_wait_for_server_initialisation (RfbDecoder * decoder) g_free (buffer); GST_DEBUG ("name = %s", decoder->name); - decoder->state = rfb_decoder_state_normal; - decoder->inited = TRUE; - /* check if we need cropping */ if (decoder->offset_x > 0) { @@ -467,6 +491,9 @@ rfb_decoder_state_wait_for_server_initialisation (RfbDecoder * decoder) } } + decoder->state = rfb_decoder_state_set_encodings; + decoder->inited = TRUE; + return TRUE; } |