diff --git a/channels/rdpei/server/rdpei_main.c b/channels/rdpei/server/rdpei_main.c index 9e3cf57dc..c046d1f7d 100644 --- a/channels/rdpei/server/rdpei_main.c +++ b/channels/rdpei/server/rdpei_main.c @@ -593,12 +593,17 @@ UINT rdpei_server_handle_messages(RdpeiServerContext* context) return error; } +UINT rdpei_server_send_sc_ready(RdpeiServerContext* context, UINT32 version) +{ + return rdpei_server_send_sc_ready_ex(context, version, 0); +} + /** * Function description * * @return 0 on success, otherwise a Win32 error code */ -UINT rdpei_server_send_sc_ready(RdpeiServerContext* context, UINT32 version, UINT32 features) +UINT rdpei_server_send_sc_ready_ex(RdpeiServerContext* context, UINT32 version, UINT32 features) { ULONG written; RdpeiServerPrivate* priv = context->priv; diff --git a/include/freerdp/codec/progressive.h b/include/freerdp/codec/progressive.h index 57a81f98d..df602db89 100644 --- a/include/freerdp/codec/progressive.h +++ b/include/freerdp/codec/progressive.h @@ -37,17 +37,26 @@ extern "C" { #endif - FREERDP_API int progressive_compress(PROGRESSIVE_CONTEXT* progressive, const BYTE* pSrcData, - UINT32 SrcSize, UINT32 SrcFormat, UINT32 Width, - UINT32 Height, UINT32 ScanLine, - const REGION16* invalidRegion, BYTE** ppDstData, - UINT32* pDstSize); + FREERDP_API WINPR_DEPRECATED(int progressive_compress(PROGRESSIVE_CONTEXT* progressive, + const BYTE* pSrcData, UINT32 SrcSize, + BYTE** ppDstData, UINT32* pDstSize)); - FREERDP_API INT32 progressive_decompress(PROGRESSIVE_CONTEXT* progressive, const BYTE* pSrcData, - UINT32 SrcSize, BYTE* pDstData, UINT32 DstFormat, - UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, - REGION16* invalidRegion, UINT16 surfaceId, - UINT32 frameId); + FREERDP_API int progressive_compress_ex(PROGRESSIVE_CONTEXT* progressive, const BYTE* pSrcData, + UINT32 SrcSize, UINT32 SrcFormat, UINT32 Width, + UINT32 Height, UINT32 ScanLine, + const REGION16* invalidRegion, BYTE** ppDstData, + UINT32* pDstSize); + + FREERDP_API WINPR_DEPRECATED(INT32 progressive_decompress( + PROGRESSIVE_CONTEXT* progressive, const BYTE* pSrcData, UINT32 SrcSize, BYTE* pDstData, + UINT32 DstFormat, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, REGION16* invalidRegion, + UINT16 surfaceId)); + + FREERDP_API INT32 progressive_decompress_ex(PROGRESSIVE_CONTEXT* progressive, + const BYTE* pSrcData, UINT32 SrcSize, + BYTE* pDstData, UINT32 DstFormat, UINT32 nDstStep, + UINT32 nXDst, UINT32 nYDst, REGION16* invalidRegion, + UINT16 surfaceId, UINT32 frameId); FREERDP_API INT32 progressive_create_surface_context(PROGRESSIVE_CONTEXT* progressive, UINT16 surfaceId, UINT32 width, diff --git a/include/freerdp/codec/rfx.h b/include/freerdp/codec/rfx.h index ffdbd5e2e..ff358be7d 100644 --- a/include/freerdp/codec/rfx.h +++ b/include/freerdp/codec/rfx.h @@ -190,10 +190,14 @@ extern "C" size_t numRects, const BYTE* data, UINT32 width, UINT32 height, size_t scanline); - FREERDP_API RFX_MESSAGE* rfx_encode_messages(RFX_CONTEXT* context, const RFX_RECT* rects, - size_t numRects, const BYTE* data, UINT32 width, - UINT32 height, UINT32 scanline, - size_t* numMessages, size_t maxDataSize); + FREERDP_API WINPR_DEPRECATED(RFX_MESSAGE* rfx_encode_messages( + RFX_CONTEXT* context, const RFX_RECT* rects, int numRects, const BYTE* data, int width, + int height, int scanline, int* numMessages, int maxDataSize)); + + FREERDP_API RFX_MESSAGE* rfx_encode_messages_ex(RFX_CONTEXT* context, const RFX_RECT* rects, + size_t numRects, const BYTE* data, UINT32 width, + UINT32 height, UINT32 scanline, + size_t* numMessages, size_t maxDataSize); FREERDP_API BOOL rfx_write_message(RFX_CONTEXT* context, wStream* s, const RFX_MESSAGE* message); diff --git a/include/freerdp/server/rdpei.h b/include/freerdp/server/rdpei.h index 765809d8f..841335174 100644 --- a/include/freerdp/server/rdpei.h +++ b/include/freerdp/server/rdpei.h @@ -60,8 +60,11 @@ extern "C" FREERDP_API UINT rdpei_server_init(RdpeiServerContext* context); FREERDP_API UINT rdpei_server_handle_messages(RdpeiServerContext* context); - FREERDP_API UINT rdpei_server_send_sc_ready(RdpeiServerContext* context, UINT32 version, - UINT32 features); + FREERDP_API WINPR_DEPRECATED(UINT rdpei_server_send_sc_ready(RdpeiServerContext* context, + UINT32 version)); + + FREERDP_API UINT rdpei_server_send_sc_ready_ex(RdpeiServerContext* context, UINT32 version, + UINT32 features); FREERDP_API UINT rdpei_server_suspend(RdpeiServerContext* context); FREERDP_API UINT rdpei_server_resume(RdpeiServerContext* context); diff --git a/libfreerdp/codec/progressive.c b/libfreerdp/codec/progressive.c index da2ac7871..8ef0b9081 100644 --- a/libfreerdp/codec/progressive.c +++ b/libfreerdp/codec/progressive.c @@ -2154,8 +2154,16 @@ static INLINE INT32 progressive_wb_region(PROGRESSIVE_CONTEXT* progressive, wStr INT32 progressive_decompress(PROGRESSIVE_CONTEXT* progressive, const BYTE* pSrcData, UINT32 SrcSize, BYTE* pDstData, UINT32 DstFormat, UINT32 nDstStep, UINT32 nXDst, - UINT32 nYDst, REGION16* invalidRegion, UINT16 surfaceId, - UINT32 frameId) + UINT32 nYDst, REGION16* invalidRegion, UINT16 surfaceId) +{ + return progressive_decompress_ex(progressive, pSrcData, SrcSize, pDstData, DstFormat, nDstStep, + nXDst, nYDst, invalidRegion, surfaceId, 0); +} + +INT32 progressive_decompress_ex(PROGRESSIVE_CONTEXT* progressive, const BYTE* pSrcData, + UINT32 SrcSize, BYTE* pDstData, UINT32 DstFormat, UINT32 nDstStep, + UINT32 nXDst, UINT32 nYDst, REGION16* invalidRegion, + UINT16 surfaceId, UINT32 frameId) { INT32 rc = 1; UINT32 i, j; @@ -2470,8 +2478,14 @@ static BOOL progressive_rfx_write_message_progressive_simple(RFX_CONTEXT* contex } int progressive_compress(PROGRESSIVE_CONTEXT* progressive, const BYTE* pSrcData, UINT32 SrcSize, - UINT32 SrcFormat, UINT32 Width, UINT32 Height, UINT32 ScanLine, - const REGION16* invalidRegion, BYTE** ppDstData, UINT32* pDstSize) + BYTE** ppDstData, UINT32* pDstSize) +{ + return -1; +} + +int progressive_compress_ex(PROGRESSIVE_CONTEXT* progressive, const BYTE* pSrcData, UINT32 SrcSize, + UINT32 SrcFormat, UINT32 Width, UINT32 Height, UINT32 ScanLine, + const REGION16* invalidRegion, BYTE** ppDstData, UINT32* pDstSize) { BOOL rc; int res = -6; diff --git a/libfreerdp/codec/rfx.c b/libfreerdp/codec/rfx.c index 2e3b56460..8c65e7508 100644 --- a/libfreerdp/codec/rfx.c +++ b/libfreerdp/codec/rfx.c @@ -1722,9 +1722,9 @@ free_messages: return NULL; } -RFX_MESSAGE* rfx_encode_messages(RFX_CONTEXT* context, const RFX_RECT* rects, size_t numRects, - const BYTE* data, UINT32 width, UINT32 height, UINT32 scanline, - size_t* numMessages, size_t maxDataSize) +RFX_MESSAGE* rfx_encode_messages_ex(RFX_CONTEXT* context, const RFX_RECT* rects, size_t numRects, + const BYTE* data, UINT32 width, UINT32 height, UINT32 scanline, + size_t* numMessages, size_t maxDataSize) { RFX_MESSAGE* message; RFX_MESSAGE* messageList; @@ -1884,3 +1884,15 @@ BOOL rfx_compose_message(RFX_CONTEXT* context, wStream* s, const RFX_RECT* rects rfx_message_free(context, message); return ret; } + +RFX_MESSAGE* rfx_encode_messages(RFX_CONTEXT* context, const RFX_RECT* rects, int numRects, + const BYTE* data, int width, int height, int scanline, + int* numMessages, int maxDataSize) +{ + size_t tmp; + RFX_MESSAGE* msg = rfx_encode_messages_ex(context, rects, numRects, data, width, height, + scanline, &tmp, maxDataSize); + if (numMessages) + *numMessages = tmp; + return msg; +} diff --git a/libfreerdp/codec/test/TestFreeRDPCodecProgressive.c b/libfreerdp/codec/test/TestFreeRDPCodecProgressive.c index f9ab7b627..5621b8e3e 100644 --- a/libfreerdp/codec/test/TestFreeRDPCodecProgressive.c +++ b/libfreerdp/codec/test/TestFreeRDPCodecProgressive.c @@ -840,8 +840,8 @@ static int test_progressive_decode(PROGRESSIVE_CONTEXT* progressive, EGFX_SAMPLE for (pass = 0; pass < count; pass++) { status = - progressive_decompress(progressive, files[pass].buffer, files[pass].size, g_DstData, - PIXEL_FORMAT_XRGB32, g_DstStep, 0, 0, NULL, 0, 0); + progressive_decompress_ex(progressive, files[pass].buffer, files[pass].size, g_DstData, + PIXEL_FORMAT_XRGB32, g_DstStep, 0, 0, NULL, 0, 0); printf("ProgressiveDecompress: status: %d pass: %d\n", status, pass + 1); region = &(progressive->region); @@ -1068,17 +1068,17 @@ static BOOL test_encode_decode(const char* path) goto fail; // Progressive encode - rc = progressive_compress(progressiveEnc, image->data, image->scanline * image->height, - ColorFormat, image->width, image->height, image->scanline, NULL, - &dstData, &dstSize); + rc = progressive_compress_ex(progressiveEnc, image->data, image->scanline * image->height, + ColorFormat, image->width, image->height, image->scanline, NULL, + &dstData, &dstSize); // Progressive decode rc = progressive_create_surface_context(progressiveDec, 0, image->width, image->height); if (rc <= 0) goto fail; - rc = progressive_decompress(progressiveDec, dstData, dstSize, resultData, ColorFormat, - image->scanline, 0, 0, &invalidRegion, 0, 0); + rc = progressive_decompress_ex(progressiveDec, dstData, dstSize, resultData, ColorFormat, + image->scanline, 0, 0, &invalidRegion, 0, 0); if (rc < 0) goto fail; diff --git a/libfreerdp/gdi/gfx.c b/libfreerdp/gdi/gfx.c index 15bbfee1c..524a57529 100644 --- a/libfreerdp/gdi/gfx.c +++ b/libfreerdp/gdi/gfx.c @@ -825,13 +825,13 @@ static UINT gdi_SurfaceCommand_Progressive(rdpGdi* gdi, RdpgfxClientContext* con } region16_init(&invalidRegion); - rc = progressive_decompress(surface->codecs->progressive, cmd->data, cmd->length, surface->data, - surface->format, surface->scanline, cmd->left, cmd->top, - &invalidRegion, cmd->surfaceId, gdi->frameId); + rc = progressive_decompress_ex(surface->codecs->progressive, cmd->data, cmd->length, + surface->data, surface->format, surface->scanline, cmd->left, + cmd->top, &invalidRegion, cmd->surfaceId, gdi->frameId); if (rc < 0) { - WLog_ERR(TAG, "progressive_decompress failure: %" PRId32 "", rc); + WLog_ERR(TAG, "progressive_decompress_ex failure: %" PRId32 "", rc); region16_uninit(&invalidRegion); return ERROR_INTERNAL_ERROR; } diff --git a/server/shadow/shadow_client.c b/server/shadow/shadow_client.c index d37e550c6..e6bc67b6e 100644 --- a/server/shadow/shadow_client.c +++ b/server/shadow/shadow_client.c @@ -970,11 +970,11 @@ static BOOL shadow_client_send_surface_bits(rdpShadowClient* client, BYTE* pSrcD rect.width = nWidth; rect.height = nHeight; - if (!(messages = rfx_encode_messages( + if (!(messages = rfx_encode_messages_ex( encoder->rfx, &rect, 1, pSrcData, settings->DesktopWidth, settings->DesktopHeight, nSrcStep, &numMessages, settings->MultifragMaxRequestSize))) { - WLog_ERR(TAG, "rfx_encode_messages failed"); + WLog_ERR(TAG, "rfx_encode_messages_ex failed"); return FALSE; }