Exemplo n.º 1
0
void wf_update_encode(wfInfo* wfi)
{

	RFX_RECT rect;
	long height, width;
	BYTE* pDataBits = NULL;
	int stride;

	SURFACE_BITS_COMMAND* cmd;

	wf_info_find_invalid_region(wfi);

	cmd = &wfi->cmd;

	Stream_SetPosition(wfi->s, 0);

	wf_info_getScreenData(wfi, &width, &height, &pDataBits, &stride);

	rect.x = 0;
	rect.y = 0;
	rect.width = (UINT16) width;
	rect.height = (UINT16) height;

	//printf("x:%d y:%d w:%d h:%d\n", wfi->invalid.left, wfi->invalid.top, width, height);

	Stream_Clear(wfi->s);
	rfx_compose_message(wfi->rfx_context, wfi->s, &rect, 1,
		pDataBits, width, height, stride);

	wfi->frame_idx = wfi->rfx_context->frameIdx;

	cmd->destLeft = wfi->invalid.left;
	cmd->destTop = wfi->invalid.top;
	cmd->destRight = wfi->invalid.left + width;
	cmd->destBottom = wfi->invalid.top + height;

	cmd->bpp = 32;
	cmd->codecID = 3;
	cmd->width = width;
	cmd->height = height;
	cmd->bitmapDataLength = Stream_GetPosition(wfi->s);
	cmd->bitmapData = Stream_Buffer(wfi->s);
}
Exemplo n.º 2
0
static wStream* test_peer_stream_init(testPeerContext* context)
{
	Stream_Clear(context->s);
	Stream_SetPosition(context->s, 0);
	return context->s;
}
Exemplo n.º 3
0
void mf_peer_rfx_update(freerdp_peer* client)
{
	//check
	mfInfo* mfi = mf_info_get_instance();
	
	mf_info_find_invalid_region(mfi);
	
	if (mf_info_have_invalid_region(mfi) == false) {
		return;
	}
	
	
	long width;
	long height;
	int pitch;
	BYTE* dataBits = NULL;
	
	mf_info_getScreenData(mfi, &width, &height, &dataBits, &pitch);
	
	mf_info_clear_invalid_region(mfi);
	
	//encode
	
	wStream* s;
	RFX_RECT rect;
	rdpUpdate* update;
	mfPeerContext* mfp;
	SURFACE_BITS_COMMAND* cmd;
	
	update = client->update;
	mfp = (mfPeerContext*) client->context;
	cmd = &update->surface_bits_command;
	
	
	s = mfp->s;
	Stream_Clear(s);
	Stream_SetPosition(s, 0);
	
	UINT32 x = mfi->invalid.x / mfi->scale;
	UINT32 y = mfi->invalid.y / mfi->scale;
	
	rect.x = 0;
	rect.y = 0;
	rect.width = width;
	rect.height = height;
	
	mfp->rfx_context->width = mfi->servscreen_width;
	mfp->rfx_context->height = mfi->servscreen_height;
	
	if (!(rfx_compose_message(mfp->rfx_context, s, &rect, 1,
		(BYTE*) dataBits, rect.width, rect.height, pitch)))
	{
		return;
	}
	
	cmd->destLeft = x;
	cmd->destTop = y;
	cmd->destRight = x + rect.width;
	cmd->destBottom = y + rect.height;
	
	
	cmd->bpp = 32;
	cmd->codecID = 3;
	cmd->width = rect.width;
	cmd->height = rect.height;
	cmd->bitmapDataLength = Stream_GetPosition(s);
	cmd->bitmapData = Stream_Buffer(s);
	
	//send
	
	update->SurfaceBits(update->context, cmd);
	
	//clean up... maybe?
	
}