#include <winpr/crt.h>
#include <winpr/wlog.h>
+#include <winpr/print.h>
#include <winpr/synch.h>
#include <winpr/thread.h>
#include <winpr/stream.h>
int rdpgfx_recv_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s)
{
+ RDPGFX_HEADER header;
+
+ /* RDPGFX_HEADER */
+
+ /* data needs to be decompressed first */
+
+ //winpr_HexDump(Stream_Buffer(s), 32);
+
+ return 0;
+
+ Stream_Read_UINT16(s, header.cmdId); /* cmdId (2 bytes) */
+ Stream_Read_UINT16(s, header.flags); /* flags (2 bytes) */
+ Stream_Read_UINT32(s, header.pduLength); /* pduLength (4 bytes) */
+
+ printf("cmdId: 0x%04X flags: 0x%04X pduLength: %d\n",
+ header.cmdId, header.flags, header.pduLength);
+
return 0;
}
int status = 0;
RDPGFX_CHANNEL_CALLBACK* callback = (RDPGFX_CHANNEL_CALLBACK*) pChannelCallback;
- fprintf(stderr, "RdpGfxOnDataReceived\n");
+ fprintf(stderr, "RdpGfxOnDataReceived: cbSize: %d\n", cbSize);
s = Stream_New(pBuffer, cbSize);
--- /dev/null
+/**
+ * FreeRDP: A Remote Desktop Protocol Implementation
+ * ZGFX (RDP8) Bulk Data Compression
+ *
+ * Copyright 2014 Marc-Andre Moreau <marcandre.moreau@gmail.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef FREERDP_CODEC_ZGFX_H
+#define FREERDP_CODEC_ZGFX_H
+
+#include <freerdp/api.h>
+#include <freerdp/types.h>
+
+#include <freerdp/codec/bulk.h>
+
+#pragma pack(push,1)
+
+
+
+#pragma pack(pop)
+
+struct _ZGFX_CONTEXT
+{
+ BOOL Compressor;
+};
+typedef struct _ZGFX_CONTEXT ZGFX_CONTEXT;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+FREERDP_API int zgfx_compress(ZGFX_CONTEXT* zgfx, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData, UINT32* pDstSize, UINT32* pFlags);
+FREERDP_API int zgfx_decompress(ZGFX_CONTEXT* zgfx, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData, UINT32* pDstSize, UINT32 flags);
+
+FREERDP_API void zgfx_context_reset(ZGFX_CONTEXT* zgfx, BOOL flush);
+
+FREERDP_API ZGFX_CONTEXT* zgfx_context_new(BOOL Compressor);
+FREERDP_API void zgfx_context_free(ZGFX_CONTEXT* zgfx);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* FREERDP_CODEC_ZGFX_H */
+
ncrush.c
xcrush.c
mppc.c
+ zgfx.c
jpeg.c)
set(${MODULE_PREFIX}_SSE2_SRCS
TestFreeRDPCodecMppc.c
TestFreeRDPCodecNCrush.c
TestFreeRDPCodecXCrush.c
+ TestFreeRDPCodecZGfx.c
TestFreeRDPCodecPlanar.c
TestFreeRDPCodecRemoteFX.c)
--- /dev/null
+#include <winpr/crt.h>
+#include <winpr/print.h>
+
+#include <freerdp/codec/zgfx.h>
+
+int TestFreeRDPCodecZGfx(int argc, char* argv[])
+{
+ return 0;
+}
+
--- /dev/null
+/**
+ * FreeRDP: A Remote Desktop Protocol Implementation
+ * ZGFX (RDP8) Bulk Data Compression
+ *
+ * Copyright 2014 Marc-Andre Moreau <marcandre.moreau@gmail.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <winpr/crt.h>
+#include <winpr/print.h>
+#include <winpr/bitstream.h>
+
+#include <freerdp/codec/zgfx.h>
+
+int zgfx_decompress(ZGFX_CONTEXT* zgfx, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData, UINT32* pDstSize, UINT32 flags)
+{
+ int status = 0;
+
+ return status;
+}
+
+int zgfx_compress(ZGFX_CONTEXT* zgfx, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData, UINT32* pDstSize, UINT32* pFlags)
+{
+ int status = 0;
+
+ return 1;
+}
+
+void zgfx_context_reset(ZGFX_CONTEXT* zgfx, BOOL flush)
+{
+
+}
+
+ZGFX_CONTEXT* zgfx_context_new(BOOL Compressor)
+{
+ ZGFX_CONTEXT* zgfx;
+
+ zgfx = (ZGFX_CONTEXT*) calloc(1, sizeof(ZGFX_CONTEXT));
+
+ if (zgfx)
+ {
+ zgfx->Compressor = Compressor;
+
+ zgfx_context_reset(zgfx, FALSE);
+ }
+
+ return zgfx;
+}
+
+void zgfx_context_free(ZGFX_CONTEXT* zgfx)
+{
+ if (zgfx)
+ {
+ free(zgfx);
+ }
+}
+