From 89e5fef11f807976da88ce74483d4395dd0b082c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Wed, 10 Sep 2014 11:38:38 -0400 Subject: [PATCH] wfreerdp: fix build on Windows --- client/Windows/wf_gdi.c | 13 ++++++------- client/Windows/wf_graphics.c | 2 +- client/Windows/wf_interface.c | 6 ------ client/Windows/wf_interface.h | 2 -- include/freerdp/codec/interleaved.h | 2 +- libfreerdp/codec/interleaved.c | 2 +- libfreerdp/primitives/CMakeLists.txt | 7 +------ 7 files changed, 10 insertions(+), 24 deletions(-) diff --git a/client/Windows/wf_gdi.c b/client/Windows/wf_gdi.c index 183401632..d02c36970 100644 --- a/client/Windows/wf_gdi.c +++ b/client/Windows/wf_gdi.c @@ -568,15 +568,13 @@ void wf_gdi_surface_bits(wfContext* wfc, SURFACE_BITS_COMMAND* surface_bits_comm RFX_MESSAGE* message; BITMAPINFO bitmap_info; - RFX_CONTEXT* rfx_context = (RFX_CONTEXT*) wfc->rfx_context; - NSC_CONTEXT* nsc_context = (NSC_CONTEXT*) wfc->nsc_context; - tile_bitmap = (char*) malloc(32); ZeroMemory(tile_bitmap, 32); if (surface_bits_command->codecID == RDP_CODEC_ID_REMOTEFX) { - message = rfx_process_message(rfx_context, surface_bits_command->bitmapData, surface_bits_command->bitmapDataLength); + freerdp_client_codecs_prepare(wfc->codecs, FREERDP_CODEC_REMOTEFX); + message = rfx_process_message(wfc->codecs->rfx, surface_bits_command->bitmapData, surface_bits_command->bitmapDataLength); /* blit each tile */ for (i = 0; i < message->numTiles; i++) @@ -607,11 +605,12 @@ void wf_gdi_surface_bits(wfContext* wfc, SURFACE_BITS_COMMAND* surface_bits_comm wf_invalidate_region(wfc, tx, ty, message->rects[i].width, message->rects[i].height); } - rfx_message_free(rfx_context, message); + rfx_message_free(wfc->codecs->rfx, message); } else if (surface_bits_command->codecID == RDP_CODEC_ID_NSCODEC) { - nsc_process_message(nsc_context, surface_bits_command->bpp, surface_bits_command->width, surface_bits_command->height, + freerdp_client_codecs_prepare(wfc->codecs, FREERDP_CODEC_NSCODEC); + nsc_process_message(wfc->codecs->nsc, surface_bits_command->bpp, surface_bits_command->width, surface_bits_command->height, surface_bits_command->bitmapData, surface_bits_command->bitmapDataLength); ZeroMemory(&bitmap_info, sizeof(bitmap_info)); bitmap_info.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); @@ -622,7 +621,7 @@ void wf_gdi_surface_bits(wfContext* wfc, SURFACE_BITS_COMMAND* surface_bits_comm bitmap_info.bmiHeader.biCompression = BI_RGB; SetDIBitsToDevice(wfc->primary->hdc, surface_bits_command->destLeft, surface_bits_command->destTop, surface_bits_command->width, surface_bits_command->height, 0, 0, 0, surface_bits_command->height, - nsc_context->BitmapData, &bitmap_info, DIB_RGB_COLORS); + wfc->codecs->nsc->BitmapData, &bitmap_info, DIB_RGB_COLORS); wf_invalidate_region(wfc, surface_bits_command->destLeft, surface_bits_command->destTop, surface_bits_command->width, surface_bits_command->height); } diff --git a/client/Windows/wf_graphics.c b/client/Windows/wf_graphics.c index e0adc70ac..039f1975d 100644 --- a/client/Windows/wf_graphics.c +++ b/client/Windows/wf_graphics.c @@ -23,7 +23,7 @@ #include -#include +#include #include "wf_gdi.h" #include "wf_graphics.h" diff --git a/client/Windows/wf_interface.c b/client/Windows/wf_interface.c index 8821ae37d..6ed2df709 100644 --- a/client/Windows/wf_interface.c +++ b/client/Windows/wf_interface.c @@ -376,12 +376,6 @@ BOOL wf_post_connect(freerdp* instance) if (settings->RemoteFxCodec) { wfc->tile = wf_image_new(wfc, 64, 64, 32, NULL); - wfc->rfx_context = rfx_context_new(FALSE); - } - - if (settings->NSCodec) - { - wfc->nsc_context = nsc_context_new(); } } diff --git a/client/Windows/wf_interface.h b/client/Windows/wf_interface.h index ff291e0f8..feb0846f7 100644 --- a/client/Windows/wf_interface.h +++ b/client/Windows/wf_interface.h @@ -111,8 +111,6 @@ struct wf_context wfBitmap* tile; DWORD mainThreadId; DWORD keyboardThreadId; - RFX_CONTEXT* rfx_context; - NSC_CONTEXT* nsc_context; BOOL sw_gdi; diff --git a/include/freerdp/codec/interleaved.h b/include/freerdp/codec/interleaved.h index 5f6662b6a..d46abac8e 100644 --- a/include/freerdp/codec/interleaved.h +++ b/include/freerdp/codec/interleaved.h @@ -36,7 +36,7 @@ struct _BITMAP_INTERLEAVED_CONTEXT BYTE* FlipBuffer; }; -int interleaved_decompress(BITMAP_INTERLEAVED_CONTEXT* interleaved, BYTE* pSrcData, UINT32 SrcSize, int bpp, +FREERDP_API int interleaved_decompress(BITMAP_INTERLEAVED_CONTEXT* interleaved, BYTE* pSrcData, UINT32 SrcSize, int bpp, BYTE** ppDstData, DWORD DstFormat, int nDstStep, int nXDst, int nYDst, int nWidth, int nHeight); FREERDP_API BITMAP_INTERLEAVED_CONTEXT* bitmap_interleaved_context_new(BOOL Compressor); diff --git a/libfreerdp/codec/interleaved.c b/libfreerdp/codec/interleaved.c index 68a224b90..05525156f 100644 --- a/libfreerdp/codec/interleaved.c +++ b/libfreerdp/codec/interleaved.c @@ -316,7 +316,7 @@ BITMAP_INTERLEAVED_CONTEXT* bitmap_interleaved_context_new(BOOL Compressor) { BITMAP_INTERLEAVED_CONTEXT* interleaved; - interleaved = (BITMAP_INTERLEAVED_CONTEXT*) calloc(1, sizeof(BITMAP_INTERLEAVED_CONTEXT*)); + interleaved = (BITMAP_INTERLEAVED_CONTEXT*) calloc(1, sizeof(BITMAP_INTERLEAVED_CONTEXT)); if (interleaved) { diff --git a/libfreerdp/primitives/CMakeLists.txt b/libfreerdp/primitives/CMakeLists.txt index 8830e76b8..0cf492670 100644 --- a/libfreerdp/primitives/CMakeLists.txt +++ b/libfreerdp/primitives/CMakeLists.txt @@ -60,7 +60,7 @@ if(WITH_SSE2) endif() if(MSVC) - set(OPTIMIZATION "${OPTIMIZATION} /arch:SSE2 /O2") + set(OPTIMIZATION "${OPTIMIZATION} /arch:SSE2") endif() elseif(WITH_NEON) if(CMAKE_COMPILER_IS_GNUCC) @@ -76,11 +76,6 @@ if(CMAKE_COMPILER_IS_GNUCC) set_property(SOURCE ${${MODULE_PREFIX}_SRCS} PROPERTY COMPILE_FLAGS "-O2") endif() -if(MSVC) - set_property(SOURCE ${${MODULE_PREFIX}_SRCS} PROPERTY COMPILE_FLAGS "/O2") -endif() - - set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} ${${MODULE_PREFIX}_OPT_SRCS}) add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT"