Merge pull request #908 from llyzs/llyzs

Frame acknowledgement should be sent by client UI.
This commit is contained in:
Marc-André Moreau 2013-01-17 07:11:47 -08:00
commit 2d816cf3e0
5 changed files with 36 additions and 16 deletions

View File

@ -544,6 +544,19 @@ void wf_gdi_surface_bits(rdpContext* context, SURFACE_BITS_COMMAND* surface_bits
free(tile_bitmap); free(tile_bitmap);
} }
void wf_gdi_surface_frame_marker(rdpContext* context, SURFACE_FRAME_MARKER* surface_frame_marker)
{
wfInfo* wfi;
rdpSettings* settings;
wfi = ((wfContext*) context)->wfi;
settings = wfi->instance->settings;
if (surface_frame_marker->frameAction == SURFACECMD_FRAMEACTION_END && settings->FrameAcknowledge > 0)
{
IFCALL(wfi->instance->update->SurfaceFrameAcknowledge, context, surface_frame_marker->frameId);
}
}
void wf_gdi_register_update_callbacks(rdpUpdate* update) void wf_gdi_register_update_callbacks(rdpUpdate* update)
{ {
rdpPrimaryUpdate* primary = update->primary; rdpPrimaryUpdate* primary = update->primary;
@ -575,4 +588,5 @@ void wf_gdi_register_update_callbacks(rdpUpdate* update)
primary->EllipseCB = NULL; primary->EllipseCB = NULL;
update->SurfaceBits = wf_gdi_surface_bits; update->SurfaceBits = wf_gdi_surface_bits;
update->SurfaceFrameMarker = wf_gdi_surface_frame_marker;
} }

View File

@ -880,8 +880,11 @@ void xf_gdi_ellipse_cb(rdpContext* context, ELLIPSE_CB_ORDER* ellipse_cb)
void xf_gdi_surface_frame_marker(rdpContext* context, SURFACE_FRAME_MARKER* surface_frame_marker) void xf_gdi_surface_frame_marker(rdpContext* context, SURFACE_FRAME_MARKER* surface_frame_marker)
{ {
xfInfo* xfi = ((xfContext*) context)->xfi; xfInfo* xfi;
rdpSettings* settings;
xfi = ((xfContext*) context)->xfi;
settings = xfi->instance->settings;
switch (surface_frame_marker->frameAction) switch (surface_frame_marker->frameAction)
{ {
case SURFACECMD_FRAMEACTION_BEGIN: case SURFACECMD_FRAMEACTION_BEGIN:
@ -906,6 +909,10 @@ void xf_gdi_surface_frame_marker(rdpContext* context, SURFACE_FRAME_MARKER* surf
gdi_InvalidateRegion(xfi->hdc, xfi->frame_x1, xfi->frame_y1, gdi_InvalidateRegion(xfi->hdc, xfi->frame_x1, xfi->frame_y1,
xfi->frame_x2 - xfi->frame_x1, xfi->frame_y2 - xfi->frame_y1); xfi->frame_x2 - xfi->frame_x1, xfi->frame_y2 - xfi->frame_y1);
} }
if (settings->FrameAcknowledge > 0)
{
IFCALL(xfi->instance->update->SurfaceFrameAcknowledge, context, surface_frame_marker->frameId);
}
break; break;
} }
} }

View File

@ -152,6 +152,7 @@ typedef void (*pSuppressOutput)(rdpContext* context, BYTE allow, RECTANGLE_16* a
typedef void (*pSurfaceCommand)(rdpContext* context, STREAM* s); typedef void (*pSurfaceCommand)(rdpContext* context, STREAM* s);
typedef void (*pSurfaceBits)(rdpContext* context, SURFACE_BITS_COMMAND* surface_bits_command); typedef void (*pSurfaceBits)(rdpContext* context, SURFACE_BITS_COMMAND* surface_bits_command);
typedef void (*pSurfaceFrameMarker)(rdpContext* context, SURFACE_FRAME_MARKER* surface_frame_marker); typedef void (*pSurfaceFrameMarker)(rdpContext* context, SURFACE_FRAME_MARKER* surface_frame_marker);
typedef void (*pSurfaceFrameAcknowledge)(rdpContext* context, UINT32 frameId);
struct rdp_update struct rdp_update
{ {
@ -182,7 +183,8 @@ struct rdp_update
pSurfaceCommand SurfaceCommand; /* 64 */ pSurfaceCommand SurfaceCommand; /* 64 */
pSurfaceBits SurfaceBits; /* 65 */ pSurfaceBits SurfaceBits; /* 65 */
pSurfaceFrameMarker SurfaceFrameMarker; /* 66 */ pSurfaceFrameMarker SurfaceFrameMarker; /* 66 */
UINT32 paddingE[80 - 67]; /* 67 */ pSurfaceFrameAcknowledge SurfaceFrameAcknowledge; /* 67 */
UINT32 paddingE[80 - 68]; /* 68 */
/* internal */ /* internal */

View File

@ -55,15 +55,6 @@ static BOOL update_recv_surfcmd_surface_bits(rdpUpdate* update, STREAM* s, UINT3
return TRUE; return TRUE;
} }
static void update_send_frame_acknowledge(rdpRdp* rdp, UINT32 frameId)
{
STREAM* s;
s = rdp_data_pdu_init(rdp);
stream_write_UINT32(s, frameId);
rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_FRAME_ACKNOWLEDGE, rdp->mcs->user_id);
}
static BOOL update_recv_surfcmd_frame_marker(rdpUpdate* update, STREAM* s, UINT32 *length) static BOOL update_recv_surfcmd_frame_marker(rdpUpdate* update, STREAM* s, UINT32 *length)
{ {
SURFACE_FRAME_MARKER* marker = &update->surface_frame_marker; SURFACE_FRAME_MARKER* marker = &update->surface_frame_marker;
@ -75,11 +66,6 @@ static BOOL update_recv_surfcmd_frame_marker(rdpUpdate* update, STREAM* s, UINT3
IFCALL(update->SurfaceFrameMarker, update->context, marker); IFCALL(update->SurfaceFrameMarker, update->context, marker);
if (update->context->rdp->settings->ReceivedCapabilities[CAPSET_TYPE_FRAME_ACKNOWLEDGE] && update->context->rdp->settings->FrameAcknowledge > 0 && marker->frameAction == SURFACECMD_FRAMEACTION_END)
{
update_send_frame_acknowledge(update->context->rdp, marker->frameId);
}
*length = 6; *length = 6;
return TRUE; return TRUE;
} }

View File

@ -494,6 +494,16 @@ static void update_send_surface_frame_marker(rdpContext* context, SURFACE_FRAME_
fastpath_send_update_pdu(rdp->fastpath, FASTPATH_UPDATETYPE_SURFCMDS, s); fastpath_send_update_pdu(rdp->fastpath, FASTPATH_UPDATETYPE_SURFCMDS, s);
} }
static void update_send_frame_acknowledge(rdpContext* context, UINT32 frameId)
{
STREAM* s;
rdpRdp* rdp = context->rdp;
s = rdp_data_pdu_init(rdp);
stream_write_UINT32(s, frameId);
rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_FRAME_ACKNOWLEDGE, rdp->mcs->user_id);
}
static void update_send_synchronize(rdpContext* context) static void update_send_synchronize(rdpContext* context)
{ {
STREAM* s; STREAM* s;
@ -673,6 +683,7 @@ void update_register_client_callbacks(rdpUpdate* update)
{ {
update->RefreshRect = update_send_refresh_rect; update->RefreshRect = update_send_refresh_rect;
update->SuppressOutput = update_send_suppress_output; update->SuppressOutput = update_send_suppress_output;
update->SurfaceFrameAcknowledge = update_send_frame_acknowledge;
} }
static void* update_thread(void* arg) static void* update_thread(void* arg)