Exemple #1
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?
	
}
Exemple #2
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
    
    STREAM* 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_set_pos(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;
    
    rfx_compose_message(mfp->rfx_context, s, &rect, 1,
                        (BYTE*) dataBits, rect.width, rect.height, pitch);
    
    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_get_length(s);
	cmd->bitmapData = stream_get_head(s);
    
    //send
    
    update->SurfaceBits(update->context, cmd);
    
    //clean up
    
    // note: need to stop getting new dirty rects until here
    
    
    /*
    CGColorSpaceRelease(rgbColorSpace);
    CGImageRelease(image);
    CGContextRelease(context);
    
    CVPixelBufferUnlockBaseAddress(pxbuffer, 0);
    CVPixelBufferRelease(pxbuffer);
    */
}