diff options
author | Thijs Vermeir <thijsvermeir@gmail.com> | 2007-10-16 19:24:31 +0000 |
---|---|---|
committer | Thijs Vermeir <thijsvermeir@gmail.com> | 2007-10-16 19:24:31 +0000 |
commit | dec4ec1f5c0b347884cb6ed9455b9f66a290f04a (patch) | |
tree | 60d0e23406ee2227f04ddb25bdc86909e98c8f3a /gst | |
parent | 48b7ba004d2e2128a6d4d28011c843389459d8a5 (diff) | |
download | gst-plugins-bad-dec4ec1f5c0b347884cb6ed9455b9f66a290f04a.tar.gz gst-plugins-bad-dec4ec1f5c0b347884cb6ed9455b9f66a290f04a.tar.bz2 gst-plugins-bad-dec4ec1f5c0b347884cb6ed9455b9f66a290f04a.zip |
gst/librfb/rfbdecoder.c: Add the set encodings client message
Original commit message from CVS:
* gst/librfb/rfbdecoder.c:
Add the set encodings client message
Diffstat (limited to 'gst')
-rw-r--r-- | gst/librfb/rfbdecoder.c | 33 |
1 files changed, 30 insertions, 3 deletions
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; } |