shadow: fix frame acks + bitmap negotiation
This commit is contained in:
parent
09fc388e03
commit
aa2e6dacbb
@ -132,6 +132,7 @@ struct _RDP_SHADOW_ENTRY_POINTS
|
||||
RDP_SHADOW_ENTRY_POINTS ep; \
|
||||
HANDLE event; \
|
||||
int numMonitors; \
|
||||
int captureFrameRate; \
|
||||
int selectedMonitor; \
|
||||
MONITOR_DEF monitors[16]; \
|
||||
MONITOR_DEF virtualScreen; \
|
||||
|
@ -341,6 +341,15 @@ BOOL rdp_read_bitmap_capability_set(wStream* s, UINT16 length, rdpSettings* sett
|
||||
settings->DesktopHeight = desktopHeight;
|
||||
}
|
||||
|
||||
if (settings->DrawAllowSkipAlpha)
|
||||
settings->DrawAllowSkipAlpha = (drawingFlags & DRAW_ALLOW_SKIP_ALPHA) ? TRUE : FALSE;
|
||||
|
||||
if (settings->DrawAllowDynamicColorFidelity)
|
||||
settings->DrawAllowDynamicColorFidelity = (drawingFlags & DRAW_ALLOW_DYNAMIC_COLOR_FIDELITY) ? TRUE : FALSE;
|
||||
|
||||
if (settings->DrawAllowColorSubsampling)
|
||||
settings->DrawAllowColorSubsampling = (drawingFlags & DRAW_ALLOW_COLOR_SUBSAMPLING) ? TRUE : FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -365,10 +374,10 @@ void rdp_write_bitmap_capability_set(wStream* s, rdpSettings* settings)
|
||||
if (settings->DrawAllowSkipAlpha)
|
||||
drawingFlags |= DRAW_ALLOW_SKIP_ALPHA;
|
||||
|
||||
if (settings->DrawAllowColorSubsampling)
|
||||
if (settings->DrawAllowDynamicColorFidelity)
|
||||
drawingFlags |= DRAW_ALLOW_DYNAMIC_COLOR_FIDELITY;
|
||||
|
||||
if (settings->DrawAllowDynamicColorFidelity)
|
||||
if (settings->DrawAllowColorSubsampling)
|
||||
drawingFlags |= DRAW_ALLOW_COLOR_SUBSAMPLING; /* currently unimplemented */
|
||||
|
||||
/* While bitmap_decode.c now implements YCoCg, in turning it
|
||||
|
@ -35,11 +35,13 @@
|
||||
#include <winpr/image.h>
|
||||
#include <winpr/sysinfo.h>
|
||||
|
||||
#include <freerdp/log.h>
|
||||
#include <freerdp/codec/color.h>
|
||||
#include <freerdp/codec/region.h>
|
||||
#include <freerdp/log.h>
|
||||
|
||||
#include "../shadow_screen.h"
|
||||
#include "../shadow_client.h"
|
||||
#include "../shadow_encoder.h"
|
||||
#include "../shadow_capture.h"
|
||||
#include "../shadow_surface.h"
|
||||
#include "../shadow_subsystem.h"
|
||||
@ -488,6 +490,18 @@ int x11_shadow_screen_grab(x11ShadowSubsystem* subsystem)
|
||||
|
||||
DeleteSynchronizationBarrier(&(subsystem->barrier));
|
||||
|
||||
if (count == 1)
|
||||
{
|
||||
rdpShadowClient* client;
|
||||
|
||||
client = (rdpShadowClient*) ArrayList_GetItem(server->clients, 0);
|
||||
|
||||
if (client)
|
||||
{
|
||||
subsystem->captureFrameRate = client->encoder->fps;
|
||||
}
|
||||
}
|
||||
|
||||
ResetEvent(subsystem->updateEvent);
|
||||
|
||||
region16_clear(&(subsystem->invalidRegion));
|
||||
@ -548,7 +562,6 @@ int x11_shadow_subsystem_process_message(x11ShadowSubsystem* subsystem, wMessage
|
||||
|
||||
void* x11_shadow_subsystem_thread(x11ShadowSubsystem* subsystem)
|
||||
{
|
||||
int fps;
|
||||
XEvent xevent;
|
||||
DWORD status;
|
||||
DWORD nCount;
|
||||
@ -566,8 +579,8 @@ void* x11_shadow_subsystem_thread(x11ShadowSubsystem* subsystem)
|
||||
events[nCount++] = subsystem->event;
|
||||
events[nCount++] = MessageQueue_Event(MsgPipe->In);
|
||||
|
||||
fps = 16;
|
||||
dwInterval = 1000 / fps;
|
||||
subsystem->captureFrameRate = 16;
|
||||
dwInterval = 1000 / subsystem->captureFrameRate;
|
||||
frameTime = GetTickCount64() + dwInterval;
|
||||
|
||||
while (1)
|
||||
@ -602,7 +615,7 @@ void* x11_shadow_subsystem_thread(x11ShadowSubsystem* subsystem)
|
||||
x11_shadow_query_cursor(subsystem, FALSE);
|
||||
x11_shadow_screen_grab(subsystem);
|
||||
|
||||
dwInterval = 1000 / fps;
|
||||
dwInterval = 1000 / subsystem->captureFrameRate;
|
||||
frameTime += dwInterval;
|
||||
}
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ void shadow_client_context_new(freerdp_peer* peer, rdpShadowClient* client)
|
||||
|
||||
client->StopEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
|
||||
|
||||
client->encoder = shadow_encoder_new(server);
|
||||
client->encoder = shadow_encoder_new(client);
|
||||
|
||||
ArrayList_Add(server->clients, (void*) client);
|
||||
}
|
||||
|
@ -166,9 +166,13 @@ int shadow_encoder_init_nsc(rdpShadowEncoder* encoder)
|
||||
|
||||
int shadow_encoder_init_bitmap(rdpShadowEncoder* encoder)
|
||||
{
|
||||
DWORD planarFlags;
|
||||
DWORD planarFlags = 0;
|
||||
rdpContext* context = (rdpContext*) encoder->client;
|
||||
rdpSettings* settings = context->settings;
|
||||
|
||||
if (settings->DrawAllowSkipAlpha)
|
||||
planarFlags |= PLANAR_FORMAT_HEADER_NA;
|
||||
|
||||
planarFlags = PLANAR_FORMAT_HEADER_NA;
|
||||
planarFlags |= PLANAR_FORMAT_HEADER_RLE;
|
||||
|
||||
if (!encoder->planar)
|
||||
@ -346,15 +350,17 @@ int shadow_encoder_prepare(rdpShadowEncoder* encoder, UINT32 codecs)
|
||||
return 1;
|
||||
}
|
||||
|
||||
rdpShadowEncoder* shadow_encoder_new(rdpShadowServer* server)
|
||||
rdpShadowEncoder* shadow_encoder_new(rdpShadowClient* client)
|
||||
{
|
||||
rdpShadowEncoder* encoder;
|
||||
rdpShadowServer* server = client->server;
|
||||
|
||||
encoder = (rdpShadowEncoder*) calloc(1, sizeof(rdpShadowEncoder));
|
||||
|
||||
if (!encoder)
|
||||
return NULL;
|
||||
|
||||
encoder->client = client;
|
||||
encoder->server = server;
|
||||
|
||||
encoder->fps = 16;
|
||||
|
@ -35,6 +35,7 @@
|
||||
|
||||
struct rdp_shadow_encoder
|
||||
{
|
||||
rdpShadowClient* client;
|
||||
rdpShadowServer* server;
|
||||
|
||||
int width;
|
||||
@ -70,7 +71,7 @@ int shadow_encoder_reset(rdpShadowEncoder* encoder);
|
||||
int shadow_encoder_prepare(rdpShadowEncoder* encoder, UINT32 codecs);
|
||||
int shadow_encoder_create_frame_id(rdpShadowEncoder* encoder);
|
||||
|
||||
rdpShadowEncoder* shadow_encoder_new(rdpShadowServer* server);
|
||||
rdpShadowEncoder* shadow_encoder_new(rdpShadowClient* client);
|
||||
void shadow_encoder_free(rdpShadowEncoder* encoder);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
Loading…
Reference in New Issue
Block a user