xorg: capture change for jpeg mode

ulab-next
Jay Sorg 11 years ago
parent 7e9e343d7c
commit 1e631717a0

@ -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)

@ -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;

@ -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)

Loading…
Cancel
Save