Refactored bulk compression

* Arguments now opaque
* Removed internal functions from external interface
This commit is contained in:
Armin Novak 2020-03-10 10:31:41 +01:00 committed by akallabeth
parent eca32456bb
commit 49b17e4e03
2 changed files with 14 additions and 16 deletions

View File

@ -26,6 +26,19 @@
#define TAG "com.freerdp.core"
//#define WITH_BULK_DEBUG 1
struct rdp_bulk
{
rdpContext* context;
UINT32 CompressionLevel;
UINT32 CompressionMaxSize;
MPPC_CONTEXT* mppcSend;
MPPC_CONTEXT* mppcRecv;
NCRUSH_CONTEXT* ncrushRecv;
NCRUSH_CONTEXT* ncrushSend;
XCRUSH_CONTEXT* xcrushRecv;
XCRUSH_CONTEXT* xcrushSend;
BYTE OutputBuffer[65536];
};
static INLINE const char* bulk_get_compression_flags_string(UINT32 flags)
{
@ -51,7 +64,7 @@ static INLINE const char* bulk_get_compression_flags_string(UINT32 flags)
return "PACKET_UNKNOWN";
}
UINT32 bulk_compression_level(rdpBulk* bulk)
static UINT32 bulk_compression_level(rdpBulk* bulk)
{
rdpSettings* settings = bulk->context->settings;
bulk->CompressionLevel = (settings->CompressionLevel >= PACKET_COMPR_TYPE_RDP61)

View File

@ -29,24 +29,9 @@ typedef struct rdp_bulk rdpBulk;
#include <freerdp/codec/ncrush.h>
#include <freerdp/codec/xcrush.h>
struct rdp_bulk
{
rdpContext* context;
UINT32 CompressionLevel;
UINT32 CompressionMaxSize;
MPPC_CONTEXT* mppcSend;
MPPC_CONTEXT* mppcRecv;
NCRUSH_CONTEXT* ncrushRecv;
NCRUSH_CONTEXT* ncrushSend;
XCRUSH_CONTEXT* xcrushRecv;
XCRUSH_CONTEXT* xcrushSend;
BYTE OutputBuffer[65536];
};
#define BULK_COMPRESSION_FLAGS_MASK 0xE0
#define BULK_COMPRESSION_TYPE_MASK 0x0F
FREERDP_LOCAL UINT32 bulk_compression_level(rdpBulk* bulk);
FREERDP_LOCAL UINT32 bulk_compression_max_size(rdpBulk* bulk);
FREERDP_LOCAL int bulk_decompress(rdpBulk* bulk, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData,