summaryrefslogtreecommitdiffstats
path: root/xrdp/xrdp_mm.c
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2014-07-19 13:25:23 -0700
committerJay Sorg <jay.sorg@gmail.com>2014-07-19 13:25:23 -0700
commit1291d2dbbe463469837afb471e4af58704b2d94a (patch)
treee5fa941dcd12b836e5d97304ff34bf244cbabb18 /xrdp/xrdp_mm.c
parent73578bc612b63e451a9203f7187f77152d069350 (diff)
downloadxrdp-proprietary-1291d2dbbe463469837afb471e4af58704b2d94a.tar.gz
xrdp-proprietary-1291d2dbbe463469837afb471e4af58704b2d94a.zip
work on codec mode
Diffstat (limited to 'xrdp/xrdp_mm.c')
-rw-r--r--xrdp/xrdp_mm.c48
1 files changed, 36 insertions, 12 deletions
diff --git a/xrdp/xrdp_mm.c b/xrdp/xrdp_mm.c
index 80383f2f..2bdd821d 100644
--- a/xrdp/xrdp_mm.c
+++ b/xrdp/xrdp_mm.c
@@ -55,7 +55,13 @@ xrdp_mm_create(struct xrdp_wm *owner)
self->login_values = list_create();
self->login_values->auto_free = 1;
- LLOGLN(10, ("xrdp_mm_create: bpp %d", self->wm->client_info->bpp));
+ LLOGLN(0, ("xrdp_mm_create: bpp %d mcs_connection_type %d "
+ "jpeg_codec_id %d v3_codec_id %d rfx_codec_id %d",
+ self->wm->client_info->bpp,
+ self->wm->client_info->mcs_connection_type,
+ self->wm->client_info->jpeg_codec_id,
+ self->wm->client_info->v3_codec_id,
+ self->wm->client_info->rfx_codec_id));
/* go into jpeg codec mode if jpeg set, lan set */
if (self->wm->client_info->mcs_connection_type == 6) /* LAN */
{
@@ -67,6 +73,20 @@ xrdp_mm_create(struct xrdp_wm *owner)
self->codec_id = 2;
self->in_codec_mode = 1;
self->codec_quality = self->wm->client_info->jpeg_prop[0];
+ self->wm->client_info->capture_code = 0;
+ self->wm->client_info->capture_format =
+ /* PIXMAN_a8b8g8r8 */
+ (32 << 24) | (3 << 16) | (8 << 12) | (8 << 8) | (8 << 4) | 8;
+ }
+ }
+ else if (self->wm->client_info->rfx_codec_id == 3) /* RFX */
+ {
+ if (self->wm->client_info->bpp > 16)
+ {
+ LLOGLN(0, ("xrdp_mm_create: starting rfx codec session"));
+ self->codec_id = 3;
+ self->in_codec_mode = 1;
+ self->wm->client_info->capture_code = 2;
}
}
}
@@ -2067,27 +2087,31 @@ xrdp_mm_check_wait_objs(struct xrdp_mm *self)
LLOGLN(10, ("xrdp_mm_check_wait_objs: message back bytes %d",
enc_done->comp_bytes));
- 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];
+ x = enc_done->x;
+ y = enc_done->y;
+ cx = enc_done->cx;
+ cy = enc_done->cy;
#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,
- enc_done->comp_bytes,
- x, y, x + cx, y + cy,
- 32, 2, cx, cy);
+ if (enc_done->comp_bytes > 0)
+ {
+ libxrdp_fastpath_send_surface(self->wm->session,
+ enc_done->comp_pad_data,
+ enc_done->pad_bytes,
+ enc_done->comp_bytes,
+ x, y, x + cx, y + cy,
+ 32, self->codec_id, cx, cy);
+ }
/* free enc_done */
if (enc_done->last)
{
LLOGLN(10, ("xrdp_mm_check_wait_objs: last set"));
- self->mod->mod_frame_ack(self->mod, enc_done->enc->flags, enc_done->enc->frame_id);
+ self->mod->mod_frame_ack(self->mod,
+ enc_done->enc->flags, enc_done->enc->frame_id);
g_free(enc_done->enc->drects);
g_free(enc_done->enc->crects);
g_free(enc_done->enc);