server: proxy: rename SessionCapture.Enabled -> GFXSettings.DecodeGFX

This commit is contained in:
Kobi Mizrachi
2020-06-10 10:39:44 +03:00
committed by akallabeth
parent 564b784ebc
commit 6e1581443b
6 changed files with 30 additions and 64 deletions

View File

@@ -2,10 +2,6 @@
Host = 0.0.0.0
Port = 3389
[SessionCapture]
Enabled = TRUE
CapturesDirectory = "captures"
[Target]
; If this value is set to TRUE, the target server info will be parsed using the
; load balance info setting at runtime. The format is
@@ -43,6 +39,9 @@ RemoteApp = TRUE
TextOnly = FALSE
MaxTextLength = 10 # 0 for no limit.
[GFXSettings]
DecodeGFX = TRUE
[Plugins]
; An optional, comma separated list of paths to modules that the proxy should load at startup.
;

View File

@@ -232,9 +232,10 @@ static BOOL capture_plugin_server_post_connect(proxyData* pdata)
proxyConfig* config = pdata->config;
rdpSettings* settings = ps->context.settings;
if (!config->GFX || !config->SessionCapture)
if (!config->GFX || !config->DecodeGFX)
{
WLog_ERR(TAG, "config options 'GFX' and 'SessionCapture' options must be set to true!");
WLog_ERR(TAG, "config options 'Channels.GFX' and 'GFXSettings.DecodeGFX' options must be "
"set to true!");
return FALSE;
}

View File

@@ -233,33 +233,9 @@ static BOOL pf_config_load_modules(wIniFile* ini, proxyConfig* config)
return TRUE;
}
static BOOL pf_config_load_captures(wIniFile* ini, proxyConfig* config)
static BOOL pf_config_load_gfx_settings(wIniFile* ini, proxyConfig* config)
{
const char* captures_dir;
config->SessionCapture = pf_config_get_bool(ini, "SessionCapture", "Enabled");
if (!config->SessionCapture)
return TRUE;
captures_dir = pf_config_get_str(ini, "SessionCapture", "CapturesDirectory");
if (!captures_dir)
return FALSE;
config->CapturesDirectory = strdup(captures_dir);
if (!config->CapturesDirectory)
return FALSE;
if (!PathFileExistsA(config->CapturesDirectory))
{
if (!CreateDirectoryA(config->CapturesDirectory, NULL))
{
free(config->CapturesDirectory);
config->CapturesDirectory = NULL;
return FALSE;
}
}
config->DecodeGFX = pf_config_get_bool(ini, "GFXSettings", "DecodeGFX");
return TRUE;
}
@@ -303,7 +279,7 @@ proxyConfig* pf_server_config_load(const char* path)
if (!pf_config_load_clipboard(ini, config))
goto out;
if (!pf_config_load_captures(ini, config))
if (!pf_config_load_gfx_settings(ini, config))
goto out;
IniFile_Free(ini);
@@ -330,7 +306,6 @@ void pf_server_config_print(proxyConfig* config)
CONFIG_PRINT_SECTION("Server");
CONFIG_PRINT_STR(config, Host);
CONFIG_PRINT_UINT16(config, Port);
CONFIG_PRINT_BOOL(config, SessionCapture);
if (!config->UseLoadBalanceInfo)
{
@@ -371,9 +346,8 @@ void pf_server_config_print(proxyConfig* config)
if (config->MaxTextLength > 0)
CONFIG_PRINT_UINT32(config, MaxTextLength);
CONFIG_PRINT_SECTION("SessionCapture");
CONFIG_PRINT_BOOL(config, SessionCapture);
CONFIG_PRINT_STR(config, CapturesDirectory);
CONFIG_PRINT_SECTION("GFXSettings");
CONFIG_PRINT_BOOL(config, DecodeGFX);
}
void pf_server_config_free(proxyConfig* config)
@@ -382,7 +356,6 @@ void pf_server_config_free(proxyConfig* config)
return;
free(config->Passthrough);
free(config->CapturesDirectory);
free(config->RequiredPlugins);
free(config->Modules);
free(config->TargetHost);

View File

@@ -65,9 +65,8 @@ struct proxy_config
BOOL TextOnly;
UINT32 MaxTextLength;
/* session capture */
BOOL SessionCapture;
char* CapturesDirectory;
/* gfx settings */
BOOL DecodeGFX;
/* modules */
char** Modules; /* module file names to load */

View File

@@ -57,7 +57,7 @@ static UINT pf_rdpgfx_reset_graphics(RdpgfxClientContext* context,
if ((error = server->ResetGraphics(server, resetGraphics)))
return error;
if (!config->SessionCapture)
if (!config->DecodeGFX)
return CHANNEL_RC_OK;
return gfx_decoder->ResetGraphics(gfx_decoder, resetGraphics);
@@ -76,7 +76,7 @@ static UINT pf_rdpgfx_start_frame(RdpgfxClientContext* context,
if ((error = server->StartFrame(server, startFrame)))
return error;
if (!config->SessionCapture)
if (!config->DecodeGFX)
return CHANNEL_RC_OK;
return gfx_decoder->StartFrame(gfx_decoder, startFrame);
@@ -94,7 +94,7 @@ static UINT pf_rdpgfx_end_frame(RdpgfxClientContext* context, const RDPGFX_END_F
if ((error = server->EndFrame(server, endFrame)))
return error;
if (!config->SessionCapture)
if (!config->DecodeGFX)
return CHANNEL_RC_OK;
return gfx_decoder->EndFrame(gfx_decoder, endFrame);
@@ -113,7 +113,7 @@ static UINT pf_rdpgfx_surface_command(RdpgfxClientContext* context,
if ((error = server->SurfaceCommand(server, cmd)))
return error;
if (!config->SessionCapture)
if (!config->DecodeGFX)
return CHANNEL_RC_OK;
return gfx_decoder->SurfaceCommand(gfx_decoder, cmd);
@@ -133,7 +133,7 @@ pf_rdpgfx_delete_encoding_context(RdpgfxClientContext* context,
if ((error = server->DeleteEncodingContext(server, deleteEncodingContext)))
return error;
if (!config->SessionCapture)
if (!config->DecodeGFX)
return CHANNEL_RC_OK;
return gfx_decoder->DeleteEncodingContext(gfx_decoder, deleteEncodingContext);
@@ -152,7 +152,7 @@ static UINT pf_rdpgfx_create_surface(RdpgfxClientContext* context,
if ((error = server->CreateSurface(server, createSurface)))
return error;
if (!config->SessionCapture)
if (!config->DecodeGFX)
return CHANNEL_RC_OK;
return gfx_decoder->CreateSurface(gfx_decoder, createSurface);
@@ -171,7 +171,7 @@ static UINT pf_rdpgfx_delete_surface(RdpgfxClientContext* context,
if ((error = server->DeleteSurface(server, deleteSurface)))
return error;
if (!config->SessionCapture)
if (!config->DecodeGFX)
return CHANNEL_RC_OK;
return gfx_decoder->DeleteSurface(gfx_decoder, deleteSurface);
@@ -190,7 +190,7 @@ static UINT pf_rdpgfx_solid_fill(RdpgfxClientContext* context,
if ((error = server->SolidFill(server, solidFill)))
return error;
if (!config->SessionCapture)
if (!config->DecodeGFX)
return CHANNEL_RC_OK;
return gfx_decoder->SolidFill(gfx_decoder, solidFill);
@@ -209,7 +209,7 @@ static UINT pf_rdpgfx_surface_to_surface(RdpgfxClientContext* context,
if ((error = server->SurfaceToSurface(server, surfaceToSurface)))
return error;
if (!config->SessionCapture)
if (!config->DecodeGFX)
return CHANNEL_RC_OK;
return gfx_decoder->SurfaceToSurface(gfx_decoder, surfaceToSurface);
@@ -228,7 +228,7 @@ static UINT pf_rdpgfx_surface_to_cache(RdpgfxClientContext* context,
if ((error = server->SurfaceToCache(server, surfaceToCache)))
return error;
if (!config->SessionCapture)
if (!config->DecodeGFX)
return CHANNEL_RC_OK;
return gfx_decoder->SurfaceToCache(gfx_decoder, surfaceToCache);
@@ -247,7 +247,7 @@ static UINT pf_rdpgfx_cache_to_surface(RdpgfxClientContext* context,
if ((error = server->CacheToSurface(server, cacheToSurface)))
return error;
if (!config->SessionCapture)
if (!config->DecodeGFX)
return CHANNEL_RC_OK;
return gfx_decoder->CacheToSurface(gfx_decoder, cacheToSurface);
@@ -275,7 +275,7 @@ static UINT pf_rdpgfx_evict_cache_entry(RdpgfxClientContext* context,
if ((error = server->EvictCacheEntry(server, evictCacheEntry)))
return error;
if (!config->SessionCapture)
if (!config->DecodeGFX)
return CHANNEL_RC_OK;
return gfx_decoder->EvictCacheEntry(gfx_decoder, evictCacheEntry);
@@ -294,7 +294,7 @@ static UINT pf_rdpgfx_map_surface_to_output(RdpgfxClientContext* context,
if ((error = server->MapSurfaceToOutput(server, surfaceToOutput)))
return error;
if (!config->SessionCapture)
if (!config->DecodeGFX)
return CHANNEL_RC_OK;
return gfx_decoder->MapSurfaceToOutput(gfx_decoder, surfaceToOutput);
@@ -313,7 +313,7 @@ static UINT pf_rdpgfx_map_surface_to_window(RdpgfxClientContext* context,
if ((error = server->MapSurfaceToWindow(server, surfaceToWindow)))
return error;
if (!config->SessionCapture)
if (!config->DecodeGFX)
return CHANNEL_RC_OK;
return gfx_decoder->MapSurfaceToWindow(gfx_decoder, surfaceToWindow);
@@ -333,7 +333,7 @@ static UINT pf_rdpgfx_map_surface_to_scaled_window(
if ((error = server->MapSurfaceToScaledWindow(server, surfaceToScaledWindow)))
return error;
if (!config->SessionCapture)
if (!config->DecodeGFX)
return CHANNEL_RC_OK;
return gfx_decoder->MapSurfaceToScaledWindow(gfx_decoder, surfaceToScaledWindow);
@@ -353,7 +353,7 @@ static UINT pf_rdpgfx_map_surface_to_scaled_output(
if ((error = server->MapSurfaceToScaledOutput(server, surfaceToScaledOutput)))
return error;
if (!config->SessionCapture)
if (!config->DecodeGFX)
return CHANNEL_RC_OK;
return gfx_decoder->MapSurfaceToScaledOutput(gfx_decoder, surfaceToScaledOutput);
@@ -446,7 +446,7 @@ static UINT pf_rdpgfx_cache_import_offer(RdpgfxServerContext* context,
RdpgfxClientContext* client = (RdpgfxClientContext*)pdata->pc->gfx_proxy;
WLog_VRB(TAG, __FUNCTION__);
if (pdata->config->SessionCapture)
if (pdata->config->DecodeGFX)
{
/* do not proxy CacheImportOffer, as is it currently not supported by FREERDP. */
return CHANNEL_RC_OK;

View File

@@ -137,12 +137,6 @@ static BOOL pf_server_post_connect(freerdp_peer* peer)
ps = (pServerContext*)peer->context;
pdata = ps->pdata;
if (pdata->config->SessionCapture && !peer->settings->SupportGraphicsPipeline)
{
LOG_ERR(TAG, ps, "Session capture feature is enabled, only accepting connections with GFX");
return FALSE;
}
pc = pf_context_create_client_context(peer->settings);
if (pc == NULL)
{