mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
channels/rdpgfx: improve frame ack handling
This commit is contained in:
@@ -119,7 +119,6 @@ int rdpgfx_recv_caps_confirm_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s)
|
||||
RDPGFX_CAPSET capsSet;
|
||||
UINT32 capsDataLength;
|
||||
RDPGFX_CAPS_CONFIRM_PDU pdu;
|
||||
RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin;
|
||||
|
||||
pdu.capsSet = &capsSet;
|
||||
|
||||
@@ -129,8 +128,6 @@ int rdpgfx_recv_caps_confirm_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s)
|
||||
Stream_Read_UINT32(s, capsSet.version); /* version (4 bytes) */
|
||||
Stream_Read_UINT32(s, capsDataLength); /* capsDataLength (4 bytes) */
|
||||
Stream_Read_UINT32(s, capsSet.flags); /* capsData (4 bytes) */
|
||||
|
||||
/*TODO: interpret this answer*/
|
||||
|
||||
WLog_DBG(TAG, "RecvCapsConfirmPdu: version: 0x%04X flags: 0x%04X",
|
||||
capsSet.version, capsSet.flags);
|
||||
@@ -143,7 +140,6 @@ int rdpgfx_send_frame_acknowledge_pdu(RDPGFX_CHANNEL_CALLBACK* callback, RDPGFX_
|
||||
int status;
|
||||
wStream* s;
|
||||
RDPGFX_HEADER header;
|
||||
RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin;
|
||||
|
||||
header.flags = 0;
|
||||
header.cmdId = RDPGFX_CMDID_FRAMEACKNOWLEDGE;
|
||||
@@ -374,16 +370,24 @@ int rdpgfx_recv_end_frame_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s)
|
||||
context->EndFrame(context, &pdu);
|
||||
}
|
||||
|
||||
gfx->UnacknowledgedFrames--;
|
||||
gfx->TotalDecodedFrames++;
|
||||
|
||||
ack.frameId = pdu.frameId;
|
||||
ack.totalFramesDecoded = gfx->TotalDecodedFrames;
|
||||
|
||||
//ack.queueDepth = SUSPEND_FRAME_ACKNOWLEDGEMENT;
|
||||
ack.queueDepth = QUEUE_DEPTH_UNAVAILABLE;
|
||||
if (gfx->suspendFrameAcks)
|
||||
{
|
||||
ack.queueDepth = SUSPEND_FRAME_ACKNOWLEDGEMENT;
|
||||
|
||||
rdpgfx_send_frame_acknowledge_pdu(callback, &ack);
|
||||
if (gfx->TotalDecodedFrames == 0)
|
||||
rdpgfx_send_frame_acknowledge_pdu(callback, &ack);
|
||||
}
|
||||
else
|
||||
{
|
||||
ack.queueDepth = QUEUE_DEPTH_UNAVAILABLE;
|
||||
rdpgfx_send_frame_acknowledge_pdu(callback, &ack);
|
||||
}
|
||||
|
||||
gfx->UnacknowledgedFrames--;
|
||||
gfx->TotalDecodedFrames++;
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -728,7 +732,6 @@ int rdpgfx_recv_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s)
|
||||
int status;
|
||||
int beg, end;
|
||||
RDPGFX_HEADER header;
|
||||
RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin;
|
||||
|
||||
beg = Stream_GetPosition(s);
|
||||
|
||||
@@ -873,7 +876,6 @@ static int rdpgfx_on_data_received(IWTSVirtualChannelCallback* pChannelCallback,
|
||||
static int rdpgfx_on_open(IWTSVirtualChannelCallback* pChannelCallback)
|
||||
{
|
||||
RDPGFX_CHANNEL_CALLBACK* callback = (RDPGFX_CHANNEL_CALLBACK*) pChannelCallback;
|
||||
RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin;
|
||||
|
||||
WLog_DBG(TAG, "OnOpen");
|
||||
|
||||
@@ -885,7 +887,6 @@ static int rdpgfx_on_open(IWTSVirtualChannelCallback* pChannelCallback)
|
||||
static int rdpgfx_on_close(IWTSVirtualChannelCallback* pChannelCallback)
|
||||
{
|
||||
RDPGFX_CHANNEL_CALLBACK* callback = (RDPGFX_CHANNEL_CALLBACK*) pChannelCallback;
|
||||
RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin;
|
||||
|
||||
WLog_DBG(TAG, "OnClose");
|
||||
|
||||
|
||||
@@ -69,6 +69,7 @@ struct _RDPGFX_PLUGIN
|
||||
ZGFX_CONTEXT* zgfx;
|
||||
UINT32 UnacknowledgedFrames;
|
||||
UINT32 TotalDecodedFrames;
|
||||
BOOL suspendFrameAcks;
|
||||
|
||||
wHashTable* SurfaceTable;
|
||||
|
||||
|
||||
@@ -353,7 +353,7 @@ int xf_SurfaceCommand_ClearCodec(xfContext* xfc, RdpgfxClientContext* context, R
|
||||
|
||||
if (status < 0)
|
||||
{
|
||||
WLog_ERR(TAG, "clear_decompress failure: %d\n", status);
|
||||
WLog_ERR(TAG, "clear_decompress failure: %d", status);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -467,7 +467,7 @@ int xf_SurfaceCommand_Alpha(xfContext* xfc, RdpgfxClientContext* context, RDPGFX
|
||||
if (!surface)
|
||||
return -1;
|
||||
|
||||
WLog_DBG(TAG, "xf_SurfaceCommand_Alpha: status: %d\n", status);
|
||||
WLog_DBG(TAG, "xf_SurfaceCommand_Alpha: status: %d", status);
|
||||
/* fill with green for now to distinguish from the rest */
|
||||
|
||||
freerdp_image_fill(surface->data, PIXEL_FORMAT_XRGB32, surface->scanline,
|
||||
|
||||
Reference in New Issue
Block a user