shadow: fix surface frame markers
This commit is contained in:
parent
ea84067c80
commit
41282e569f
@ -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,38 +402,29 @@ 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;
|
||||||
for (i = 0; i < numMessages; i++)
|
cmd.destTop = nYSrc;
|
||||||
{
|
cmd.destRight = cmd.destLeft + nWidth;
|
||||||
Stream_SetPosition(s, 0);
|
cmd.destBottom = cmd.destTop + nHeight;
|
||||||
|
cmd.width = nWidth;
|
||||||
nsc_write_message(encoder->nsc, s, &messages[i]);
|
cmd.height = nHeight;
|
||||||
nsc_message_free(encoder->nsc, &messages[i]);
|
|
||||||
|
|
||||||
cmd.destLeft = messages[i].x;
|
|
||||||
cmd.destTop = messages[i].y;
|
|
||||||
cmd.destRight = messages[i].x + messages[i].width;
|
|
||||||
cmd.destBottom = messages[i].y + messages[i].height;
|
|
||||||
cmd.width = messages[i].width;
|
|
||||||
cmd.height = messages[i].height;
|
|
||||||
|
|
||||||
cmd.bitmapDataLength = Stream_GetPosition(s);
|
cmd.bitmapDataLength = Stream_GetPosition(s);
|
||||||
cmd.bitmapData = Stream_Buffer(s);
|
cmd.bitmapData = Stream_Buffer(s);
|
||||||
|
|
||||||
first = (i == 0) ? TRUE : FALSE;
|
first = TRUE;
|
||||||
last = ((i + 1) == numMessages) ? TRUE : FALSE;
|
last = TRUE;
|
||||||
|
|
||||||
if (!encoder->frameAck)
|
if (!encoder->frameAck)
|
||||||
IFCALL(update->SurfaceBits, update->context, &cmd);
|
IFCALL(update->SurfaceBits, update->context, &cmd);
|
||||||
@ -436,9 +432,6 @@ int shadow_client_send_surface_bits(rdpShadowClient* client, rdpShadowSurface* s
|
|||||||
IFCALL(update->SurfaceFrameBits, update->context, &cmd, first, last, frameId);
|
IFCALL(update->SurfaceFrameBits, update->context, &cmd, first, last, frameId);
|
||||||
}
|
}
|
||||||
|
|
||||||
free(messages);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user