summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspeidy <speidy@gmail.com>2016-12-02 06:55:53 -0500
committerspeidy <speidy@gmail.com>2016-12-08 20:12:00 -0500
commit8a0fec5e66e88926d2d1b57cc74a70119e23147c (patch)
tree39be0d554b019bd2a39516508b8d460fbd36210e
parent731d4be6700beffa7f9710e96285707cec27a535 (diff)
downloadxrdp-proprietary-8a0fec5e66e88926d2d1b57cc74a70119e23147c.tar.gz
xrdp-proprietary-8a0fec5e66e88926d2d1b57cc74a70119e23147c.zip
o send RFX tiles as stream (Stream Surface Bits Command)
o silent frame ack logging o support surface commands in capsets o fix some wrong constants
-rw-r--r--common/xrdp_constants.h20
-rw-r--r--libxrdp/libxrdp.c6
-rw-r--r--libxrdp/xrdp_caps.c47
-rw-r--r--xrdp/xrdp_mm.c2
4 files changed, 57 insertions, 18 deletions
diff --git a/common/xrdp_constants.h b/common/xrdp_constants.h
index 7dcb3064..d5f7a8a8 100644
--- a/common/xrdp_constants.h
+++ b/common/xrdp_constants.h
@@ -538,9 +538,9 @@
#define COMPDESK_NOT_SUPPORTED 0x0000
#define COMPDESK_SUPPORTED 0x0001
-#define SURCMDS_SETSURFACEBITS 0x00000002
-#define SURCMDS_FRAMEMARKER 0x00000010
-#define SURCMDS_STREAMSUFRACEBITS 0x00000040
+#define SURFCMDS_SETSURFACEBITS 0x00000002
+#define SURFCMDS_FRAMEMARKER 0x00000010
+#define SURFCMDS_STREAMSUFRACEBITS 0x00000040
/* CODEC_GUID_NSCODEC CA8D1BB9-000F-154F-589FAE2D1A87E2D6 */
#define XR_CODEC_GUID_NSCODEC \
@@ -550,6 +550,10 @@
#define XR_CODEC_GUID_REMOTEFX \
"\x12\x2F\x77\x76\x72\xBD\x63\x44\xAF\xB3\xB7\x3C\x9C\x6F\x78\x86"
+/* CODEC_GUID_IMAGE_REMOTEFX 2744CCD4-9D8A-4E74-803C-0ECBEEA19C54 */
+#define XR_CODEC_GUID_IMAGE_REMOTEFX \
+ "\xD4\xCC\x44\x27\x8A\x9D\x74\x4E\x80\x3C\x0E\xCB\xEE\xA1\x9C\x54"
+
/* CODEC_GUID_JPEG 1BAF4CE6-9EED-430C-869ACB8B37B66237 */
#define XR_CODEC_GUID_JPEG \
"\xE6\x4C\xAF\x1B\xED\x9E\x0C\x43\x86\x9A\xCB\x8B\x37\xB6\x62\x37"
@@ -562,13 +566,13 @@
#define XR_CODEC_GUID_H264 \
"\x48\x32\x36\x34\x00\x00\x10\x00\x80\x00\x00\xAA\x00\x38\x9B\x71"
-#define RDP_CAPSET_SURFCMDS 0x1c
-#define RDP_CAPLEN_SURFCMDS 0x0c
-#define RDP_CAPSET_BMPCODECS 0x1d
-#define RDP_CAPLEN_BMPCODECS 0x1c
+#define RDP_CAPSET_SURFCMDS 0x1C
+#define RDP_CAPLEN_SURFCMDS 0x0C
+#define RDP_CAPSET_BMPCODECS 0x1D
+#define RDP_CAPLEN_BMPCODECS 0x1C
#define RDP_CAPSET_COMPDESK 0x19
#define RDP_CAPLEN_COMPDESK 0x06
-#define RDP_CAPSET_LPOINTER 0x27
+#define RDP_CAPSET_LPOINTER 0x1B
#define RDP_CAPLEN_LPOINTER 0x06
/* fastpath input */
diff --git a/libxrdp/libxrdp.c b/libxrdp/libxrdp.c
index c3763bf5..a9375ba6 100644
--- a/libxrdp/libxrdp.c
+++ b/libxrdp/libxrdp.c
@@ -1332,13 +1332,13 @@ libxrdp_fastpath_send_surface(struct xrdp_session *session,
s->rdp_hdr = s->sec_hdr + sec_bytes;
s->end = data_pad + pad_bytes + data_bytes;
s->p = s->data + (rdp_bytes + sec_bytes);
- /* TS_SURFCMD_SET_SURF_BITS */
- out_uint16_le(s, 0x0001); /* CMDTYPE_SET_SURFACE_BITS */
+ /* TS_SURFCMD_STREAM_SURF_BITS */
+ out_uint16_le(s, 0x0006); /* CMDTYPE_STREAM_SURFACE_BITS */
out_uint16_le(s, destLeft);
out_uint16_le(s, destTop);
out_uint16_le(s, destRight);
out_uint16_le(s, destBottom);
- /* TS_ BITMAP_DATA_EX */
+ /* TS_BITMAP_DATA_EX */
out_uint8(s, bpp);
out_uint8(s, 0);
out_uint8(s, 0);
diff --git a/libxrdp/xrdp_caps.c b/libxrdp/xrdp_caps.c
index 8d5250d5..3c5af034 100644
--- a/libxrdp/xrdp_caps.c
+++ b/libxrdp/xrdp_caps.c
@@ -466,7 +466,7 @@ xrdp_caps_process_codecs(struct xrdp_rdp *self, struct stream *s, int len)
}
else if (g_memcmp(codec_guid, XR_CODEC_GUID_REMOTEFX, 16) == 0)
{
- g_writeln("xrdp_caps_process_codecs: rfx codec id %d prop len %d",
+ g_writeln("xrdp_caps_process_codecs: RemoteFX, codec id %d prop len %d",
codec_id, codec_properties_length);
self->client_info.rfx_codec_id = codec_id;
i1 = MIN(64, codec_properties_length);
@@ -534,6 +534,20 @@ xrdp_caps_process_frame_ack(struct xrdp_rdp *self, struct stream *s, int len)
}
/*****************************************************************************/
+static int APP_CC
+xrdp_caps_process_surface_cmds(struct xrdp_rdp *self, struct stream *s, int len)
+{
+ int cmdFlags;
+ g_writeln("xrdp_caps_process_surface_cmds:");
+
+ in_uint32_le(s, cmdFlags);
+ in_uint8s(s, 4); /* reserved */
+
+ g_writeln(" cmdFlags 0x%08x", cmdFlags);
+ return 0;
+}
+
+/*****************************************************************************/
int APP_CC
xrdp_caps_process_confirm_active(struct xrdp_rdp *self, struct stream *s)
{
@@ -659,6 +673,9 @@ xrdp_caps_process_confirm_active(struct xrdp_rdp *self, struct stream *s)
case 0x001E: /* CAPSSETTYPE_FRAME_ACKNOWLEDGE */
xrdp_caps_process_frame_ack(self, s, len);
break;
+ case RDP_CAPSET_SURFCMDS: /* CAPSETTYPE_SURFACE_COMMANDS */
+ xrdp_caps_process_surface_cmds(self, s, len);
+ break;
default:
g_writeln("unknown in xrdp_caps_process_confirm_active %d", type);
break;
@@ -827,7 +844,7 @@ xrdp_caps_send_demand_active(struct xrdp_rdp *self)
codec_caps_count++;
out_uint8a(s, XR_CODEC_GUID_NSCODEC, 16);
out_uint8(s, 1); /* codec id, must be 1 */
- out_uint16_le(s, 3);
+ out_uint16_le(s, 3); /* codecPropertiesLength */
out_uint8(s, 0x01); /* fAllowDynamicFidelity */
out_uint8(s, 0x01); /* fAllowSubsampling */
out_uint8(s, 0x03); /* colorLossLevel */
@@ -835,14 +852,20 @@ xrdp_caps_send_demand_active(struct xrdp_rdp *self)
codec_caps_count++;
out_uint8a(s, XR_CODEC_GUID_REMOTEFX, 16);
out_uint8(s, 0); /* codec id, client sets */
- out_uint16_le(s, 256);
- out_uint8s(s, 256);
+ out_uint16_le(s, 4); /* codecPropertiesLength */
+ out_uint32_le(s, 0); /* reserved */
+ /* image remotefx */
+ codec_caps_count++;
+ out_uint8a(s, XR_CODEC_GUID_IMAGE_REMOTEFX, 16);
+ out_uint8(s, 0); /* codec id, client sets */
+ out_uint16_le(s, 4); /* codecPropertiesLength */
+ out_uint32_le(s, 0); /* reserved */
/* jpeg */
codec_caps_count++;
out_uint8a(s, XR_CODEC_GUID_JPEG, 16);
out_uint8(s, 0); /* codec id, client sets */
- out_uint16_le(s, 1); /* ext length */
- out_uint8(s, 75);
+ out_uint16_le(s, 4); /* codecPropertiesLength */
+ out_uint32_le(s, 0); /* reserved */
/* calculate and set size and count */
codec_caps_size = (int)(s->p - codec_caps_size_ptr);
codec_caps_size += 2; /* 2 bytes for RDP_CAPSET_BMPCODECS above */
@@ -919,6 +942,18 @@ xrdp_caps_send_demand_active(struct xrdp_rdp *self)
out_uint16_le(s, 8);
out_uint32_le(s, 2); /* 2 frames in flight */
+ /* surface commands */
+ if (self->client_info.use_fast_path & 1) /* surface commands requires fastpath output */
+ {
+ caps_count++;
+ out_uint16_le(s, RDP_CAPSET_SURFCMDS); /* CAPSETTYPE_SURFACE_COMMANDS */
+ out_uint16_le(s, RDP_CAPLEN_SURFCMDS); /* lengthCapability */
+ out_uint32_le(s, (SURFCMDS_SETSURFACEBITS |
+ SURFCMDS_FRAMEMARKER |
+ SURFCMDS_STREAMSUFRACEBITS)); /* cmdFlags */
+ out_uint32_le(s, 0); /* reserved */
+ }
+
out_uint8s(s, 4); /* pad */
s_mark_end(s);
diff --git a/xrdp/xrdp_mm.c b/xrdp/xrdp_mm.c
index 715a18fc..07c69327 100644
--- a/xrdp/xrdp_mm.c
+++ b/xrdp/xrdp_mm.c
@@ -2291,7 +2291,7 @@ xrdp_mm_frame_ack(struct xrdp_mm *self, int frame_id)
{
int ex;
- LLOGLN(0, ("xrdp_mm_frame_ack:"));
+ LLOGLN(10, ("xrdp_mm_frame_ack:"));
self->encoder->frame_id_client = frame_id;
if (self->wm->client_info->use_frame_acks == 0)
{