diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2014-03-18 00:07:11 -0700 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2014-03-18 00:07:11 -0700 |
commit | 6d7e315b0c0a1e56e135614f1e2e96fa19870975 (patch) | |
tree | 536a8fe4fd25d7c6b615c4350d09f0a114cea293 /xrdp | |
parent | 63032b000daeaaeb1eed75abc1c70066c9e02581 (diff) | |
download | xrdp-proprietary-6d7e315b0c0a1e56e135614f1e2e96fa19870975.tar.gz xrdp-proprietary-6d7e315b0c0a1e56e135614f1e2e96fa19870975.zip |
work on surface command
Diffstat (limited to 'xrdp')
-rw-r--r-- | xrdp/xrdp_encoder.c | 17 | ||||
-rw-r--r-- | xrdp/xrdp_mm.c | 12 | ||||
-rw-r--r-- | xrdp/xrdp_types.h | 3 |
3 files changed, 25 insertions, 7 deletions
diff --git a/xrdp/xrdp_encoder.c b/xrdp/xrdp_encoder.c index 40c921f1..02b371ec 100644 --- a/xrdp/xrdp_encoder.c +++ b/xrdp/xrdp_encoder.c @@ -162,7 +162,7 @@ process_enc(struct xrdp_mm *self, XRDP_ENC_DATA *enc) LLOGLN(0, ("process_enc: error")); return 1; } - out_data = (char *) g_malloc(out_data_bytes, 0); + out_data = (char *) g_malloc(out_data_bytes + 256, 0); if (out_data == 0) { LLOGLN(0, ("process_enc: error")); @@ -172,11 +172,20 @@ process_enc(struct xrdp_mm *self, XRDP_ENC_DATA *enc) enc->width, enc->height, enc->width * 4, x, y, cx, cy, quality, - out_data, &out_data_bytes); + out_data + 256, &out_data_bytes); + if (error < 0) + { + LLOGLN(0, ("process_enc: jpeg error %d bytes %d", + error, out_data_bytes)); + g_free(out_data); + return 1; + } LLOGLN(10, ("jpeg error %d bytes %d", error, out_data_bytes)); - enc_done = g_malloc(sizeof(XRDP_ENC_DATA_DONE), 1); + enc_done = (XRDP_ENC_DATA_DONE *) + g_malloc(sizeof(XRDP_ENC_DATA_DONE), 1); enc_done->comp_bytes = out_data_bytes; - enc_done->comp_data = out_data; + enc_done->pad_bytes = 256; + enc_done->comp_pad_data = out_data; enc_done->enc = enc; enc_done->last = index == (enc->num_crects - 1); enc_done->index = index; diff --git a/xrdp/xrdp_mm.c b/xrdp/xrdp_mm.c index daa82c80..10b7234d 100644 --- a/xrdp/xrdp_mm.c +++ b/xrdp/xrdp_mm.c @@ -1980,9 +1980,17 @@ xrdp_mm_check_wait_objs(struct xrdp_mm *self) g_snprintf(text, 255, "/tmp/jj0x%8.8x.jpg", jj); jj++; ii = g_file_open(text); - g_file_write(ii, enc_done->comp_data, enc_done->comp_bytes); + g_file_write(ii, enc_done->comp_pad_data + enc_done->pad_bytes, enc_done->comp_bytes); g_file_close(ii); } + + libxrdp_fastpath_send_surface(self->wm->session, + enc_done->comp_pad_data, + enc_done->pad_bytes, + enc_done->comp_bytes, + 0, 0, 0, 0, 32, 99, 0, 0); + + /* free enc_done */ if (enc_done->last) { @@ -1991,7 +1999,7 @@ xrdp_mm_check_wait_objs(struct xrdp_mm *self) g_free(enc_done->enc->crects); g_free(enc_done->enc); } - g_free(enc_done->comp_data); + g_free(enc_done->comp_pad_data); g_free(enc_done); tc_mutex_lock(self->mutex); enc_done = (XRDP_ENC_DATA_DONE*) diff --git a/xrdp/xrdp_types.h b/xrdp/xrdp_types.h index 3ac1b752..c50daf79 100644 --- a/xrdp/xrdp_types.h +++ b/xrdp/xrdp_types.h @@ -629,7 +629,8 @@ typedef struct xrdp_enc_data XRDP_ENC_DATA; struct xrdp_enc_data_done { int comp_bytes; - char *comp_data; + int pad_bytes; + char *comp_pad_data; struct xrdp_enc_data *enc; int last; /* true is this is last message for enc */ int index; /* depends on codec */ |