summaryrefslogtreecommitdiffstats
path: root/libxrdp
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2014-02-15 21:19:54 -0800
committerJay Sorg <jay.sorg@gmail.com>2014-02-15 21:19:54 -0800
commitc8579c340319d39778ee0a5ce328879ba274862a (patch)
treeaa99e42b92fdaaa91f1f3896c1454fa9b4949b11 /libxrdp
parent6cd6f15d4692136f1bbdbebde7e1530659641ef4 (diff)
downloadxrdp-proprietary-c8579c340319d39778ee0a5ce328879ba274862a.tar.gz
xrdp-proprietary-c8579c340319d39778ee0a5ce328879ba274862a.zip
libxrdp: started adding planar bitmap compression
Diffstat (limited to 'libxrdp')
-rw-r--r--libxrdp/Makefile.am1
-rw-r--r--libxrdp/libxrdp.h5
-rw-r--r--libxrdp/xrdp_bitmap32_compress.c32
-rw-r--r--libxrdp/xrdp_orders.c12
4 files changed, 48 insertions, 2 deletions
diff --git a/libxrdp/Makefile.am b/libxrdp/Makefile.am
index 6564da36..389453b1 100644
--- a/libxrdp/Makefile.am
+++ b/libxrdp/Makefile.am
@@ -57,6 +57,7 @@ libxrdp_la_SOURCES = \
xrdp_sec.c \
xrdp_tcp.c \
xrdp_bitmap_compress.c \
+ xrdp_bitmap32_compress.c \
xrdp_jpeg_compress.c \
xrdp_orders_rail.c \
xrdp_mppc_enc.c
diff --git a/libxrdp/libxrdp.h b/libxrdp/libxrdp.h
index 993b412b..ebaff796 100644
--- a/libxrdp/libxrdp.h
+++ b/libxrdp/libxrdp.h
@@ -469,6 +469,11 @@ xrdp_bitmap_compress(char* in_data, int width, int height,
int start_line, struct stream* temp_s,
int e);
int APP_CC
+xrdp_bitmap32_compress(char* in_data, int width, int height,
+ struct stream* s, int bpp, int byte_limit,
+ int start_line, struct stream* temp_s,
+ int e);
+int APP_CC
xrdp_jpeg_compress(void *handle, char* in_data, int width, int height,
struct stream* s, int bpp, int byte_limit,
int start_line, struct stream* temp_s,
diff --git a/libxrdp/xrdp_bitmap32_compress.c b/libxrdp/xrdp_bitmap32_compress.c
new file mode 100644
index 00000000..b681d040
--- /dev/null
+++ b/libxrdp/xrdp_bitmap32_compress.c
@@ -0,0 +1,32 @@
+/**
+ * xrdp: A Remote Desktop Protocol server.
+ *
+ * Copyright (C) Jay Sorg 2014
+ *
+ * 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.
+ *
+ * planar bitmap compressor
+ * 32 bpp compression
+ */
+
+#include "libxrdp.h"
+
+/*****************************************************************************/
+int APP_CC
+xrdp_bitmap32_compress(char *in_data, int width, int height,
+ struct stream *s, int bpp, int byte_limit,
+ int start_line, struct stream *temp_s,
+ int e)
+{
+ return 0;
+}
diff --git a/libxrdp/xrdp_orders.c b/libxrdp/xrdp_orders.c
index 0e2d90d2..317e1135 100644
--- a/libxrdp/xrdp_orders.c
+++ b/libxrdp/xrdp_orders.c
@@ -2570,8 +2570,16 @@ xrdp_orders_send_bitmap2(struct xrdp_orders *self,
init_stream(temp_s, 16384);
p = s->p;
i = height;
- lines_sending = xrdp_bitmap_compress(data, width, height, s, bpp, 16384,
- i - 1, temp_s, e);
+ if (bpp > 24)
+ {
+ lines_sending = xrdp_bitmap32_compress(data, width, height, s, bpp, 16384,
+ i - 1, temp_s, e);
+ }
+ else
+ {
+ lines_sending = xrdp_bitmap_compress(data, width, height, s, bpp, 16384,
+ i - 1, temp_s, e);
+ }
if (lines_sending != height)
{