rdpgfx/server: Fix for windows10 clients
authorzihao.jiang <zihao.jiang@yahoo.com>
Sat, 20 Aug 2016 17:02:13 +0000 (01:02 +0800)
committerzihao.jiang <zihao.jiang@yahoo.com>
Sat, 20 Aug 2016 17:59:40 +0000 (01:59 +0800)
1. Fix order of gfx reset and new-surface. Windows10 client will show black screen with this issue(FreeRDP itself is dramatically immune to this issue)
2. Handle RDPGFX_QOE_FRAME_ACKNOWLEDGE_PDU for FPS control

server/shadow/shadow_client.c

index ba0a803..e978d5b 100644 (file)
@@ -606,6 +606,12 @@ static UINT shadow_client_rdpgfx_frame_acknowledge(RdpgfxServerContext* context,
                                               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);
+       return CHANNEL_RC_OK;
+}
 
 /**
  * Function description
@@ -1172,10 +1178,10 @@ static BOOL shadow_client_send_surface_update(rdpShadowClient* client, SHADOW_GF
                if (!pStatus->gfxSurfaceCreated)
                {
                        /* Only init surface when we have h264 supported */
-                       if (!(ret = shadow_client_rdpgfx_new_surface(client)))
+                       if (!(ret = shadow_client_rdpgfx_reset_graphic(client)))
                                goto out;
 
-                       if (!(ret = shadow_client_rdpgfx_reset_graphic(client)))
+                       if (!(ret = shadow_client_rdpgfx_new_surface(client)))
                                goto out;
 
                        pStatus->gfxSurfaceCreated = TRUE;
@@ -1534,6 +1540,7 @@ static void* shadow_client_thread(rdpShadowClient* client)
                                                }
 
                                                client->rdpgfx->FrameAcknowledge = shadow_client_rdpgfx_frame_acknowledge;
+                                               client->rdpgfx->QoeFrameAcknowledge = shadow_client_rdpgfx_qoe_frame_acknowledge;
 
                                                gfxstatus.gfxOpened = TRUE;
                                                WLog_INFO(TAG, "Gfx Pipeline Opened");