|
|
@ -52,15 +52,22 @@ struct xrdp_encoder *APP_CC
|
|
|
|
xrdp_encoder_create(struct xrdp_mm *mm)
|
|
|
|
xrdp_encoder_create(struct xrdp_mm *mm)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct xrdp_encoder *self;
|
|
|
|
struct xrdp_encoder *self;
|
|
|
|
|
|
|
|
struct xrdp_client_info *client_info;
|
|
|
|
char buf[1024];
|
|
|
|
char buf[1024];
|
|
|
|
int pid;
|
|
|
|
int pid;
|
|
|
|
|
|
|
|
|
|
|
|
if (mm->wm->client_info->mcs_connection_type != 6) /* LAN */
|
|
|
|
client_info = mm->wm->client_info;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (client_info->client_os_major != OSMAJORTYPE_UNIX)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
/* temp workaround to avoid black screen in non-supported clients */
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (client_info->mcs_connection_type != 6) /* LAN */
|
|
|
|
if (mm->wm->client_info->bpp < 24)
|
|
|
|
{
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (client_info->bpp < 24)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -68,24 +75,24 @@ xrdp_encoder_create(struct xrdp_mm *mm)
|
|
|
|
self = (struct xrdp_encoder *)g_malloc(sizeof(struct xrdp_encoder), 1);
|
|
|
|
self = (struct xrdp_encoder *)g_malloc(sizeof(struct xrdp_encoder), 1);
|
|
|
|
self->mm = mm;
|
|
|
|
self->mm = mm;
|
|
|
|
|
|
|
|
|
|
|
|
if (mm->wm->client_info->jpeg_codec_id != 0)
|
|
|
|
if (client_info->jpeg_codec_id != 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
LLOGLN(0, ("xrdp_encoder_create: starting jpeg codec session"));
|
|
|
|
LLOGLN(0, ("xrdp_encoder_create: starting jpeg codec session"));
|
|
|
|
self->codec_id = mm->wm->client_info->jpeg_codec_id;
|
|
|
|
self->codec_id = client_info->jpeg_codec_id;
|
|
|
|
self->in_codec_mode = 1;
|
|
|
|
self->in_codec_mode = 1;
|
|
|
|
self->codec_quality = mm->wm->client_info->jpeg_prop[0];
|
|
|
|
self->codec_quality = client_info->jpeg_prop[0];
|
|
|
|
mm->wm->client_info->capture_code = 0;
|
|
|
|
client_info->capture_code = 0;
|
|
|
|
mm->wm->client_info->capture_format =
|
|
|
|
client_info->capture_format =
|
|
|
|
/* XRDP_a8b8g8r8 */
|
|
|
|
/* XRDP_a8b8g8r8 */
|
|
|
|
(32 << 24) | (3 << 16) | (8 << 12) | (8 << 8) | (8 << 4) | 8;
|
|
|
|
(32 << 24) | (3 << 16) | (8 << 12) | (8 << 8) | (8 << 4) | 8;
|
|
|
|
self->process_enc = process_enc_jpg;
|
|
|
|
self->process_enc = process_enc_jpg;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (mm->wm->client_info->rfx_codec_id != 0)
|
|
|
|
else if (client_info->rfx_codec_id != 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
LLOGLN(0, ("xrdp_encoder_create: starting rfx codec session"));
|
|
|
|
LLOGLN(0, ("xrdp_encoder_create: starting rfx codec session"));
|
|
|
|
self->codec_id = mm->wm->client_info->rfx_codec_id;
|
|
|
|
self->codec_id = client_info->rfx_codec_id;
|
|
|
|
self->in_codec_mode = 1;
|
|
|
|
self->in_codec_mode = 1;
|
|
|
|
mm->wm->client_info->capture_code = 2;
|
|
|
|
client_info->capture_code = 2;
|
|
|
|
self->process_enc = process_enc_rfx;
|
|
|
|
self->process_enc = process_enc_rfx;
|
|
|
|
#ifdef XRDP_RFXCODEC
|
|
|
|
#ifdef XRDP_RFXCODEC
|
|
|
|
self->codec_handle =
|
|
|
|
self->codec_handle =
|
|
|
@ -94,13 +101,13 @@ xrdp_encoder_create(struct xrdp_mm *mm)
|
|
|
|
RFX_FORMAT_YUV, 0);
|
|
|
|
RFX_FORMAT_YUV, 0);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (mm->wm->client_info->h264_codec_id != 0)
|
|
|
|
else if (client_info->h264_codec_id != 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
LLOGLN(0, ("xrdp_encoder_create: starting h264 codec session"));
|
|
|
|
LLOGLN(0, ("xrdp_encoder_create: starting h264 codec session"));
|
|
|
|
self->codec_id = mm->wm->client_info->h264_codec_id;
|
|
|
|
self->codec_id = client_info->h264_codec_id;
|
|
|
|
self->in_codec_mode = 1;
|
|
|
|
self->in_codec_mode = 1;
|
|
|
|
mm->wm->client_info->capture_code = 3;
|
|
|
|
client_info->capture_code = 3;
|
|
|
|
mm->wm->client_info->capture_format =
|
|
|
|
client_info->capture_format =
|
|
|
|
/* XRDP_nv12 */
|
|
|
|
/* XRDP_nv12 */
|
|
|
|
(12 << 24) | (64 << 16) | (0 << 12) | (0 << 8) | (0 << 4) | 0;
|
|
|
|
(12 << 24) | (64 << 16) | (0 << 12) | (0 << 8) | (0 << 4) | 0;
|
|
|
|
self->process_enc = process_enc_h264;
|
|
|
|
self->process_enc = process_enc_h264;
|
|
|
|