|
|
@ -67,19 +67,19 @@ |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_SURFACE_BITS_BMP |
|
|
|
#ifdef HAVE_SURFACE_BITS_BMP |
|
|
|
#define SURFACE_BPP(cmd) cmd->bmp.bpp |
|
|
|
#define SURFACE_BPP(cmd) cmd.bmp.bpp |
|
|
|
#define SURFACE_CODECID(cmd) cmd->bmp.codecID |
|
|
|
#define SURFACE_CODECID(cmd) cmd.bmp.codecID |
|
|
|
#define SURFACE_WIDTH(cmd) cmd->bmp.width |
|
|
|
#define SURFACE_WIDTH(cmd) cmd.bmp.width |
|
|
|
#define SURFACE_HEIGHT(cmd) cmd->bmp.height |
|
|
|
#define SURFACE_HEIGHT(cmd) cmd.bmp.height |
|
|
|
#define SURFACE_BITMAP_DATA(cmd) cmd->bmp.bitmapData |
|
|
|
#define SURFACE_BITMAP_DATA(cmd) cmd.bmp.bitmapData |
|
|
|
#define SURFACE_BITMAP_DATA_LEN(cmd) cmd->bmp.bitmapDataLength |
|
|
|
#define SURFACE_BITMAP_DATA_LEN(cmd) cmd.bmp.bitmapDataLength |
|
|
|
#else |
|
|
|
#else |
|
|
|
#define SURFACE_BPP(cmd) cmd->bpp |
|
|
|
#define SURFACE_BPP(cmd) cmd.bpp |
|
|
|
#define SURFACE_CODECID(cmd) cmd->codecID |
|
|
|
#define SURFACE_CODECID(cmd) cmd.codecID |
|
|
|
#define SURFACE_WIDTH(cmd) cmd->width |
|
|
|
#define SURFACE_WIDTH(cmd) cmd.width |
|
|
|
#define SURFACE_HEIGHT(cmd) cmd->height |
|
|
|
#define SURFACE_HEIGHT(cmd) cmd.height |
|
|
|
#define SURFACE_BITMAP_DATA(cmd) cmd->bitmapData |
|
|
|
#define SURFACE_BITMAP_DATA(cmd) cmd.bitmapData |
|
|
|
#define SURFACE_BITMAP_DATA_LEN(cmd) cmd->bitmapDataLength |
|
|
|
#define SURFACE_BITMAP_DATA_LEN(cmd) cmd.bitmapDataLength |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#include <freerdp/freerdp.h> |
|
|
|
#include <freerdp/freerdp.h> |
|
|
@ -198,7 +198,7 @@ rdp_peer_refresh_rfx(pixman_region32_t *damage, pixman_image_t *image, freerdp_p |
|
|
|
uint32_t *ptr; |
|
|
|
uint32_t *ptr; |
|
|
|
RFX_RECT *rfxRect; |
|
|
|
RFX_RECT *rfxRect; |
|
|
|
rdpUpdate *update = peer->update; |
|
|
|
rdpUpdate *update = peer->update; |
|
|
|
SURFACE_BITS_COMMAND *cmd = &update->surface_bits_command; |
|
|
|
SURFACE_BITS_COMMAND cmd; |
|
|
|
RdpPeerContext *context = (RdpPeerContext *)peer->context; |
|
|
|
RdpPeerContext *context = (RdpPeerContext *)peer->context; |
|
|
|
|
|
|
|
|
|
|
|
Stream_Clear(context->encode_stream); |
|
|
|
Stream_Clear(context->encode_stream); |
|
|
@ -208,14 +208,14 @@ rdp_peer_refresh_rfx(pixman_region32_t *damage, pixman_image_t *image, freerdp_p |
|
|
|
height = (damage->extents.y2 - damage->extents.y1); |
|
|
|
height = (damage->extents.y2 - damage->extents.y1); |
|
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_SKIP_COMPRESSION |
|
|
|
#ifdef HAVE_SKIP_COMPRESSION |
|
|
|
cmd->skipCompression = TRUE; |
|
|
|
cmd.skipCompression = TRUE; |
|
|
|
#else |
|
|
|
#else |
|
|
|
memset(cmd, 0, sizeof(*cmd)); |
|
|
|
memset(&cmd, 0, sizeof(*cmd)); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
cmd->destLeft = damage->extents.x1; |
|
|
|
cmd.destLeft = damage->extents.x1; |
|
|
|
cmd->destTop = damage->extents.y1; |
|
|
|
cmd.destTop = damage->extents.y1; |
|
|
|
cmd->destRight = damage->extents.x2; |
|
|
|
cmd.destRight = damage->extents.x2; |
|
|
|
cmd->destBottom = damage->extents.y2; |
|
|
|
cmd.destBottom = damage->extents.y2; |
|
|
|
SURFACE_BPP(cmd) = 32; |
|
|
|
SURFACE_BPP(cmd) = 32; |
|
|
|
SURFACE_CODECID(cmd) = peer->settings->RemoteFxCodecId; |
|
|
|
SURFACE_CODECID(cmd) = peer->settings->RemoteFxCodecId; |
|
|
|
SURFACE_WIDTH(cmd) = width; |
|
|
|
SURFACE_WIDTH(cmd) = width; |
|
|
@ -245,7 +245,7 @@ rdp_peer_refresh_rfx(pixman_region32_t *damage, pixman_image_t *image, freerdp_p |
|
|
|
SURFACE_BITMAP_DATA_LEN(cmd) = Stream_GetPosition(context->encode_stream); |
|
|
|
SURFACE_BITMAP_DATA_LEN(cmd) = Stream_GetPosition(context->encode_stream); |
|
|
|
SURFACE_BITMAP_DATA(cmd) = Stream_Buffer(context->encode_stream); |
|
|
|
SURFACE_BITMAP_DATA(cmd) = Stream_Buffer(context->encode_stream); |
|
|
|
|
|
|
|
|
|
|
|
update->SurfaceBits(update->context, cmd); |
|
|
|
update->SurfaceBits(update->context, &cmd); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -255,7 +255,7 @@ rdp_peer_refresh_nsc(pixman_region32_t *damage, pixman_image_t *image, freerdp_p |
|
|
|
int width, height; |
|
|
|
int width, height; |
|
|
|
uint32_t *ptr; |
|
|
|
uint32_t *ptr; |
|
|
|
rdpUpdate *update = peer->update; |
|
|
|
rdpUpdate *update = peer->update; |
|
|
|
SURFACE_BITS_COMMAND *cmd = &update->surface_bits_command; |
|
|
|
SURFACE_BITS_COMMAND cmd; |
|
|
|
RdpPeerContext *context = (RdpPeerContext *)peer->context; |
|
|
|
RdpPeerContext *context = (RdpPeerContext *)peer->context; |
|
|
|
|
|
|
|
|
|
|
|
Stream_Clear(context->encode_stream); |
|
|
|
Stream_Clear(context->encode_stream); |
|
|
@ -265,15 +265,15 @@ rdp_peer_refresh_nsc(pixman_region32_t *damage, pixman_image_t *image, freerdp_p |
|
|
|
height = (damage->extents.y2 - damage->extents.y1); |
|
|
|
height = (damage->extents.y2 - damage->extents.y1); |
|
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_SKIP_COMPRESSION |
|
|
|
#ifdef HAVE_SKIP_COMPRESSION |
|
|
|
cmd->skipCompression = TRUE; |
|
|
|
cmd.skipCompression = TRUE; |
|
|
|
#else |
|
|
|
#else |
|
|
|
memset(cmd, 0, sizeof(*cmd)); |
|
|
|
memset(cmd, 0, sizeof(*cmd)); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
cmd->destLeft = damage->extents.x1; |
|
|
|
cmd.destLeft = damage->extents.x1; |
|
|
|
cmd->destTop = damage->extents.y1; |
|
|
|
cmd.destTop = damage->extents.y1; |
|
|
|
cmd->destRight = damage->extents.x2; |
|
|
|
cmd.destRight = damage->extents.x2; |
|
|
|
cmd->destBottom = damage->extents.y2; |
|
|
|
cmd.destBottom = damage->extents.y2; |
|
|
|
SURFACE_BPP(cmd) = 32; |
|
|
|
SURFACE_BPP(cmd) = 32; |
|
|
|
SURFACE_CODECID(cmd) = peer->settings->NSCodecId; |
|
|
|
SURFACE_CODECID(cmd) = peer->settings->NSCodecId; |
|
|
|
SURFACE_WIDTH(cmd) = width; |
|
|
|
SURFACE_WIDTH(cmd) = width; |
|
|
@ -289,7 +289,7 @@ rdp_peer_refresh_nsc(pixman_region32_t *damage, pixman_image_t *image, freerdp_p |
|
|
|
SURFACE_BITMAP_DATA_LEN(cmd) = Stream_GetPosition(context->encode_stream); |
|
|
|
SURFACE_BITMAP_DATA_LEN(cmd) = Stream_GetPosition(context->encode_stream); |
|
|
|
SURFACE_BITMAP_DATA(cmd) = Stream_Buffer(context->encode_stream); |
|
|
|
SURFACE_BITMAP_DATA(cmd) = Stream_Buffer(context->encode_stream); |
|
|
|
|
|
|
|
|
|
|
|
update->SurfaceBits(update->context, cmd); |
|
|
|
update->SurfaceBits(update->context, &cmd); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void |
|
|
|
static void |
|
|
@ -310,8 +310,8 @@ static void |
|
|
|
rdp_peer_refresh_raw(pixman_region32_t *region, pixman_image_t *image, freerdp_peer *peer) |
|
|
|
rdp_peer_refresh_raw(pixman_region32_t *region, pixman_image_t *image, freerdp_peer *peer) |
|
|
|
{ |
|
|
|
{ |
|
|
|
rdpUpdate *update = peer->update; |
|
|
|
rdpUpdate *update = peer->update; |
|
|
|
SURFACE_BITS_COMMAND *cmd = &update->surface_bits_command; |
|
|
|
SURFACE_BITS_COMMAND cmd; |
|
|
|
SURFACE_FRAME_MARKER *marker = &update->surface_frame_marker; |
|
|
|
SURFACE_FRAME_MARKER marker; |
|
|
|
pixman_box32_t *rect, subrect; |
|
|
|
pixman_box32_t *rect, subrect; |
|
|
|
int nrects, i; |
|
|
|
int nrects, i; |
|
|
|
int heightIncrement, remainingHeight, top; |
|
|
|
int heightIncrement, remainingHeight, top; |
|
|
@ -320,18 +320,18 @@ rdp_peer_refresh_raw(pixman_region32_t *region, pixman_image_t *image, freerdp_p |
|
|
|
if (!nrects) |
|
|
|
if (!nrects) |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
marker->frameId++; |
|
|
|
marker.frameId++; |
|
|
|
marker->frameAction = SURFACECMD_FRAMEACTION_BEGIN; |
|
|
|
marker.frameAction = SURFACECMD_FRAMEACTION_BEGIN; |
|
|
|
update->SurfaceFrameMarker(peer->context, marker); |
|
|
|
update->SurfaceFrameMarker(peer->context, &marker); |
|
|
|
|
|
|
|
|
|
|
|
memset(cmd, 0, sizeof(*cmd)); |
|
|
|
memset(&cmd, 0, sizeof(cmd)); |
|
|
|
SURFACE_BPP(cmd) = 32; |
|
|
|
SURFACE_BPP(cmd) = 32; |
|
|
|
SURFACE_CODECID(cmd) = 0; |
|
|
|
SURFACE_CODECID(cmd) = 0; |
|
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < nrects; i++, rect++) { |
|
|
|
for (i = 0; i < nrects; i++, rect++) { |
|
|
|
/*weston_log("rect(%d,%d, %d,%d)\n", rect->x1, rect->y1, rect->x2, rect->y2);*/ |
|
|
|
/*weston_log("rect(%d,%d, %d,%d)\n", rect->x1, rect->y1, rect->x2, rect->y2);*/ |
|
|
|
cmd->destLeft = rect->x1; |
|
|
|
cmd.destLeft = rect->x1; |
|
|
|
cmd->destRight = rect->x2; |
|
|
|
cmd.destRight = rect->x2; |
|
|
|
SURFACE_WIDTH(cmd) = rect->x2 - rect->x1; |
|
|
|
SURFACE_WIDTH(cmd) = rect->x2 - rect->x1; |
|
|
|
|
|
|
|
|
|
|
|
heightIncrement = peer->settings->MultifragMaxRequestSize / (16 + SURFACE_WIDTH(cmd) * 4); |
|
|
|
heightIncrement = peer->settings->MultifragMaxRequestSize / (16 + SURFACE_WIDTH(cmd) * 4); |
|
|
@ -343,8 +343,8 @@ rdp_peer_refresh_raw(pixman_region32_t *region, pixman_image_t *image, freerdp_p |
|
|
|
|
|
|
|
|
|
|
|
while (remainingHeight) { |
|
|
|
while (remainingHeight) { |
|
|
|
SURFACE_HEIGHT(cmd) = (remainingHeight > heightIncrement) ? heightIncrement : remainingHeight; |
|
|
|
SURFACE_HEIGHT(cmd) = (remainingHeight > heightIncrement) ? heightIncrement : remainingHeight; |
|
|
|
cmd->destTop = top; |
|
|
|
cmd.destTop = top; |
|
|
|
cmd->destBottom = top + SURFACE_HEIGHT(cmd); |
|
|
|
cmd.destBottom = top + SURFACE_HEIGHT(cmd); |
|
|
|
SURFACE_BITMAP_DATA_LEN(cmd) = SURFACE_WIDTH(cmd) * SURFACE_HEIGHT(cmd) * 4; |
|
|
|
SURFACE_BITMAP_DATA_LEN(cmd) = SURFACE_WIDTH(cmd) * SURFACE_HEIGHT(cmd) * 4; |
|
|
|
SURFACE_BITMAP_DATA(cmd) = (BYTE *)realloc(SURFACE_BITMAP_DATA(cmd), SURFACE_BITMAP_DATA_LEN(cmd)); |
|
|
|
SURFACE_BITMAP_DATA(cmd) = (BYTE *)realloc(SURFACE_BITMAP_DATA(cmd), SURFACE_BITMAP_DATA_LEN(cmd)); |
|
|
|
|
|
|
|
|
|
|
@ -353,15 +353,15 @@ rdp_peer_refresh_raw(pixman_region32_t *region, pixman_image_t *image, freerdp_p |
|
|
|
pixman_image_flipped_subrect(&subrect, image, SURFACE_BITMAP_DATA(cmd)); |
|
|
|
pixman_image_flipped_subrect(&subrect, image, SURFACE_BITMAP_DATA(cmd)); |
|
|
|
|
|
|
|
|
|
|
|
/*weston_log("* sending (%d,%d, %d,%d)\n", subrect.x1, subrect.y1, subrect.x2, subrect.y2); */ |
|
|
|
/*weston_log("* sending (%d,%d, %d,%d)\n", subrect.x1, subrect.y1, subrect.x2, subrect.y2); */ |
|
|
|
update->SurfaceBits(peer->context, cmd); |
|
|
|
update->SurfaceBits(peer->context, &cmd); |
|
|
|
|
|
|
|
|
|
|
|
remainingHeight -= SURFACE_HEIGHT(cmd); |
|
|
|
remainingHeight -= SURFACE_HEIGHT(cmd); |
|
|
|
top += SURFACE_HEIGHT(cmd); |
|
|
|
top += SURFACE_HEIGHT(cmd); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
marker->frameAction = SURFACECMD_FRAMEACTION_END; |
|
|
|
marker.frameAction = SURFACECMD_FRAMEACTION_END; |
|
|
|
update->SurfaceFrameMarker(peer->context, marker); |
|
|
|
update->SurfaceFrameMarker(peer->context, &marker); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void |
|
|
|
static void |
|
|
@ -956,7 +956,7 @@ xf_peer_activate(freerdp_peer* client) |
|
|
|
pixman_box32_t box; |
|
|
|
pixman_box32_t box; |
|
|
|
pixman_region32_t damage; |
|
|
|
pixman_region32_t damage; |
|
|
|
char seat_name[50]; |
|
|
|
char seat_name[50]; |
|
|
|
|
|
|
|
POINTER_SYSTEM_UPDATE pointer_system; |
|
|
|
|
|
|
|
|
|
|
|
peerCtx = (RdpPeerContext *)client->context; |
|
|
|
peerCtx = (RdpPeerContext *)client->context; |
|
|
|
b = peerCtx->rdpBackend; |
|
|
|
b = peerCtx->rdpBackend; |
|
|
@ -1056,8 +1056,8 @@ xf_peer_activate(freerdp_peer* client) |
|
|
|
|
|
|
|
|
|
|
|
/* disable pointer on the client side */ |
|
|
|
/* disable pointer on the client side */ |
|
|
|
pointer = client->update->pointer; |
|
|
|
pointer = client->update->pointer; |
|
|
|
pointer->pointer_system.type = SYSPTR_NULL; |
|
|
|
pointer_system.type = SYSPTR_NULL; |
|
|
|
pointer->PointerSystem(client->context, &pointer->pointer_system); |
|
|
|
pointer->PointerSystem(client->context, &pointer_system); |
|
|
|
|
|
|
|
|
|
|
|
/* sends a full refresh */ |
|
|
|
/* sends a full refresh */ |
|
|
|
box.x1 = 0; |
|
|
|
box.x1 = 0; |
|
|
|