diff --git a/include/freerdp/codec/progressive.h b/include/freerdp/codec/progressive.h new file mode 100644 index 000000000..016bc7412 --- /dev/null +++ b/include/freerdp/codec/progressive.h @@ -0,0 +1,53 @@ +/** + * FreeRDP: A Remote Desktop Protocol Implementation + * Progressive Codec Bitmap Compression + * + * Copyright 2014 Marc-Andre Moreau + * + * 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_PROGRESSIVE_H +#define FREERDP_CODEC_PROGRESSIVE_H + +#include +#include + +#include + +struct _PROGRESSIVE_CONTEXT +{ + BOOL Compressor; +}; +typedef struct _PROGRESSIVE_CONTEXT PROGRESSIVE_CONTEXT; + +#ifdef __cplusplus +extern "C" { +#endif + +FREERDP_API int progressive_compress(PROGRESSIVE_CONTEXT* progressive, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData, UINT32* pDstSize); + +FREERDP_API int progressive_decompress(PROGRESSIVE_CONTEXT* progressive, BYTE* pSrcData, UINT32 SrcSize, + BYTE** ppDstData, DWORD DstFormat, int nDstStep, int nXDst, int nYDst, int nWidth, int nHeight); + +FREERDP_API void progressive_context_reset(PROGRESSIVE_CONTEXT* progressive); + +FREERDP_API PROGRESSIVE_CONTEXT* progressive_context_new(BOOL Compressor); +FREERDP_API void progressive_context_free(PROGRESSIVE_CONTEXT* progressive); + +#ifdef __cplusplus +} +#endif + +#endif /* FREERDP_CODEC_PROGRESSIVE_H */ + diff --git a/libfreerdp/codec/CMakeLists.txt b/libfreerdp/codec/CMakeLists.txt index 5fd04894f..a99b2f21e 100644 --- a/libfreerdp/codec/CMakeLists.txt +++ b/libfreerdp/codec/CMakeLists.txt @@ -24,6 +24,7 @@ set(${MODULE_PREFIX}_SRCS audio.c planar.c planar.h + progressive.c bitmap_decode.c bitmap_encode.c rfx_bitstream.h diff --git a/libfreerdp/codec/progressive.c b/libfreerdp/codec/progressive.c new file mode 100644 index 000000000..4b798065c --- /dev/null +++ b/libfreerdp/codec/progressive.c @@ -0,0 +1,68 @@ +/** + * FreeRDP: A Remote Desktop Protocol Implementation + * Progressive Codec Bitmap Compression + * + * Copyright 2014 Marc-Andre Moreau + * + * 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 +#include +#include + +#include +#include + +int progressive_decompress(PROGRESSIVE_CONTEXT* progressive, BYTE* pSrcData, UINT32 SrcSize, + BYTE** ppDstData, DWORD DstFormat, int nDstStep, int nXDst, int nYDst, int nWidth, int nHeight) +{ + return 1; +} + +int progressive_compress(PROGRESSIVE_CONTEXT* progressive, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData, UINT32* pDstSize) +{ + return 1; +} + +void progressive_context_reset(PROGRESSIVE_CONTEXT* progressive) +{ + +} + +PROGRESSIVE_CONTEXT* progressive_context_new(BOOL Compressor) +{ + PROGRESSIVE_CONTEXT* progressive; + + progressive = (PROGRESSIVE_CONTEXT*) calloc(1, sizeof(PROGRESSIVE_CONTEXT)); + + if (progressive) + { + progressive->Compressor = Compressor; + } + + return progressive; +} + +void progressive_context_free(PROGRESSIVE_CONTEXT* progressive) +{ + if (!progressive) + return; + + free(progressive); +} + diff --git a/libfreerdp/codec/test/CMakeLists.txt b/libfreerdp/codec/test/CMakeLists.txt index ba158560c..6ce9c65c2 100644 --- a/libfreerdp/codec/test/CMakeLists.txt +++ b/libfreerdp/codec/test/CMakeLists.txt @@ -12,6 +12,7 @@ set(${MODULE_PREFIX}_TESTS TestFreeRDPCodecZGfx.c TestFreeRDPCodecPlanar.c TestFreeRDPCodecClear.c + TestFreeRDPCodecProgressive.c TestFreeRDPCodecRemoteFX.c) create_test_sourcelist(${MODULE_PREFIX}_SRCS diff --git a/libfreerdp/codec/test/TestFreeRDPCodecProgressive.c b/libfreerdp/codec/test/TestFreeRDPCodecProgressive.c new file mode 100644 index 000000000..320329300 --- /dev/null +++ b/libfreerdp/codec/test/TestFreeRDPCodecProgressive.c @@ -0,0 +1,10 @@ +#include +#include + +#include + +int TestFreeRDPCodecProgressive(int argc, char* argv[]) +{ + return 0; +} +