wfreerdp-server: fix negotiation of codecs
This commit is contained in:
parent
174d070471
commit
c62a82e228
@ -1434,6 +1434,7 @@ void rdp_read_bitmap_codecs_capability_set(STREAM* s, uint16 length, rdpSettings
|
||||
{
|
||||
settings->rfx_codec = false;
|
||||
settings->ns_codec = false;
|
||||
settings->jpeg_codec = false;
|
||||
}
|
||||
|
||||
while (bitmapCodecCount > 0)
|
||||
@ -1444,7 +1445,7 @@ void rdp_read_bitmap_codecs_capability_set(STREAM* s, uint16 length, rdpSettings
|
||||
stream_read_uint8(s, settings->rfx_codec_id);
|
||||
settings->rfx_codec = true;
|
||||
}
|
||||
else if (settings->server_mode && strncmp((char*)stream_get_tail(s),CODEC_GUID_NSCODEC, 16) == 0)
|
||||
else if (settings->server_mode && strncmp((char*)stream_get_tail(s), CODEC_GUID_NSCODEC, 16) == 0)
|
||||
{
|
||||
stream_seek(s, 16); /*codec GUID (16 bytes) */
|
||||
stream_read_uint8(s, settings->ns_codec_id);
|
||||
@ -1562,7 +1563,6 @@ void rdp_write_nsc_server_capability_container(STREAM* s, rdpSettings* settings)
|
||||
stream_write_uint32(s, 0); /* reserved */
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Write bitmap codecs capability set.\n
|
||||
* @msdn{dd891377}
|
||||
@ -1578,6 +1578,7 @@ void rdp_write_bitmap_codecs_capability_set(STREAM* s, rdpSettings* settings)
|
||||
header = rdp_capability_set_start(s);
|
||||
|
||||
bitmapCodecCount = 0;
|
||||
|
||||
if (settings->rfx_codec)
|
||||
bitmapCodecCount++;
|
||||
if (settings->ns_codec)
|
||||
|
@ -530,17 +530,29 @@ static void update_send_pointer_cached(rdpContext* context, POINTER_CACHED_UPDAT
|
||||
|
||||
boolean update_read_refresh_rect(rdpUpdate* update, STREAM* s)
|
||||
{
|
||||
int index;
|
||||
uint8 numberOfAreas;
|
||||
RECTANGLE_16* areas;
|
||||
|
||||
if (stream_get_left(s) < 4)
|
||||
return false;
|
||||
|
||||
stream_read_uint8(s, numberOfAreas);
|
||||
stream_seek(s, 3); /* pad3Octects */
|
||||
if (stream_get_left(s) < numberOfAreas * 8)
|
||||
return false;
|
||||
|
||||
IFCALL(update->RefreshRect, update->context, numberOfAreas, (RECTANGLE_16*) stream_get_tail(s));
|
||||
areas = (RECTANGLE_16*) malloc(sizeof(RECTANGLE_16) * numberOfAreas);
|
||||
|
||||
for (index = 0; index < numberOfAreas; index++)
|
||||
{
|
||||
stream_read_uint16(s, areas[index].left);
|
||||
stream_read_uint16(s, areas[index].top);
|
||||
stream_read_uint16(s, areas[index].right);
|
||||
stream_read_uint16(s, areas[index].bottom);
|
||||
}
|
||||
|
||||
IFCALL(update->RefreshRect, update->context, numberOfAreas, areas);
|
||||
|
||||
free(areas);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -176,11 +176,16 @@ static DWORD WINAPI wf_peer_main_loop(LPVOID lpParam)
|
||||
DWORD nCount;
|
||||
DWORD status;
|
||||
HANDLE handles[32];
|
||||
rdpSettings* settings;
|
||||
wfPeerContext* context;
|
||||
freerdp_peer* client = (freerdp_peer*) lpParam;
|
||||
|
||||
wf_peer_init(client);
|
||||
|
||||
settings = client->settings;
|
||||
settings->rfx_codec = true;
|
||||
settings->ns_codec = false;
|
||||
settings->jpeg_codec = false;
|
||||
wf_peer_read_settings(client);
|
||||
|
||||
client->PostConnect = wf_peer_post_connect;
|
||||
|
Loading…
Reference in New Issue
Block a user