GUAC-852: Use old bitmap_decompress if no codecs in context. Restore use of freerdp_image_flip.
This commit is contained in:
parent
7fae39b593
commit
f401597f10
11
configure.ac
11
configure.ac
@ -652,6 +652,17 @@ then
|
|||||||
[Whether the legacy rdpBitmap API was found])])
|
[Whether the legacy rdpBitmap API was found])])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#
|
||||||
|
# FreeRDP: rdpContext
|
||||||
|
#
|
||||||
|
|
||||||
|
# Check for rdpContext.codecs
|
||||||
|
if test "x${have_freerdp}" = "xyes"
|
||||||
|
then
|
||||||
|
AC_CHECK_MEMBERS([rdpContext.codecs],,,
|
||||||
|
[[#include <freerdp/freerdp.h>]])
|
||||||
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
# FreeRDP: rdpPalette
|
# FreeRDP: rdpPalette
|
||||||
#
|
#
|
||||||
|
@ -31,7 +31,6 @@
|
|||||||
#include <freerdp/codec/bitmap.h>
|
#include <freerdp/codec/bitmap.h>
|
||||||
#include <freerdp/codec/color.h>
|
#include <freerdp/codec/color.h>
|
||||||
#include <freerdp/freerdp.h>
|
#include <freerdp/freerdp.h>
|
||||||
#include <freerdp/gdi/gdi.h>
|
|
||||||
#include <guacamole/client.h>
|
#include <guacamole/client.h>
|
||||||
#include <guacamole/socket.h>
|
#include <guacamole/socket.h>
|
||||||
|
|
||||||
@ -88,7 +87,7 @@ void guac_rdp_bitmap_new(rdpContext* context, rdpBitmap* bitmap) {
|
|||||||
|
|
||||||
/* Free existing image, if any */
|
/* Free existing image, if any */
|
||||||
if (image_buffer != bitmap->data)
|
if (image_buffer != bitmap->data)
|
||||||
free(bitmap->data);
|
_aligned_free(bitmap->data);
|
||||||
|
|
||||||
/* Store converted image in bitmap */
|
/* Store converted image in bitmap */
|
||||||
bitmap->data = image_buffer;
|
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) {
|
int width, int height, int bpp, int length, BOOL compressed, int codec_id) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
UINT32* palette = ((rdp_freerdp_context*) context)->palette;
|
|
||||||
int size = width * height * 4;
|
int size = width * height * 4;
|
||||||
|
|
||||||
bitmap->data = (UINT8*) _aligned_malloc(size, 16);
|
bitmap->data = (UINT8*) _aligned_malloc(size, 16);
|
||||||
|
|
||||||
if (compressed) {
|
if (compressed) {
|
||||||
|
|
||||||
|
#ifdef HAVE_RDPCONTEXT_CODECS
|
||||||
rdpCodecs* codecs = context->codecs;
|
rdpCodecs* codecs = context->codecs;
|
||||||
UINT32* palette = ((rdp_freerdp_context*) context)->palette;
|
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->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->compressed = FALSE;
|
||||||
bitmap->length = size;
|
bitmap->length = size;
|
||||||
bitmap->bpp = 32;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user