shadow: fix surface frame markers

This commit is contained in:
Marc-André Moreau 2014-09-24 12:10:02 -04:00
parent ea84067c80
commit 41282e569f
2 changed files with 29 additions and 33 deletions

View File

@ -45,7 +45,7 @@ void shadow_client_context_new(freerdp_peer* peer, rdpShadowClient* client)
settings = peer->settings; settings = peer->settings;
settings->ColorDepth = 32; settings->ColorDepth = 32;
settings->NSCodec = FALSE; settings->NSCodec = TRUE;
settings->RemoteFxCodec = TRUE; settings->RemoteFxCodec = TRUE;
settings->BitmapCacheV3Enabled = TRUE; settings->BitmapCacheV3Enabled = TRUE;
settings->FrameMarkerCommandEnabled = TRUE; settings->FrameMarkerCommandEnabled = TRUE;
@ -258,8 +258,13 @@ BOOL shadow_client_activate(freerdp_peer* peer)
if (strcmp(settings->ClientDir, "librdp") == 0) if (strcmp(settings->ClientDir, "librdp") == 0)
{ {
/* Hack for Mac/iOS/Android Microsoft RDP clients */ /* Hack for Mac/iOS/Android Microsoft RDP clients */
settings->RemoteFxCodec = FALSE; settings->RemoteFxCodec = FALSE;
settings->NSCodec = FALSE;
settings->NSCodecAllowSubsampling = FALSE; settings->NSCodecAllowSubsampling = FALSE;
settings->SurfaceFrameMarkerEnabled = FALSE;
} }
client->activated = TRUE; client->activated = TRUE;
@ -397,46 +402,34 @@ int shadow_client_send_surface_bits(rdpShadowClient* client, rdpShadowSurface* s
} }
else if (settings->NSCodec) else if (settings->NSCodec)
{ {
NSC_MESSAGE* messages;
shadow_encoder_prepare(encoder, FREERDP_CODEC_NSCODEC); shadow_encoder_prepare(encoder, FREERDP_CODEC_NSCODEC);
s = encoder->bs; s = encoder->bs;
Stream_SetPosition(s, 0);
messages = nsc_encode_messages(encoder->nsc, pSrcData, pSrcData = &pSrcData[(nYSrc * nSrcStep) + (nXSrc * 4)];
nXSrc, nYSrc, nWidth, nHeight, nSrcStep,
&numMessages, settings->MultifragMaxRequestSize); nsc_compose_message(encoder->nsc, s, pSrcData, nWidth, nHeight, nSrcStep);
cmd.bpp = 32; cmd.bpp = 32;
cmd.codecID = settings->NSCodecId; cmd.codecID = settings->NSCodecId;
cmd.destLeft = nXSrc;
cmd.destTop = nYSrc;
cmd.destRight = cmd.destLeft + nWidth;
cmd.destBottom = cmd.destTop + nHeight;
cmd.width = nWidth;
cmd.height = nHeight;
for (i = 0; i < numMessages; i++) cmd.bitmapDataLength = Stream_GetPosition(s);
{ cmd.bitmapData = Stream_Buffer(s);
Stream_SetPosition(s, 0);
nsc_write_message(encoder->nsc, s, &messages[i]); first = TRUE;
nsc_message_free(encoder->nsc, &messages[i]); last = TRUE;
cmd.destLeft = messages[i].x; if (!encoder->frameAck)
cmd.destTop = messages[i].y; IFCALL(update->SurfaceBits, update->context, &cmd);
cmd.destRight = messages[i].x + messages[i].width; else
cmd.destBottom = messages[i].y + messages[i].height; IFCALL(update->SurfaceFrameBits, update->context, &cmd, first, last, frameId);
cmd.width = messages[i].width;
cmd.height = messages[i].height;
cmd.bitmapDataLength = Stream_GetPosition(s);
cmd.bitmapData = Stream_Buffer(s);
first = (i == 0) ? TRUE : FALSE;
last = ((i + 1) == numMessages) ? TRUE : FALSE;
if (!encoder->frameAck)
IFCALL(update->SurfaceBits, update->context, &cmd);
else
IFCALL(update->SurfaceFrameBits, update->context, &cmd, first, last, frameId);
}
free(messages);
} }
return 1; return 1;

View File

@ -114,6 +114,9 @@ int shadow_encoder_uninit_grid(rdpShadowEncoder* encoder)
int shadow_encoder_init_rfx(rdpShadowEncoder* encoder) int shadow_encoder_init_rfx(rdpShadowEncoder* encoder)
{ {
rdpContext* context = (rdpContext*) encoder->client;
rdpSettings* settings = context->settings;
if (!encoder->rfx) if (!encoder->rfx)
encoder->rfx = rfx_context_new(TRUE); encoder->rfx = rfx_context_new(TRUE);
@ -131,8 +134,8 @@ int shadow_encoder_init_rfx(rdpShadowEncoder* encoder)
encoder->fps = 16; encoder->fps = 16;
encoder->maxFps = 32; encoder->maxFps = 32;
encoder->frameId = 0; encoder->frameId = 0;
encoder->frameAck = TRUE;
encoder->frameList = ListDictionary_New(TRUE); encoder->frameList = ListDictionary_New(TRUE);
encoder->frameAck = settings->SurfaceFrameMarkerEnabled;
} }
encoder->codecs |= FREERDP_CODEC_REMOTEFX; encoder->codecs |= FREERDP_CODEC_REMOTEFX;
@ -158,8 +161,8 @@ int shadow_encoder_init_nsc(rdpShadowEncoder* encoder)
encoder->fps = 16; encoder->fps = 16;
encoder->maxFps = 32; encoder->maxFps = 32;
encoder->frameId = 0; encoder->frameId = 0;
encoder->frameAck = TRUE;
encoder->frameList = ListDictionary_New(TRUE); encoder->frameList = ListDictionary_New(TRUE);
encoder->frameAck = settings->SurfaceFrameMarkerEnabled;
} }
encoder->nsc->ColorLossLevel = settings->NSCodecColorLossLevel; encoder->nsc->ColorLossLevel = settings->NSCodecColorLossLevel;