summaryrefslogtreecommitdiffstats
path: root/xorg
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2014-04-01 23:04:27 -0700
committerJay Sorg <jay.sorg@gmail.com>2014-04-01 23:04:27 -0700
commit1e631717a0f9f00287fb47060e6795b17af1e2e5 (patch)
treeb3d360c52dce14cfa5e12ba1065df11952074d16 /xorg
parent7e9e343d7c06c3f1300c6b71b58c648df647d724 (diff)
downloadxrdp-proprietary-1e631717a0f9f00287fb47060e6795b17af1e2e5.tar.gz
xrdp-proprietary-1e631717a0f9f00287fb47060e6795b17af1e2e5.zip
xorg: capture change for jpeg mode
Diffstat (limited to 'xorg')
-rw-r--r--xorg/server/module/rdp.h3
-rw-r--r--xorg/server/module/rdpCapture.c38
-rw-r--r--xorg/server/module/rdpClientCon.c7
3 files changed, 48 insertions, 0 deletions
diff --git a/xorg/server/module/rdp.h b/xorg/server/module/rdp.h
index c76b2086..9609aeb4 100644
--- a/xorg/server/module/rdp.h
+++ b/xorg/server/module/rdp.h
@@ -45,6 +45,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
b = (c) & 0xff; \
} while (0)
+/* PIXMAN_a8b8g8r8 */
+#define XRDP_a8b8g8r8 \
+((32 << 24) | (3 << 16) | (8 << 12) | (8 << 8) | (8 << 4) | 8)
/* PIXMAN_a8r8g8b8 */
#define XRDP_a8r8g8b8 \
((32 << 24) | (2 << 16) | (8 << 12) | (8 << 8) | (8 << 4) | 8)
diff --git a/xorg/server/module/rdpCapture.c b/xorg/server/module/rdpCapture.c
index cfeb6323..cf8fc768 100644
--- a/xorg/server/module/rdpCapture.c
+++ b/xorg/server/module/rdpCapture.c
@@ -68,6 +68,7 @@ rdpCapture0(RegionPtr in_reg, RegionPtr out_reg,
int blue;
Bool rv;
unsigned int *s32;
+ unsigned int *d32;
unsigned short *d16;
unsigned char *d8;
@@ -128,6 +129,43 @@ rdpCapture0(RegionPtr in_reg, RegionPtr out_reg,
}
}
}
+ else if ((src_format == XRDP_a8r8g8b8) && (dst_format == XRDP_a8b8g8r8))
+ {
+ src_bytespp = 4;
+ dst_bytespp = 4;
+
+ for (i = 0; i < num_regions; i++)
+ {
+ /* get rect to copy */
+ rect = prects[i];
+
+ /* get rect dimensions */
+ width = rect.x2 - rect.x1;
+ height = rect.y2 - rect.y1;
+
+ /* point to start of each rect in respective memory */
+ src_offset = rect.y1 * src_stride + rect.x1 * src_bytespp;
+ dst_offset = rect.y1 * dst_stride + rect.x1 * dst_bytespp;
+ src_rect = src + src_offset;
+ dst_rect = dst + dst_offset;
+
+ /* copy one line at a time */
+ for (j = 0; j < height; j++)
+ {
+ s32 = (unsigned int *) src_rect;
+ d32 = (unsigned int *) dst_rect;
+ for (k = 0; k < width; k++)
+ {
+ SPLITCOLOR32(red, green, blue, *s32);
+ *d32 = COLOR24(red, green, blue);
+ s32++;
+ d32++;
+ }
+ src_rect += src_stride;
+ dst_rect += dst_stride;
+ }
+ }
+ }
else if ((src_format == XRDP_a8r8g8b8) && (dst_format == XRDP_r5g6b5))
{
src_bytespp = 4;
diff --git a/xorg/server/module/rdpClientCon.c b/xorg/server/module/rdpClientCon.c
index 7f3bcbc8..97012428 100644
--- a/xorg/server/module/rdpClientCon.c
+++ b/xorg/server/module/rdpClientCon.c
@@ -686,6 +686,13 @@ rdpClientConProcessMsgClientInfo(rdpPtr dev, rdpClientCon *clientCon)
i1 = clientCon->client_info.offscreen_cache_entries;
LLOGLN(0, (" offscreen entries %d", i1));
+ if ((clientCon->client_info.mcs_connection_type == 6) && /* LAN */
+ (clientCon->client_info.jpeg_codec_id == 2))
+ {
+ /* jpeg capture needs swap */
+ clientCon->rdp_format = XRDP_a8b8g8r8;
+ }
+
if (clientCon->client_info.offscreen_support_level > 0)
{
if (clientCon->client_info.offscreen_cache_entries > 0)