Merge pull request #5423 from kubistika/feat/bitmap-auto-flag-calculate

rdpUpdate: add autoBitmapDataCalculate
This commit is contained in:
David Fort 2019-06-12 21:15:59 +02:00 committed by GitHub
commit 1f128b6142
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 9 deletions

View File

@ -253,6 +253,11 @@ struct rdp_update
rdpBounds currentBounds;
rdpBounds previousBounds;
CRITICAL_SECTION mux;
/* if autoCalculateBitmapData is set to TRUE, the server automatically
* fills BITMAP_DATA struct members: flags, cbCompMainBodySize and cbCompFirstRowSize.
*/
BOOL autoCalculateBitmapData;
};
#endif /* FREERDP_UPDATE_H */

View File

@ -148,16 +148,19 @@ static BOOL update_write_bitmap_data(rdpUpdate* update, wStream* s,
if (!Stream_EnsureRemainingCapacity(s, 64 + bitmapData->bitmapLength))
return FALSE;
bitmapData->flags = 0;
bitmapData->cbCompFirstRowSize = 0;
if (bitmapData->compressed)
bitmapData->flags |= BITMAP_COMPRESSION;
if (update->context->settings->NoBitmapCompressionHeader)
if (update->autoCalculateBitmapData)
{
bitmapData->flags |= NO_BITMAP_COMPRESSION_HDR;
bitmapData->cbCompMainBodySize = bitmapData->bitmapLength;
bitmapData->flags = 0;
bitmapData->cbCompFirstRowSize = 0;
if (bitmapData->compressed)
bitmapData->flags |= BITMAP_COMPRESSION;
if (update->context->settings->NoBitmapCompressionHeader)
{
bitmapData->flags |= NO_BITMAP_COMPRESSION_HDR;
bitmapData->cbCompMainBodySize = bitmapData->bitmapLength;
}
}
Stream_Write_UINT16(s, bitmapData->destLeft);
@ -2190,6 +2193,7 @@ rdpUpdate* update_new(rdpRdp* rdp)
deleteList->cIndices = 0;
update->SuppressOutput = update_send_suppress_output;
update->initialState = TRUE;
update->autoCalculateBitmapData = TRUE;
update->queue = MessageQueue_New(&cb);
if (!update->queue)

View File

@ -98,6 +98,8 @@ static BOOL pf_client_pre_connect(freerdp* instance)
* Only override it if you plan to implement custom order
* callbacks or deactiveate certain features.
*/
ZeroMemory(instance->settings->OrderSupport, 32);
/**
* Register the channel listeners.
* They are required to set up / tear down channels if they are loaded.

View File

@ -241,6 +241,9 @@ static DWORD WINAPI pf_server_handle_client(LPVOID arg)
goto out_free_peer;
}
ZeroMemory(client->settings->OrderSupport, 32);
client->update->autoCalculateBitmapData = FALSE;
pdata->ps = ps;
/* keep configuration in proxyData */
pdata->config = client->ContextExtra;