Skip to content

Commit

Permalink
rdpgfx/server: Minor fix: allow configurable codec parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
realjiangms committed Aug 7, 2016
1 parent 26c98e4 commit a15b8ff
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
8 changes: 8 additions & 0 deletions include/freerdp/server/shadow.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,14 @@ struct rdp_shadow_server
BOOL authentication;
int selectedMonitor;
RECTANGLE_16 subRect;

/* Codec settings */
RLGR_MODE rfxMode;
H264_RATECONTROL_MODE h264RateControlMode;
UINT32 h264BitRate;
FLOAT h264FrameRate;
UINT32 h264QP;

char* ipcSocket;
char* ConfigPath;
char* CertificateFile;
Expand Down
9 changes: 6 additions & 3 deletions server/shadow/shadow_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,7 @@ int shadow_encoder_init_rfx(rdpShadowEncoder* encoder)
if (!rfx_context_reset(encoder->rfx, encoder->width, encoder->height))
goto fail;

encoder->rfx->mode = RLGR3;
encoder->rfx->width = encoder->width;
encoder->rfx->height = encoder->height;
encoder->rfx->mode = encoder->server->rfxMode;

rfx_context_set_pixel_format(encoder->rfx, RDP_PIXEL_FORMAT_B8G8R8A8);

Expand Down Expand Up @@ -246,6 +244,11 @@ int shadow_encoder_init_h264(rdpShadowEncoder* encoder)
if (!h264_context_reset(encoder->h264, encoder->width, encoder->height))
goto fail;

encoder->h264->RateControlMode = encoder->server->h264RateControlMode;
encoder->h264->BitRate = encoder->server->h264BitRate;
encoder->h264->FrameRate = encoder->server->h264FrameRate;
encoder->h264->QP = encoder->server->h264QP;

encoder->codecs |= FREERDP_CODEC_AVC420;

return 1;
Expand Down
6 changes: 6 additions & 0 deletions server/shadow/shadow_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,12 @@ rdpShadowServer* shadow_server_new()
server->mayView = TRUE;
server->mayInteract = TRUE;

server->rfxMode = RLGR3;
server->h264RateControlMode = H264_RATECONTROL_VBR;
server->h264BitRate = 1000000;
server->h264FrameRate = 30;
server->h264QP = 0;

server->authentication = FALSE;

server->settings = freerdp_settings_new(FREERDP_SETTINGS_SERVER_MODE);
Expand Down

0 comments on commit a15b8ff

Please sign in to comment.