diff --git a/channels/drdynvc/client/drdynvc_main.c b/channels/drdynvc/client/drdynvc_main.c index 05146f044..3cfda4d53 100644 --- a/channels/drdynvc/client/drdynvc_main.c +++ b/channels/drdynvc/client/drdynvc_main.c @@ -398,7 +398,7 @@ static void drdynvc_process_connect(rdpSvcPlugin* plugin) for (index = 0; index < settings->DynamicChannelCount; index++) { args = settings->DynamicChannelArray[index]; - dvcman_load_addin(drdynvc->channel_mgr, args); + dvcman_load_addin(drdynvc->channel_mgr, args, settings); } dvcman_init(drdynvc->channel_mgr); diff --git a/channels/drdynvc/client/dvcman.c b/channels/drdynvc/client/dvcman.c index a29e5509e..9a6d80537 100644 --- a/channels/drdynvc/client/dvcman.c +++ b/channels/drdynvc/client/dvcman.c @@ -135,6 +135,11 @@ ADDIN_ARGV* dvcman_get_plugin_data(IDRDYNVC_ENTRY_POINTS* pEntryPoints) return ((DVCMAN_ENTRY_POINTS*) pEntryPoints)->args; } +void* dvcman_get_rdp_settings(IDRDYNVC_ENTRY_POINTS* pEntryPoints) +{ + return (void*) ((DVCMAN_ENTRY_POINTS*) pEntryPoints)->settings; +} + UINT32 dvcman_get_channel_id(IWTSVirtualChannel * channel) { return ((DVCMAN_CHANNEL*) channel)->channel_id; @@ -208,7 +213,7 @@ IWTSVirtualChannelManager* dvcman_new(drdynvcPlugin* plugin) return (IWTSVirtualChannelManager*) dvcman; } -int dvcman_load_addin(IWTSVirtualChannelManager* pChannelMgr, ADDIN_ARGV* args) +int dvcman_load_addin(IWTSVirtualChannelManager* pChannelMgr, ADDIN_ARGV* args, rdpSettings* settings) { DVCMAN_ENTRY_POINTS entryPoints; PDVC_PLUGIN_ENTRY pDVCPluginEntry = NULL; @@ -223,8 +228,10 @@ int dvcman_load_addin(IWTSVirtualChannelManager* pChannelMgr, ADDIN_ARGV* args) entryPoints.iface.RegisterPlugin = dvcman_register_plugin; entryPoints.iface.GetPlugin = dvcman_get_plugin; entryPoints.iface.GetPluginData = dvcman_get_plugin_data; + entryPoints.iface.GetRdpSettings = dvcman_get_rdp_settings; entryPoints.dvcman = (DVCMAN*) pChannelMgr; entryPoints.args = args; + entryPoints.settings = settings; pDVCPluginEntry((IDRDYNVC_ENTRY_POINTS*) &entryPoints); } diff --git a/channels/drdynvc/client/dvcman.h b/channels/drdynvc/client/dvcman.h index 3b627eae4..04781deab 100644 --- a/channels/drdynvc/client/dvcman.h +++ b/channels/drdynvc/client/dvcman.h @@ -22,6 +22,7 @@ #include #include +#include #include #include @@ -65,6 +66,7 @@ struct _DVCMAN_ENTRY_POINTS DVCMAN* dvcman; ADDIN_ARGV* args; + rdpSettings* settings; }; typedef struct _DVCMAN_ENTRY_POINTS DVCMAN_ENTRY_POINTS; @@ -85,7 +87,7 @@ struct _DVCMAN_CHANNEL typedef struct _DVCMAN_CHANNEL DVCMAN_CHANNEL; IWTSVirtualChannelManager* dvcman_new(drdynvcPlugin* plugin); -int dvcman_load_addin(IWTSVirtualChannelManager* pChannelMgr, ADDIN_ARGV* args); +int dvcman_load_addin(IWTSVirtualChannelManager* pChannelMgr, ADDIN_ARGV* args, rdpSettings* settings); void dvcman_free(IWTSVirtualChannelManager* pChannelMgr); int dvcman_init(IWTSVirtualChannelManager* pChannelMgr); int dvcman_create_channel(IWTSVirtualChannelManager* pChannelMgr, UINT32 ChannelId, const char* ChannelName); diff --git a/channels/rdpgfx/client/rdpgfx_main.c b/channels/rdpgfx/client/rdpgfx_main.c index d53dea1d9..f50010f93 100644 --- a/channels/rdpgfx/client/rdpgfx_main.c +++ b/channels/rdpgfx/client/rdpgfx_main.c @@ -56,25 +56,13 @@ int rdpgfx_send_caps_advertise_pdu(RDPGFX_CHANNEL_CALLBACK* callback) gfx = (RDPGFX_PLUGIN*) callback->plugin; - gfx->ThinClient = TRUE; - gfx->SmallCache = FALSE; - -#ifdef WITH_OPENH264 - gfx->H264 = TRUE; -#else - gfx->H264 = FALSE; -#endif - - gfx->MaxCacheSlot = (gfx->ThinClient) ? 4096 : 25600; - header.flags = 0; header.cmdId = RDPGFX_CMDID_CAPSADVERTISE; - pdu.capsSetCount = 2; + pdu.capsSetCount = 0; pdu.capsSets = (RDPGFX_CAPSET*) capsSets; - capsSet = &capsSets[0]; - + capsSet = &capsSets[pdu.capsSetCount++]; capsSet->version = RDPGFX_CAPVERSION_8; capsSet->flags = 0; @@ -84,8 +72,7 @@ int rdpgfx_send_caps_advertise_pdu(RDPGFX_CHANNEL_CALLBACK* callback) if (gfx->SmallCache) capsSet->flags |= RDPGFX_CAPS_FLAG_SMALL_CACHE; - capsSet = &capsSets[1]; - + capsSet = &capsSets[pdu.capsSetCount++]; capsSet->version = RDPGFX_CAPVERSION_81; capsSet->flags = 0; @@ -1066,6 +1053,7 @@ int DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) return -1; gfx->log = WLog_Get("com.freerdp.gfx.client"); + gfx->settings = (rdpSettings*) pEntryPoints->GetRdpSettings(pEntryPoints); gfx->iface.Initialize = rdpgfx_plugin_initialize; gfx->iface.Connected = NULL; @@ -1077,7 +1065,18 @@ int DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) if (!gfx->SurfaceTable) return -1; - gfx->ThinClient = TRUE; + gfx->ThinClient = gfx->settings->GfxThinClient; + gfx->SmallCache = gfx->settings->GfxSmallCache; + gfx->Progressive = gfx->settings->GfxProgressive; + gfx->ProgressiveV2 = gfx->settings->GfxProgressiveV2; + gfx->H264 = gfx->settings->GfxH264; + + if (gfx->H264) + gfx->SmallCache = TRUE; + + if (gfx->SmallCache) + gfx->ThinClient = FALSE; + gfx->MaxCacheSlot = (gfx->ThinClient) ? 4096 : 25600; context = (RdpgfxClientContext*) calloc(1, sizeof(RdpgfxClientContext)); diff --git a/channels/rdpgfx/client/rdpgfx_main.h b/channels/rdpgfx/client/rdpgfx_main.h index e1dc362ea..db897c93e 100644 --- a/channels/rdpgfx/client/rdpgfx_main.h +++ b/channels/rdpgfx/client/rdpgfx_main.h @@ -59,9 +59,12 @@ struct _RDPGFX_PLUGIN RDPGFX_LISTENER_CALLBACK* listener_callback; wLog* log; + rdpSettings* settings; BOOL ThinClient; BOOL SmallCache; + BOOL Progressive; + BOOL ProgressiveV2; BOOL H264; ZGFX_CONTEXT* zgfx; diff --git a/client/common/cmdline.c b/client/common/cmdline.c index 4d311366e..481170ff2 100644 --- a/client/common/cmdline.c +++ b/client/common/cmdline.c @@ -111,6 +111,11 @@ COMMAND_LINE_ARGUMENT_A args[] = { "wallpaper", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, "Wallpaper" }, { "gdi", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "GDI rendering" }, { "gfx", COMMAND_LINE_VALUE_OPTIONAL, NULL, NULL, NULL, -1, NULL, "RDP8 graphics pipeline (experimental)" }, + { "gfx-thin-client", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "RDP8 graphics pipeline thin client mode" }, + { "gfx-small-cache", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "RDP8 graphics pipeline small cache mode" }, + { "gfx-progressive", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "RDP8 graphics pipeline progressive codec" }, + { "gfx-progressive-v2", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "RDP8.1 graphics pipeline progressive v2 codec" }, + { "gfx-h264", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "RDP8.1 graphics pipeline H264 codec" }, { "rfx", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "RemoteFX" }, { "rfx-mode", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "RemoteFX mode" }, { "frame-ack", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, NULL, "Frame acknowledgement" }, @@ -1621,10 +1626,31 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, CommandLineSwitchCase(arg, "gfx") { settings->SupportGraphicsPipeline = TRUE; - settings->FastPathOutput = TRUE; - settings->ColorDepth = 32; - settings->LargePointerFlag = TRUE; - settings->FrameMarkerCommandEnabled = TRUE; + } + CommandLineSwitchCase(arg, "gfx-thin-client") + { + settings->GfxThinClient = arg->Value ? TRUE : FALSE; + settings->SupportGraphicsPipeline = TRUE; + } + CommandLineSwitchCase(arg, "gfx-small-cache") + { + settings->GfxSmallCache = arg->Value ? TRUE : FALSE; + settings->SupportGraphicsPipeline = TRUE; + } + CommandLineSwitchCase(arg, "gfx-progressive") + { + settings->GfxProgressive = arg->Value ? TRUE : FALSE; + settings->SupportGraphicsPipeline = TRUE; + } + CommandLineSwitchCase(arg, "gfx-progressive-v2") + { + settings->GfxProgressiveV2 = arg->Value ? TRUE : FALSE; + settings->SupportGraphicsPipeline = TRUE; + } + CommandLineSwitchCase(arg, "gfx-h264") + { + settings->GfxH264 = arg->Value ? TRUE : FALSE; + settings->SupportGraphicsPipeline = TRUE; } CommandLineSwitchCase(arg, "rfx") { @@ -1887,6 +1913,14 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, } } + if (settings->SupportGraphicsPipeline) + { + settings->FastPathOutput = TRUE; + settings->ColorDepth = 32; + settings->LargePointerFlag = TRUE; + settings->FrameMarkerCommandEnabled = TRUE; + } + arg = CommandLineFindArgumentA(args, "port"); if (arg->Flags & COMMAND_LINE_ARGUMENT_PRESENT) diff --git a/include/freerdp/dvc.h b/include/freerdp/dvc.h index ce5977541..673ab50a8 100644 --- a/include/freerdp/dvc.h +++ b/include/freerdp/dvc.h @@ -152,7 +152,8 @@ struct _IDRDYNVC_ENTRY_POINTS const char *name, IWTSPlugin *pPlugin); IWTSPlugin *(*GetPlugin)(IDRDYNVC_ENTRY_POINTS *pEntryPoints, const char *name); - ADDIN_ARGV *(*GetPluginData)(IDRDYNVC_ENTRY_POINTS *pEntryPoints); + ADDIN_ARGV* (*GetPluginData)(IDRDYNVC_ENTRY_POINTS* pEntryPoints); + void* (*GetRdpSettings)(IDRDYNVC_ENTRY_POINTS* pEntryPoints); }; typedef int (*PDVC_PLUGIN_ENTRY)(IDRDYNVC_ENTRY_POINTS *); diff --git a/include/freerdp/settings.h b/include/freerdp/settings.h index 07fc0d354..5ad53f5e5 100644 --- a/include/freerdp/settings.h +++ b/include/freerdp/settings.h @@ -753,6 +753,11 @@ typedef struct _RDPDR_PARALLEL RDPDR_PARALLEL; #define FreeRDP_JpegCodec 3776 #define FreeRDP_JpegCodecId 3777 #define FreeRDP_JpegQuality 3778 +#define FreeRDP_GfxThinClient 3840 +#define FreeRDP_GfxSmallCache 3841 +#define FreeRDP_GfxProgressive 3842 +#define FreeRDP_GfxProgressiveV2 3843 +#define FreeRDP_GfxH264 3844 #define FreeRDP_BitmapCacheV3CodecId 3904 #define FreeRDP_DrawNineGridEnabled 3968 #define FreeRDP_DrawNineGridCacheSize 3969 @@ -1261,7 +1266,13 @@ struct rdp_settings ALIGN64 UINT32 JpegCodecId; /* 3777 */ ALIGN64 UINT32 JpegQuality; /* 3778 */ UINT64 padding3840[3840 - 3779]; /* 3779 */ - UINT64 padding3904[3904 - 3840]; /* 3840 */ + + ALIGN64 BOOL GfxThinClient; /* 3840 */ + ALIGN64 BOOL GfxSmallCache; /* 3841 */ + ALIGN64 BOOL GfxProgressive; /* 3842 */ + ALIGN64 BOOL GfxProgressiveV2; /* 3843 */ + ALIGN64 BOOL GfxH264; /* 3844 */ + UINT64 padding3904[3904 - 3845]; /* 3845 */ /** * Caches diff --git a/libfreerdp/common/settings.c b/libfreerdp/common/settings.c index 97df29b15..607be8847 100644 --- a/libfreerdp/common/settings.c +++ b/libfreerdp/common/settings.c @@ -1077,6 +1077,26 @@ BOOL freerdp_get_param_bool(rdpSettings* settings, int id) return settings->JpegCodec; break; + case FreeRDP_GfxThinClient: + return settings->GfxThinClient; + break; + + case FreeRDP_GfxSmallCache: + return settings->GfxSmallCache; + break; + + case FreeRDP_GfxProgressive: + return settings->GfxProgressive; + break; + + case FreeRDP_GfxProgressiveV2: + return settings->GfxProgressiveV2; + break; + + case FreeRDP_GfxH264: + return settings->GfxH264; + break; + case FreeRDP_DrawNineGridEnabled: return settings->DrawNineGridEnabled; break; @@ -1566,6 +1586,26 @@ int freerdp_set_param_bool(rdpSettings* settings, int id, BOOL param) settings->JpegCodec = param; break; + case FreeRDP_GfxThinClient: + settings->GfxThinClient = param; + break; + + case FreeRDP_GfxSmallCache: + settings->GfxSmallCache = param; + break; + + case FreeRDP_GfxProgressive: + settings->GfxProgressive = param; + break; + + case FreeRDP_GfxProgressiveV2: + settings->GfxProgressiveV2 = param; + break; + + case FreeRDP_GfxH264: + settings->GfxH264 = param; + break; + case FreeRDP_DrawNineGridEnabled: settings->DrawNineGridEnabled = param; break; diff --git a/libfreerdp/core/settings.c b/libfreerdp/core/settings.c index fc40a0633..04f92caa9 100644 --- a/libfreerdp/core/settings.c +++ b/libfreerdp/core/settings.c @@ -401,6 +401,12 @@ rdpSettings* freerdp_settings_new(DWORD flags) settings->AutoReconnectionEnabled = FALSE; settings->AutoReconnectMaxRetries = 20; + settings->GfxThinClient = TRUE; + settings->GfxSmallCache = FALSE; + settings->GfxProgressive = FALSE; + settings->GfxProgressiveV2 = FALSE; + settings->GfxH264 = FALSE; + settings->ClientAutoReconnectCookie = (ARC_CS_PRIVATE_PACKET*) malloc(sizeof(ARC_CS_PRIVATE_PACKET)); settings->ServerAutoReconnectCookie = (ARC_SC_PRIVATE_PACKET*) malloc(sizeof(ARC_SC_PRIVATE_PACKET)); ZeroMemory(settings->ClientAutoReconnectCookie, sizeof(ARC_CS_PRIVATE_PACKET)); @@ -697,6 +703,11 @@ rdpSettings* freerdp_settings_clone(rdpSettings* settings) _settings->RemoteFxImageCodec = settings->RemoteFxImageCodec; /* 3652 */ _settings->NSCodec = settings->NSCodec; /* 3712 */ _settings->JpegCodec = settings->JpegCodec; /* 3776 */ + _settings->GfxThinClient = settings->GfxThinClient; /* 3840 */ + _settings->GfxSmallCache = settings->GfxSmallCache; /* 3841 */ + _settings->GfxProgressive = settings->GfxProgressive; /* 3842 */ + _settings->GfxProgressiveV2 = settings->GfxProgressiveV2; /* 3843 */ + _settings->GfxH264 = settings->GfxH264; /* 3844 */ _settings->DrawNineGridEnabled = settings->DrawNineGridEnabled; /* 3968 */ _settings->DrawGdiPlusEnabled = settings->DrawGdiPlusEnabled; /* 4032 */ _settings->DrawGdiPlusCacheEnabled = settings->DrawGdiPlusCacheEnabled; /* 4033 */