From ede019a5258e85fe07191448259c88e7c687a207 Mon Sep 17 00:00:00 2001 From: Laxmikant Rashinkar Date: Mon, 24 Mar 2014 17:55:04 -0700 Subject: changed turbojpeg help message in configure.ac --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index e1be95cd..7f4f5810 100644 --- a/configure.ac +++ b/configure.ac @@ -40,7 +40,7 @@ AC_ARG_ENABLE(jpeg, AS_HELP_STRING([--enable-jpeg], [jpeg=true], [jpeg=false]) AM_CONDITIONAL(XRDP_JPEG, [test x$jpeg = xtrue]) AC_ARG_ENABLE(tjpeg, AS_HELP_STRING([--enable-tjpeg], - [Build turbo jpeg module(assumes /opt/libjpeg-turbo) (default: no)]), + [Build turbo jpeg module (default: no)]), [tjpeg=true], [tjpeg=false]) AM_CONDITIONAL(XRDP_TJPEG, [test x$tjpeg = xtrue]) -- cgit v1.2.1 From 9a3679b1c1dc43f411a0963056ee43a2f26c8e27 Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Wed, 26 Mar 2014 19:24:00 -0700 Subject: improve debugging dump jpeg for codec mode --- xrdp/xrdp_mm.c | 72 ++++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 60 insertions(+), 12 deletions(-) diff --git a/xrdp/xrdp_mm.c b/xrdp/xrdp_mm.c index c4e0177d..65c2f3d6 100644 --- a/xrdp/xrdp_mm.c +++ b/xrdp/xrdp_mm.c @@ -1923,6 +1923,61 @@ xrdp_mm_get_wait_objs(struct xrdp_mm *self, return rv; } +#define DUMP_JPEG 0 + +#if DUMP_JPEG + +/*****************************************************************************/ +static int APP_CC +xrdp_mm_dump_jpeg(struct xrdp_mm *self, XRDP_ENC_DATA_DONE *enc_done) +{ + static tbus ii; + static int jj; + struct _header + { + char tag[4]; + int width; + int height; + int bytes_follow; + } header; + tui16 *pheader_bytes; + int cx; + int cy; + + pheader_bytes = (tui16 *) (enc_done->comp_pad_data + enc_done->pad_bytes); + + cx = enc_done->enc->crects[enc_done->index * 4 + 2]; + cy = enc_done->enc->crects[enc_done->index * 4 + 3]; + + header.tag[0] = 'B'; + header.tag[1] = 'E'; + header.tag[2] = 'E'; + header.tag[3] = 'F'; + header.width = cx; + header.height = cy; + header.bytes_follow = enc_done->comp_bytes - (2 + pheader_bytes[0]); + if (ii == 0) + { + ii = g_file_open("/tmp/jpeg.beef.bin"); + if (ii == -1) + { + ii = 0; + } + } + if (ii != 0) + { + g_file_write(ii, (char*)&header, sizeof(header)); + g_file_write(ii, enc_done->comp_pad_data + + enc_done->pad_bytes + 2 + pheader_bytes[0], + enc_done->comp_bytes - (2 + pheader_bytes[0])); + jj++; + g_writeln("dumping jpeg index %d", jj); + } + return 0; +} + +#endif + /*****************************************************************************/ int APP_CC xrdp_mm_check_wait_objs(struct xrdp_mm *self) @@ -1995,23 +2050,16 @@ xrdp_mm_check_wait_objs(struct xrdp_mm *self) /* do something with msg */ LLOGLN(10, ("xrdp_mm_check_wait_objs: message back bytes %d", enc_done->comp_bytes)); - if (0) - { - tbus ii; - static int jj; - char text[256]; - - g_snprintf(text, 255, "/tmp/jj0x%8.8x.jpg", jj); - jj++; - ii = g_file_open(text); - g_file_write(ii, enc_done->comp_pad_data + enc_done->pad_bytes, enc_done->comp_bytes); - g_file_close(ii); - } x = enc_done->enc->crects[enc_done->index * 4 + 0]; y = enc_done->enc->crects[enc_done->index * 4 + 1]; cx = enc_done->enc->crects[enc_done->index * 4 + 2]; cy = enc_done->enc->crects[enc_done->index * 4 + 3]; + +#if DUMP_JPEG + xrdp_mm_dump_jpeg(self, enc_done); +#endif + libxrdp_fastpath_send_surface(self->wm->session, enc_done->comp_pad_data, enc_done->pad_bytes, -- cgit v1.2.1