change capture_code to enum

(cherry picked from commit 112a534f4c)
This commit is contained in:
Jay Sorg 2024-05-14 23:10:53 -07:00 committed by Koichiro Iwao
parent 3a2e0eb8cd
commit 3c7b416375
2 changed files with 20 additions and 7 deletions

View File

@ -74,6 +74,16 @@ enum client_resize_mode
CRMODE_MULTI_SCREEN
};
enum xrdp_capture_code
{
CC_SIMPLE = 0,
CC_SUF_A16 = 1,
CC_SUF_RFX = 2,
CC_SUF_A2 = 3,
CC_GFX_PRO = 4,
CC_GFX_A2 = 5
};
/**
* Information about the xrdp client
*
@ -170,7 +180,7 @@ struct xrdp_client_info
int mcs_early_capability_flags;
int max_fastpath_frag_bytes;
int capture_code;
int old_capture_code;
int capture_format;
char certificate[1024];
@ -228,6 +238,9 @@ struct xrdp_client_info
// Can we resize the desktop by using a Deactivation-Reactivation Sequence?
enum client_resize_mode client_resize_mode;
int pad1; /* unused; unicode_input_state */
enum xrdp_capture_code capture_code;
};
enum xrdp_encoder_flags
@ -247,6 +260,6 @@ enum xrdp_encoder_flags
/* yyyymmdd of last incompatible change to xrdp_client_info */
/* also used for changes to all the xrdp installed headers */
#define CLIENT_INFO_CURRENT_VERSION 20230425
#define CLIENT_INFO_CURRENT_VERSION 20240514
#endif

View File

@ -167,7 +167,7 @@ xrdp_encoder_create(struct xrdp_mm *mm)
self->codec_id = client_info->jpeg_codec_id;
self->in_codec_mode = 1;
self->codec_quality = client_info->jpeg_prop[0];
client_info->capture_code = 0;
client_info->capture_code = CC_SIMPLE;
client_info->capture_format = XRDP_a8b8g8r8;
self->process_enc = process_enc_jpg;
}
@ -177,7 +177,7 @@ xrdp_encoder_create(struct xrdp_mm *mm)
LOG(LOG_LEVEL_INFO,
"xrdp_encoder_create: starting h264 codec session gfx");
self->in_codec_mode = 1;
client_info->capture_code = 5;
client_info->capture_code = CC_GFX_A2;
client_info->capture_format = XRDP_nv12_709fr;
self->gfx = 1;
}
@ -186,7 +186,7 @@ xrdp_encoder_create(struct xrdp_mm *mm)
LOG(LOG_LEVEL_INFO, "xrdp_encoder_create: starting h264 codec session");
self->codec_id = client_info->h264_codec_id;
self->in_codec_mode = 1;
client_info->capture_code = 3;
client_info->capture_code = CC_SUF_A2;
client_info->capture_format = XRDP_nv12;
self->process_enc = process_enc_h264;
}
@ -197,7 +197,7 @@ xrdp_encoder_create(struct xrdp_mm *mm)
LOG(LOG_LEVEL_INFO,
"xrdp_encoder_create: starting gfx rfx pro codec session");
self->in_codec_mode = 1;
client_info->capture_code = 4;
client_info->capture_code = CC_GFX_PRO;
self->gfx = 1;
self->num_quants = 2;
self->quant_idx_y = 0;
@ -227,7 +227,7 @@ xrdp_encoder_create(struct xrdp_mm *mm)
LOG(LOG_LEVEL_INFO, "xrdp_encoder_create: starting rfx codec session");
self->codec_id = client_info->rfx_codec_id;
self->in_codec_mode = 1;
client_info->capture_code = 2;
client_info->capture_code = CC_SUF_RFX;
self->process_enc = process_enc_rfx;
self->codec_handle_rfx = rfxcodec_encode_create(mm->wm->screen->width,
mm->wm->screen->height,