Skip to content

Commit

Permalink
change capture_code to enum
Browse files Browse the repository at this point in the history
  • Loading branch information
jsorg71 committed May 15, 2024
1 parent db78971 commit 127e858
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
16 changes: 14 additions & 2 deletions common/xrdp_client_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -228,6 +238,8 @@ struct xrdp_client_info

// Can we resize the desktop by using a Deactivation-Reactivation Sequence?
enum client_resize_mode client_resize_mode;

enum xrdp_capture_code capture_code;
};

enum xrdp_encoder_flags
Expand All @@ -247,6 +259,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
10 changes: 5 additions & 5 deletions xrdp/xrdp_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,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;
}
Expand All @@ -151,7 +151,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;
}
Expand All @@ -160,7 +160,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;
}
Expand All @@ -171,7 +171,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->quants = (const char *) g_rfx_quantization_values;
self->num_quants = 2;
Expand All @@ -184,7 +184,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,
Expand Down

0 comments on commit 127e858

Please sign in to comment.