summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2014-03-28 23:55:46 -0700
committerJay Sorg <jay.sorg@gmail.com>2014-03-28 23:55:46 -0700
commitd0c2fd08f6a9df84fa6b78ca4b3966848a0d69d5 (patch)
tree11e747296615574836c3be71a8b60f6a6d81c8ae
parent96e18118088bf84fc08544875d34ae65edd732e8 (diff)
parent9a3679b1c1dc43f411a0963056ee43a2f26c8e27 (diff)
downloadxrdp-proprietary-d0c2fd08f6a9df84fa6b78ca4b3966848a0d69d5.tar.gz
xrdp-proprietary-d0c2fd08f6a9df84fa6b78ca4b3966848a0d69d5.zip
Merge branch 'devel' of github.com:neutrinolabs/xrdp into devel
-rw-r--r--configure.ac2
-rw-r--r--xrdp/xrdp_mm.c72
2 files changed, 61 insertions, 13 deletions
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])
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,