diff --git a/include/freerdp/settings.h b/include/freerdp/settings.h index 7dc009128..f015e8183 100644 --- a/include/freerdp/settings.h +++ b/include/freerdp/settings.h @@ -289,6 +289,7 @@ struct rdp_settings boolean ns_codec; uint32 rfx_codec_id; uint32 ns_codec_id; + uint8 rfx_codec_mode; boolean frame_acknowledge; /* Recording */ diff --git a/libfreerdp-core/capabilities.c b/libfreerdp-core/capabilities.c index 08d61a91f..a7c54cb95 100644 --- a/libfreerdp-core/capabilities.c +++ b/libfreerdp-core/capabilities.c @@ -1420,8 +1420,10 @@ void rdp_read_bitmap_codecs_capability_set(STREAM* s, uint16 length, rdpSettings void rdp_write_rfx_client_capability_container(STREAM* s, rdpSettings* settings) { uint16 captureFlags; + uint8 codecMode; captureFlags = settings->dump_rfx ? 0 : CARDP_CAPS_CAPTURE_NON_CAC; + codecMode = settings->rfx_codec_mode; stream_write_uint16(s, 49); /* codecPropertiesLength */ @@ -1446,7 +1448,7 @@ void rdp_write_rfx_client_capability_container(STREAM* s, rdpSettings* settings) /* TS_RFX_ICAP (RLGR1) */ stream_write_uint16(s, CLW_VERSION_1_0); /* version */ stream_write_uint16(s, CT_TILE_64x64); /* tileSize */ - stream_write_uint8(s, 0); /* flags */ + stream_write_uint8(s, codecMode); /* flags */ stream_write_uint8(s, CLW_COL_CONV_ICT); /* colConvBits */ stream_write_uint8(s, CLW_XFORM_DWT_53_A); /* transformBits */ stream_write_uint8(s, CLW_ENTROPY_RLGR1); /* entropyBits */ @@ -1454,7 +1456,7 @@ void rdp_write_rfx_client_capability_container(STREAM* s, rdpSettings* settings) /* TS_RFX_ICAP (RLGR3) */ stream_write_uint16(s, CLW_VERSION_1_0); /* version */ stream_write_uint16(s, CT_TILE_64x64); /* tileSize */ - stream_write_uint8(s, 0); /* flags */ + stream_write_uint8(s, codecMode); /* flags */ stream_write_uint8(s, CLW_COL_CONV_ICT); /* colConvBits */ stream_write_uint8(s, CLW_XFORM_DWT_53_A); /* transformBits */ stream_write_uint8(s, CLW_ENTROPY_RLGR3); /* entropyBits */ diff --git a/libfreerdp-utils/args.c b/libfreerdp-utils/args.c index 22d834214..47ebd4571 100644 --- a/libfreerdp-utils/args.c +++ b/libfreerdp-utils/args.c @@ -85,6 +85,7 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv, " --no-bmp-cache: disable bitmap cache\n" " --plugin: load a virtual channel plugin\n" " --rfx: enable RemoteFX\n" + " --rfx-mode: RemoteFX operational flags (v[ideo], i[mage]), default is video\n" " --nsc: enable NSCodec\n" " --no-rdp: disable Standard RDP encryption\n" " --no-tls: disable TLS encryption\n" @@ -311,6 +312,28 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv, settings->performance_flags = PERF_FLAG_NONE; settings->large_pointer = true; } + else if (strcmp("--rfx-mode", argv[index]) == 0) + { + index++; + if (index == argc) + { + printf("missing RemoteFX mode flag\n"); + return -1; + } + if (argv[index][0] == 'v') /* video */ + { + settings->rfx_codec_mode = 0x00; + } + else if (argv[index][0] == 'i') /* image */ + { + settings->rfx_codec_mode = 0x02; + } + else + { + printf("unknown RemoteFX mode flag\n"); + return -1; + } + } else if (strcmp("--nsc", argv[index]) == 0) { settings->ns_codec = true;