diff --git a/server/shadow/shadow_client.c b/server/shadow/shadow_client.c index 34ff24535..414df5c7e 100644 --- a/server/shadow/shadow_client.c +++ b/server/shadow/shadow_client.c @@ -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)) diff --git a/server/shadow/shadow_encoder.c b/server/shadow/shadow_encoder.c index 8fc77ef27..b9d1cb55b 100644 --- a/server/shadow/shadow_encoder.c +++ b/server/shadow/shadow_encoder.c @@ -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 = * - * 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) diff --git a/server/shadow/shadow_encoder.h b/server/shadow/shadow_encoder.h index b2c01b908..611850d1d 100644 --- a/server/shadow/shadow_encoder.h +++ b/server/shadow/shadow_encoder.h @@ -56,6 +56,7 @@ struct rdp_shadow_encoder BOOL frameAck; UINT32 frameId; UINT32 lastAckframeId; + UINT32 queueDepth; }; #ifdef __cplusplus