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; }
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; }
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; }
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; }
BOOL freerdp_client_codecs_prepare(rdpCodecs* codecs, UINT32 flags) { if ((flags & FREERDP_CODEC_INTERLEAVED) && !codecs->interleaved) { if (!(codecs->interleaved = bitmap_interleaved_context_new(FALSE))) { WLog_ERR(TAG, "Failed to create interleaved codec context"); return FALSE; } } if ((flags & FREERDP_CODEC_PLANAR) && !codecs->planar) { if (!(codecs->planar = freerdp_bitmap_planar_context_new(FALSE, 64, 64))) { WLog_ERR(TAG, "Failed to create planar bitmap codec context"); return FALSE; } } if ((flags & FREERDP_CODEC_NSCODEC) && !codecs->nsc) { if (!(codecs->nsc = nsc_context_new())) { WLog_ERR(TAG, "Failed to create nsc codec context"); return FALSE; } } if ((flags & FREERDP_CODEC_REMOTEFX) && !codecs->rfx) { if (!(codecs->rfx = rfx_context_new(FALSE))) { WLog_ERR(TAG, "Failed to create rfx codec context"); return FALSE; } } if ((flags & FREERDP_CODEC_CLEARCODEC) && !codecs->clear) { if (!(codecs->clear = clear_context_new(FALSE))) { WLog_ERR(TAG, "Failed to create clear codec context"); return FALSE; } } if (flags & FREERDP_CODEC_ALPHACODEC) { } if ((flags & FREERDP_CODEC_PROGRESSIVE) && !codecs->progressive) { if (!(codecs->progressive = progressive_context_new(FALSE))) { WLog_ERR(TAG, "Failed to create progressive codec context"); return FALSE; } } if ((flags & (FREERDP_CODEC_AVC420 | FREERDP_CODEC_AVC444)) && !codecs->h264) { if (!(codecs->h264 = h264_context_new(FALSE))) { WLog_ERR(TAG, "Failed to create h264 codec context"); return FALSE; } } return TRUE; }