Ejemplo n.º 1
0
static BOOL test_ClearDecompressExample(UINT32 nr, const BYTE* pSrcData,
                                        const UINT32 SrcSize)
{
	int status;
	BYTE pDstData[16384];
	CLEAR_CONTEXT* clear = clear_context_new(FALSE);

	if (!clear)
		return FALSE;

	status = clear_decompress(clear, pSrcData, SrcSize, 128, 128,
	                          pDstData, PIXEL_FORMAT_XRGB32, 0, 1, 1, 128, 128,
	                          NULL);
	printf("clear_decompress example %"PRIu32" status: %d\n", nr, status);
	fflush(stdout);
	clear_context_free(clear);
#if 0

	if (status != 0)
		return FALSE;

#else
	fprintf(stderr, "%s: TODO Test %"PRIu32" not working!!!\n", __FUNCTION__, nr);
#endif
	return TRUE;
}
Ejemplo n.º 2
0
int xf_ResetGraphics(RdpgfxClientContext* context, RDPGFX_RESET_GRAPHICS_PDU* resetGraphics)
{
	xfContext* xfc = (xfContext*) context->custom;

	if (xfc->codecs->rfx)
	{
		rfx_context_free(xfc->codecs->rfx);
		xfc->codecs->rfx = NULL;
	}

	xfc->codecs->rfx = rfx_context_new(FALSE);

	xfc->codecs->rfx->width = resetGraphics->width;
	xfc->codecs->rfx->height = resetGraphics->height;
	rfx_context_set_pixel_format(xfc->codecs->rfx, RDP_PIXEL_FORMAT_B8G8R8A8);

	if (xfc->codecs->nsc)
	{
		nsc_context_free(xfc->codecs->nsc);
		xfc->codecs->nsc = NULL;
	}

	xfc->codecs->nsc = nsc_context_new();

	xfc->codecs->nsc->width = resetGraphics->width;
	xfc->codecs->nsc->height = resetGraphics->height;
	nsc_context_set_pixel_format(xfc->codecs->nsc, RDP_PIXEL_FORMAT_B8G8R8A8);

	if (xfc->codecs->clear)
	{
		clear_context_free(xfc->codecs->clear);
		xfc->codecs->clear = NULL;
	}

	xfc->codecs->clear = clear_context_new(FALSE);

	if (xfc->codecs->h264)
	{
		h264_context_free(xfc->codecs->h264);
		xfc->codecs->h264 = NULL;
	}

	xfc->codecs->h264 = h264_context_new(FALSE);

	if (xfc->codecs->progressive)
	{
		progressive_context_free(xfc->codecs->progressive);
		xfc->codecs->progressive = NULL;
	}

	xfc->codecs->progressive = progressive_context_new(TRUE);

	region16_init(&(xfc->invalidRegion));

	xfc->graphicsReset = TRUE;

	return 1;
}
Ejemplo n.º 3
0
void codecs_free(rdpCodecs* codecs)
{
	if (!codecs)
		return;

	if (codecs->rfx)
	{
		rfx_context_free(codecs->rfx);
		codecs->rfx = NULL;
	}

	if (codecs->nsc)
	{
		nsc_context_free(codecs->nsc);
		codecs->nsc = NULL;
	}

	if (codecs->h264)
	{
		h264_context_free(codecs->h264);
		codecs->h264 = NULL;
	}

	if (codecs->clear)
	{
		clear_context_free(codecs->clear);
		codecs->clear = NULL;
	}

	if (codecs->progressive)
	{
		progressive_context_free(codecs->progressive);
		codecs->progressive = NULL;
	}

	if (codecs->planar)
	{
		freerdp_bitmap_planar_context_free(codecs->planar);
		codecs->planar = NULL;
	}

	if (codecs->interleaved)
	{
		bitmap_interleaved_context_free(codecs->interleaved);
		codecs->interleaved = NULL;
	}

	free(codecs);
}
Ejemplo n.º 4
0
int test_ClearDecompressExample3()
{
	int status;
	BYTE* pSrcData;
	UINT32 SrcSize;
	UINT32 DstSize;
	BYTE* pDstData = NULL;
	CLEAR_CONTEXT* clear;

	clear = clear_context_new(FALSE);

	SrcSize = sizeof(TEST_CLEAR_EXAMPLE_3) - 1;
	pSrcData = (BYTE*) TEST_CLEAR_EXAMPLE_3;

	status = clear_decompress(clear, pSrcData, SrcSize, &pDstData, &DstSize);

	printf("clear_decompress example 3 status: %d\n", status);

	clear_context_free(clear);

	return 1;
}
Ejemplo n.º 5
0
static BOOL test_ClearDecompressExample(UINT32 nr, UINT32 width, UINT32 height,
                                        const BYTE* pSrcData,
                                        const UINT32 SrcSize)
{
	BOOL rc = FALSE;
	int status;
	BYTE* pDstData = calloc(width * height, 4);
	CLEAR_CONTEXT* clear = clear_context_new(FALSE);

	if (!clear || !pDstData)
		goto fail;

	status = clear_decompress(clear, pSrcData, SrcSize, width, height,
	                          pDstData, PIXEL_FORMAT_XRGB32, 0, 0, 0, width, height,
	                          NULL);
	printf("clear_decompress example %"PRIu32" status: %d\n", nr, status);
	fflush(stdout);
	rc = (status == 0);
fail:
	clear_context_free(clear);
	free(pDstData);
	return rc;
}