Compatibility changes
authorArmin Novak <armin.novak@thincast.com>
Fri, 5 Feb 2021 11:42:20 +0000 (12:42 +0100)
committerakallabeth <akallabeth@users.noreply.github.com>
Thu, 25 Feb 2021 08:51:41 +0000 (09:51 +0100)
Renamed symbols and added wrappers to keep API compatible with
2.0 branch.

channels/rdpei/server/rdpei_main.c
include/freerdp/codec/progressive.h
include/freerdp/codec/rfx.h
include/freerdp/server/rdpei.h
libfreerdp/codec/progressive.c
libfreerdp/codec/rfx.c
libfreerdp/codec/test/TestFreeRDPCodecProgressive.c
libfreerdp/gdi/gfx.c
server/shadow/shadow_client.c

index 9e3cf57..c046d1f 100644 (file)
@@ -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;
index 57a81f9..df602db 100644 (file)
@@ -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,
index ffdbd5e..ff358be 100644 (file)
@@ -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);
 
index 765809d..8413351 100644 (file)
@@ -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);
 
index da2ac78..8ef0b90 100644 (file)
@@ -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;
index 2e3b564..8c65e75 100644 (file)
@@ -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;
+}
index f9ab7b6..5621b8e 100644 (file)
@@ -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;
 
index 15bbfee..524a575 100644 (file)
@@ -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;
        }
index d37e550..e6bc67b 100644 (file)
@@ -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;
                }