xfreerdp-server: encode larger portion of the screen
This commit is contained in:
parent
5c25717eae
commit
882f6d49a6
@ -70,16 +70,21 @@ STREAM* xf_peer_stream_init(xfPeer* info)
|
|||||||
|
|
||||||
void xf_peer_live_rfx(freerdp_peer* client)
|
void xf_peer_live_rfx(freerdp_peer* client)
|
||||||
{
|
{
|
||||||
|
int x, y;
|
||||||
STREAM* s;
|
STREAM* s;
|
||||||
|
int width;
|
||||||
|
int height;
|
||||||
|
int wrects;
|
||||||
|
int hrects;
|
||||||
|
int nrects;
|
||||||
uint8* data;
|
uint8* data;
|
||||||
xfInfo* xfi;
|
xfInfo* xfi;
|
||||||
xfPeer* xfp;
|
xfPeer* xfp;
|
||||||
XImage* image;
|
XImage* image;
|
||||||
RFX_RECT rect;
|
RFX_RECT* rects;
|
||||||
uint32 seconds;
|
uint32 seconds;
|
||||||
uint32 useconds;
|
uint32 useconds;
|
||||||
rdpUpdate* update;
|
rdpUpdate* update;
|
||||||
uint8* background;
|
|
||||||
SURFACE_BITS_COMMAND* cmd;
|
SURFACE_BITS_COMMAND* cmd;
|
||||||
|
|
||||||
seconds = 1;
|
seconds = 1;
|
||||||
@ -89,14 +94,27 @@ void xf_peer_live_rfx(freerdp_peer* client)
|
|||||||
xfp = (xfPeer*) client->param1;
|
xfp = (xfPeer*) client->param1;
|
||||||
cmd = &update->surface_bits_command;
|
cmd = &update->surface_bits_command;
|
||||||
|
|
||||||
rect.x = 0;
|
wrects = 16;
|
||||||
rect.y = 0;
|
hrects = 12;
|
||||||
rect.width = 64;
|
|
||||||
rect.height = 64;
|
|
||||||
|
|
||||||
data = (uint8*) xmalloc(64 * 64 * 3);
|
nrects = wrects * hrects;
|
||||||
background = (uint8*) xmalloc(64 * 64 * 3);
|
rects = xmalloc(sizeof(RFX_RECT) * nrects);
|
||||||
memset(background, 0xA0, 64 * 64 * 3);
|
|
||||||
|
for (y = 0; y < hrects; y++)
|
||||||
|
{
|
||||||
|
for (x = 0; x < wrects; x++)
|
||||||
|
{
|
||||||
|
rects[(y * wrects) + x].x = x * 64;
|
||||||
|
rects[(y * wrects) + x].y = y * 64;
|
||||||
|
rects[(y * wrects) + x].width = 64;
|
||||||
|
rects[(y * wrects) + x].height = 64;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
width = wrects * 64;
|
||||||
|
height = hrects * 64;
|
||||||
|
|
||||||
|
data = (uint8*) xmalloc(width * height * 3);
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
@ -107,21 +125,19 @@ void xf_peer_live_rfx(freerdp_peer* client)
|
|||||||
freerdp_usleep(useconds);
|
freerdp_usleep(useconds);
|
||||||
|
|
||||||
s = xf_peer_stream_init(xfp);
|
s = xf_peer_stream_init(xfp);
|
||||||
image = xf_snapshot(xfi, 0, 0, 64, 64);
|
|
||||||
|
|
||||||
freerdp_image_convert((uint8*) image->data, data, 64, 64, 32, 24, xfi->clrconv);
|
image = xf_snapshot(xfi, 0, 0, width, height);
|
||||||
|
freerdp_image_convert((uint8*) image->data, data, width, height, 32, 24, xfi->clrconv);
|
||||||
rfx_compose_message(xfp->context, s,
|
rfx_compose_message(xfp->context, s, rects, nrects, data, width, height, 64 * wrects * 3);
|
||||||
&rect, 1, data, rect.width, rect.height, 64 * 3);
|
|
||||||
|
|
||||||
cmd->destLeft = 0;
|
cmd->destLeft = 0;
|
||||||
cmd->destTop = 0;
|
cmd->destTop = 0;
|
||||||
cmd->destRight = 64;
|
cmd->destRight = width;
|
||||||
cmd->destBottom = 64;
|
cmd->destBottom = height;
|
||||||
cmd->bpp = 32;
|
cmd->bpp = 32;
|
||||||
cmd->codecID = client->settings->rfx_codec_id;
|
cmd->codecID = client->settings->rfx_codec_id;
|
||||||
cmd->width = 64;
|
cmd->width = width;
|
||||||
cmd->height = 64;
|
cmd->height = height;
|
||||||
cmd->bitmapDataLength = stream_get_length(s);
|
cmd->bitmapDataLength = stream_get_length(s);
|
||||||
cmd->bitmapData = stream_get_head(s);
|
cmd->bitmapData = stream_get_head(s);
|
||||||
update->SurfaceBits(update, cmd);
|
update->SurfaceBits(update, cmd);
|
||||||
|
@ -97,7 +97,8 @@ xfInfo* xf_info_init()
|
|||||||
}
|
}
|
||||||
XFree(vis);
|
XFree(vis);
|
||||||
|
|
||||||
xfi->clrconv = xnew(HCLRCONV);
|
xfi->clrconv = (HCLRCONV) xnew(HCLRCONV);
|
||||||
|
xfi->clrconv->invert = 1;
|
||||||
xfi->clrconv->alpha = 1;
|
xfi->clrconv->alpha = 1;
|
||||||
|
|
||||||
return xfi;
|
return xfi;
|
||||||
|
Loading…
Reference in New Issue
Block a user