[server,shadow] do not fall back to surfacebits

If GFX channel is desired, do not fall back to surface bits command.
This will break mstsc connections after a DesktopResize was sent.
This commit is contained in:
Armin Novak 2023-03-06 13:35:16 +01:00 committed by David Fort
parent e796508c1a
commit 340101e35e

View File

@ -223,7 +223,7 @@ static BOOL shadow_client_context_new(freerdp_peer* peer, rdpContext* context)
settings->DrawAllowSkipAlpha = TRUE;
settings->DrawAllowColorSubsampling = TRUE;
settings->DrawAllowDynamicColorFidelity = TRUE;
settings->CompressionLevel = PACKET_COMPR_TYPE_RDP6;
settings->CompressionLevel = PACKET_COMPR_TYPE_RDP8;
if (server->ipcSocket && (strncmp(bind_address, server->ipcSocket,
strnlen(bind_address, sizeof(bind_address))) != 0))
@ -1795,31 +1795,38 @@ static BOOL shadow_client_send_surface_update(rdpShadowClient* client, SHADOW_GF
// PRId64 " height: %" PRId64 " right: %" PRId64 " bottom: %" PRId64, nXSrc, nYSrc, nWidth,
// nHeight, nXSrc + nWidth, nYSrc + nHeight);
if (settings->SupportGraphicsPipeline && pStatus->gfxOpened)
if (settings->SupportGraphicsPipeline)
{
/* GFX/h264 always full screen encoded */
nWidth = settings->DesktopWidth;
nHeight = settings->DesktopHeight;
/* Create primary surface if have not */
if (!pStatus->gfxSurfaceCreated)
if (pStatus->gfxOpened)
{
/* Only init surface when we have h264 supported */
if (!(ret = shadow_client_rdpgfx_reset_graphic(client)))
goto out;
/* GFX/h264 always full screen encoded */
nWidth = settings->DesktopWidth;
nHeight = settings->DesktopHeight;
if (!(ret = shadow_client_rdpgfx_new_surface(client)))
goto out;
/* Create primary surface if have not */
if (!pStatus->gfxSurfaceCreated)
{
/* Only init surface when we have h264 supported */
if (!(ret = shadow_client_rdpgfx_reset_graphic(client)))
goto out;
pStatus->gfxSurfaceCreated = TRUE;
if (!(ret = shadow_client_rdpgfx_new_surface(client)))
goto out;
pStatus->gfxSurfaceCreated = TRUE;
}
WINPR_ASSERT(nWidth >= 0);
WINPR_ASSERT(nWidth <= UINT16_MAX);
WINPR_ASSERT(nHeight >= 0);
WINPR_ASSERT(nHeight <= UINT16_MAX);
ret = shadow_client_send_surface_gfx(client, pSrcData, nSrcStep, SrcFormat, 0, 0,
(UINT16)nWidth, (UINT16)nHeight);
}
else
{
ret = TRUE;
}
WINPR_ASSERT(nWidth >= 0);
WINPR_ASSERT(nWidth <= UINT16_MAX);
WINPR_ASSERT(nHeight >= 0);
WINPR_ASSERT(nHeight <= UINT16_MAX);
ret = shadow_client_send_surface_gfx(client, pSrcData, nSrcStep, SrcFormat, 0, 0,
(UINT16)nWidth, (UINT16)nHeight);
}
else if (settings->RemoteFxCodec || freerdp_settings_get_bool(settings, FreeRDP_NSCodec))
{