Compatibility changes

Renamed symbols and added wrappers to keep API compatible with
2.0 branch.
This commit is contained in:
Armin Novak 2021-02-05 12:42:20 +01:00 committed by akallabeth
parent 5e89baddd9
commit 048aca5cce
9 changed files with 84 additions and 37 deletions

View 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;

View File

@ -37,17 +37,26 @@ extern "C"
{
#endif
FREERDP_API int progressive_compress(PROGRESSIVE_CONTEXT* progressive, const BYTE* pSrcData,
FREERDP_API WINPR_DEPRECATED(int progressive_compress(PROGRESSIVE_CONTEXT* progressive,
const BYTE* pSrcData, UINT32 SrcSize,
BYTE** ppDstData, UINT32* pDstSize));
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 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 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,

View File

@ -190,7 +190,11 @@ 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,
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);

View File

@ -60,7 +60,10 @@ 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,
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);

View 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,6 +2478,12 @@ static BOOL progressive_rfx_write_message_progressive_simple(RFX_CONTEXT* contex
}
int progressive_compress(PROGRESSIVE_CONTEXT* progressive, const BYTE* pSrcData, UINT32 SrcSize,
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)
{

View File

@ -1722,7 +1722,7 @@ free_messages:
return NULL;
}
RFX_MESSAGE* rfx_encode_messages(RFX_CONTEXT* context, const RFX_RECT* rects, size_t numRects,
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)
{
@ -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;
}

View File

@ -840,7 +840,7 @@ 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,
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,7 +1068,7 @@ static BOOL test_encode_decode(const char* path)
goto fail;
// Progressive encode
rc = progressive_compress(progressiveEnc, image->data, image->scanline * image->height,
rc = progressive_compress_ex(progressiveEnc, image->data, image->scanline * image->height,
ColorFormat, image->width, image->height, image->scanline, NULL,
&dstData, &dstSize);
@ -1077,7 +1077,7 @@ static BOOL test_encode_decode(const char* path)
if (rc <= 0)
goto fail;
rc = progressive_decompress(progressiveDec, dstData, dstSize, resultData, ColorFormat,
rc = progressive_decompress_ex(progressiveDec, dstData, dstSize, resultData, ColorFormat,
image->scanline, 0, 0, &invalidRegion, 0, 0);
if (rc < 0)
goto fail;

View 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;
}

View 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;
}