From ebc699dde821b7917d52e893bca39ba7ca2a3dd9 Mon Sep 17 00:00:00 2001 From: C-o-r-E Date: Mon, 20 Aug 2012 16:49:25 -0400 Subject: [PATCH] wfreerdp-server: greatly improved performance --- server/Windows/wf_info.c | 2 +- server/Windows/wf_peer.c | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/server/Windows/wf_info.c b/server/Windows/wf_info.c index 762cba2f3..95419b407 100644 --- a/server/Windows/wf_info.c +++ b/server/Windows/wf_info.c @@ -225,7 +225,7 @@ void wf_info_find_invalid_region(wfInfo* info) info->invalid_y2 = 0; } - printf("\tFIND = (%d, %d), (%d, %d)\n", info->invalid_x1, info->invalid_y1, info->invalid_x2, info->invalid_y2); + //printf("\tFIND = (%d, %d), (%d, %d)\n", info->invalid_x1, info->invalid_y1, info->invalid_x2, info->invalid_y2); for(i = info->lastUpdate; i != info->nextUpdate; i = (i+1) % MAXCHANGES_BUF ) { /*printf("\t(%d, %d), (%d, %d)\n", diff --git a/server/Windows/wf_peer.c b/server/Windows/wf_peer.c index 5da855cbd..0b6cc2e59 100644 --- a/server/Windows/wf_peer.c +++ b/server/Windows/wf_peer.c @@ -50,7 +50,7 @@ static DWORD WINAPI wf_peer_mirror_monitor(LPVOID lpParam) freerdp_peer* client; unsigned long i; - rate = 1000; + rate = 42; client = (freerdp_peer*)lpParam; //todo: make sure we dont encode after no clients @@ -75,7 +75,7 @@ static DWORD WINAPI wf_peer_mirror_monitor(LPVOID lpParam) diff = end - start; if(diff < rate) { - printf("sleeping for %d ms...\n", rate - diff); + //printf("sleeping for %d ms...\n", rate - diff); Sleep(rate - diff); } @@ -128,11 +128,11 @@ void wf_rfx_encode(freerdp_peer* client) break; } - printf("encode %d\n", wfi->nextUpdate - wfi->lastUpdate); - printf("\tinvlaid region = (%d, %d), (%d, %d)\n", wfi->invalid_x1, wfi->invalid_y1, wfi->invalid_x2, wfi->invalid_y2); + //printf("encode %d\n", wfi->nextUpdate - wfi->lastUpdate); + //printf("\tinvlaid region = (%d, %d), (%d, %d)\n", wfi->invalid_x1, wfi->invalid_y1, wfi->invalid_x2, wfi->invalid_y2); - wfi->lastUpdate = wfi->nextUpdate; + //wfi->lastUpdate = wfi->nextUpdate; width = wfi->invalid_x2 - wfi->invalid_x1; height = wfi->invalid_y2 - wfi->invalid_y1; @@ -148,7 +148,7 @@ void wf_rfx_encode(freerdp_peer* client) offset = (4 * wfi->invalid_x1) + (wfi->invalid_y1 * wfi->width * 4); - printf("width = %d, height = %d\n", width, height); + //printf("width = %d, height = %d\n", width, height); rfx_compose_message(wfp->rfx_context, s, &rect, 1, ((uint8*) (buf->Userbuffer)) + offset, width, height, wfi->width * 4); @@ -268,11 +268,13 @@ void wf_peer_send_changes(rdpUpdate* update) wf_info_updated(wfInfoSingleton); + /* printf("\tSend..."); printf("\t(%d, %d), (%d, %d) [%dx%d]\n", update->surface_bits_command.destLeft, update->surface_bits_command.destTop, update->surface_bits_command.destRight, update->surface_bits_command.destBottom, update->surface_bits_command.width, update->surface_bits_command.height); + */ update->SurfaceBits(update->context, &update->surface_bits_command); //wf_info_clear_invalid_region(wfInfoSingleton); wfInfoSingleton->enc_data = false;