Merge pull request #3664 from realjiangms/fix_gfx_ack

Server/shadow: Fix handling for gfx acknowledge according to spec
This commit is contained in:
Bernhard Miklautz 2017-01-23 13:49:25 +01:00 committed by GitHub
commit f37e9a0adc
3 changed files with 13 additions and 13 deletions

View File

@ -594,21 +594,19 @@ static BOOL shadow_client_surface_frame_acknowledge(rdpShadowClient* client,
UINT32 frameId)
{
shadow_client_common_frame_acknowledge(client, frameId);
/*
* Reset queueDepth for legacy none RDPGFX acknowledge
*/
client->encoder->queueDepth = QUEUE_DEPTH_UNAVAILABLE;
return TRUE;
}
static UINT shadow_client_rdpgfx_frame_acknowledge(RdpgfxServerContext* context,
RDPGFX_FRAME_ACKNOWLEDGE_PDU* frameAcknowledge)
{
shadow_client_common_frame_acknowledge((rdpShadowClient*)context->custom,
frameAcknowledge->frameId);
return CHANNEL_RC_OK;
}
static UINT shadow_client_rdpgfx_qoe_frame_acknowledge(RdpgfxServerContext*
context, RDPGFX_QOE_FRAME_ACKNOWLEDGE_PDU* qoeFrameAcknowledge)
{
shadow_client_common_frame_acknowledge((rdpShadowClient*)context->custom,
qoeFrameAcknowledge->frameId);
rdpShadowClient* client = (rdpShadowClient*)context->custom;
shadow_client_common_frame_acknowledge(client, frameAcknowledge->frameId);
client->encoder->queueDepth = frameAcknowledge->queueDepth;
return CHANNEL_RC_OK;
}
@ -1602,8 +1600,6 @@ static void* shadow_client_thread(rdpShadowClient* client)
!gfxstatus.gfxOpened)
{
client->rdpgfx->FrameAcknowledge = shadow_client_rdpgfx_frame_acknowledge;
client->rdpgfx->QoeFrameAcknowledge =
shadow_client_rdpgfx_qoe_frame_acknowledge;
client->rdpgfx->CapsAdvertise = shadow_client_rdpgfx_caps_advertise;
if (!client->rdpgfx->Open(client->rdpgfx))

View File

@ -34,12 +34,15 @@ int shadow_encoder_preferred_fps(rdpShadowEncoder* encoder)
UINT32 shadow_encoder_inflight_frames(rdpShadowEncoder* encoder)
{
/* Return inflight frame count =
/* Return inflight frame count.
* If queueDepth is SUSPEND_FRAME_ACKNOWLEDGEMENT, count = 0
* Otherwise, calculate count =
* <last sent frame id> - <last client-acknowledged frame id>
* Note: This function is exported so that subsystem could
* implement its own strategy to tune fps.
*/
return encoder->frameId - encoder->lastAckframeId;
return (encoder->queueDepth == SUSPEND_FRAME_ACKNOWLEDGEMENT) ? 0 : encoder->frameId -
encoder->lastAckframeId;
}
UINT32 shadow_encoder_create_frame_id(rdpShadowEncoder* encoder)

View File

@ -56,6 +56,7 @@ struct rdp_shadow_encoder
BOOL frameAck;
UINT32 frameId;
UINT32 lastAckframeId;
UINT32 queueDepth;
};
#ifdef __cplusplus