libfreerdp-codec: stub progressive codec decompressor
authorMarc-André Moreau <marcandre.moreau@gmail.com>
Mon, 28 Jul 2014 21:42:23 +0000 (17:42 -0400)
committerMarc-André Moreau <marcandre.moreau@gmail.com>
Mon, 28 Jul 2014 21:42:23 +0000 (17:42 -0400)
include/freerdp/codec/progressive.h [new file with mode: 0644]
libfreerdp/codec/CMakeLists.txt
libfreerdp/codec/progressive.c [new file with mode: 0644]
libfreerdp/codec/test/CMakeLists.txt
libfreerdp/codec/test/TestFreeRDPCodecProgressive.c [new file with mode: 0644]

diff --git a/include/freerdp/codec/progressive.h b/include/freerdp/codec/progressive.h
new file mode 100644 (file)
index 0000000..016bc74
--- /dev/null
@@ -0,0 +1,53 @@
+/**
+ * FreeRDP: A Remote Desktop Protocol Implementation
+ * Progressive Codec Bitmap 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_PROGRESSIVE_H
+#define FREERDP_CODEC_PROGRESSIVE_H
+
+#include <freerdp/api.h>
+#include <freerdp/types.h>
+
+#include <freerdp/codec/color.h>
+
+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 */
index 5fd0489..a99b2f2 100644 (file)
@@ -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 (file)
index 0000000..4b79806
--- /dev/null
@@ -0,0 +1,68 @@
+/**
+ * FreeRDP: A Remote Desktop Protocol Implementation
+ * Progressive Codec Bitmap 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/color.h>
+#include <freerdp/codec/progressive.h>
+
+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);
+}
+
index ba15856..6ce9c65 100644 (file)
@@ -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 (file)
index 0000000..3203293
--- /dev/null
@@ -0,0 +1,10 @@
+#include <winpr/crt.h>
+#include <winpr/print.h>
+
+#include <freerdp/codec/progressive.h>
+
+int TestFreeRDPCodecProgressive(int argc, char* argv[])
+{
+       return 0;
+}
+