libfreerdp-core/fastpath: add FastPath orders, bitmap, palette update.

This commit is contained in:
Vic Lee 2011-08-16 15:04:57 +08:00
parent b6a10ea451
commit 51d151ef0c
2 changed files with 44 additions and 5 deletions

View File

@ -22,6 +22,9 @@
#include <string.h>
#include <freerdp/utils/stream.h>
#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:

View File

@ -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);