From c8579c340319d39778ee0a5ce328879ba274862a Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Sat, 15 Feb 2014 21:19:54 -0800 Subject: [PATCH] libxrdp: started adding planar bitmap compression --- libxrdp/Makefile.am | 1 + libxrdp/libxrdp.h | 5 +++++ libxrdp/xrdp_bitmap32_compress.c | 32 ++++++++++++++++++++++++++++++++ libxrdp/xrdp_orders.c | 12 ++++++++++-- 4 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 libxrdp/xrdp_bitmap32_compress.c 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) {