diff --git a/configure.ac b/configure.ac index 9fee310b..bb43e559 100644 --- a/configure.ac +++ b/configure.ac @@ -652,6 +652,17 @@ then [Whether the legacy rdpBitmap API was found])]) fi +# +# FreeRDP: rdpContext +# + +# Check for rdpContext.codecs +if test "x${have_freerdp}" = "xyes" +then + AC_CHECK_MEMBERS([rdpContext.codecs],,, + [[#include ]]) +fi + # # FreeRDP: rdpPalette # diff --git a/src/protocols/rdp/rdp_bitmap.c b/src/protocols/rdp/rdp_bitmap.c index ac62a177..96206d08 100644 --- a/src/protocols/rdp/rdp_bitmap.c +++ b/src/protocols/rdp/rdp_bitmap.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #include @@ -88,7 +87,7 @@ void guac_rdp_bitmap_new(rdpContext* context, rdpBitmap* bitmap) { /* Free existing image, if any */ if (image_buffer != bitmap->data) - free(bitmap->data); + _aligned_free(bitmap->data); /* Store converted image in bitmap */ bitmap->data = image_buffer; @@ -194,13 +193,13 @@ void guac_rdp_bitmap_decompress(rdpContext* context, rdpBitmap* bitmap, UINT8* d int width, int height, int bpp, int length, BOOL compressed, int codec_id) { #endif - UINT32* palette = ((rdp_freerdp_context*) context)->palette; int size = width * height * 4; bitmap->data = (UINT8*) _aligned_malloc(size, 16); if (compressed) { +#ifdef HAVE_RDPCONTEXT_CODECS rdpCodecs* codecs = context->codecs; UINT32* palette = ((rdp_freerdp_context*) context)->palette; @@ -219,16 +218,20 @@ void guac_rdp_bitmap_decompress(rdpContext* context, rdpBitmap* bitmap, UINT8* d &(bitmap->data), PIXEL_FORMAT_XRGB32, -1, 0, 0, width, height, TRUE); } + bitmap->bpp = 32; +#else + bitmap_decompress(data, bitmap->data, width, height, length, bpp, bpp); + bitmap->bpp = bpp; +#endif + + } + else { + freerdp_image_flip(data, bitmap->data, width, height, bpp); + bitmap->bpp = bpp; } - else - freerdp_image_copy( - bitmap->data, PIXEL_FORMAT_XRGB32, -1, 0, 0, - width, height, data, gdi_get_pixel_format(bpp, TRUE), -1, 0, 0, - (BYTE*) palette); bitmap->compressed = FALSE; bitmap->length = size; - bitmap->bpp = 32; }