From: Vic Lee Date: Tue, 16 Aug 2011 07:04:57 +0000 (+0800) Subject: libfreerdp-core/fastpath: add FastPath orders, bitmap, palette update. X-Git-Tag: 1.0-beta1~313^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=51d151ef0c177a9e8bedac98a46cea59430e1196;p=platform%2Fupstream%2Ffreerdp.git libfreerdp-core/fastpath: add FastPath orders, bitmap, palette update. --- diff --git a/libfreerdp-core/fastpath.c b/libfreerdp-core/fastpath.c index 0dfa1f5..a96b942 100644 --- a/libfreerdp-core/fastpath.c +++ b/libfreerdp-core/fastpath.c @@ -22,6 +22,9 @@ #include #include +#include "orders.h" +#include "update.h" + #include "fastpath.h" /** @@ -129,23 +132,58 @@ static void fastpath_recv_update_surfcmds(rdpFastPath* fastpath, uint16 size, ST } } +static void fastpath_recv_orders(rdpFastPath* fastpath, STREAM* s) +{ + rdpUpdate* update = fastpath->rdp->update; + uint16 numberOrders; + + stream_read_uint16(s, numberOrders); /* numberOrders (2 bytes) */ + + printf("numberOrders(FastPath):%d\n", numberOrders); + + while (numberOrders > 0) + { + update_recv_order(update, s); + numberOrders--; + } +} + +static void fastpath_recv_update_common(rdpFastPath* fastpath, STREAM* s) +{ + rdpUpdate* update = fastpath->rdp->update; + uint16 updateType; + + stream_read_uint16(s, updateType); /* updateType (2 bytes) */ + + switch (updateType) + { + case UPDATE_TYPE_BITMAP: + update_read_bitmap(update, s, &update->bitmap_update); + IFCALL(update->Bitmap, update, &update->bitmap_update); + break; + + case UPDATE_TYPE_PALETTE: + update_read_palette(update, s, &update->palette_update); + IFCALL(update->Palette, update, &update->palette_update); + break; + } +} + static void fastpath_recv_update(rdpFastPath* fastpath, uint8 updateCode, uint16 size, STREAM* s) { switch (updateCode) { case FASTPATH_UPDATETYPE_ORDERS: - printf("FASTPATH_UPDATETYPE_ORDERS\n"); + fastpath_recv_orders(fastpath, s); break; case FASTPATH_UPDATETYPE_BITMAP: - printf("FASTPATH_UPDATETYPE_BITMAP\n"); - break; - case FASTPATH_UPDATETYPE_PALETTE: - printf("FASTPATH_UPDATETYPE_PALETTE\n"); + fastpath_recv_update_common(fastpath, s); break; case FASTPATH_UPDATETYPE_SYNCHRONIZE: + IFCALL(fastpath->rdp->update->Synchronize, fastpath->rdp->update); break; case FASTPATH_UPDATETYPE_SURFCMDS: diff --git a/libfreerdp-core/settings.c b/libfreerdp-core/settings.c index 27d653b..c1d57be 100644 --- a/libfreerdp-core/settings.c +++ b/libfreerdp-core/settings.c @@ -110,6 +110,7 @@ rdpSettings* settings_new() settings->num_icon_cache_entries = 12; settings->fastpath_input = True; + settings->fastpath_output = True; settings->uniconv = freerdp_uniconv_new(); gethostname(settings->client_hostname, sizeof(settings->client_hostname) - 1);