[client,cmdline] fixed /gfx parsing
* Fixed a bug not activating AVC444 when requested * Unified legacy /gfx-h264 parsing with /gfx
This commit is contained in:
parent
e530999156
commit
8c6ee2061b
@ -1907,7 +1907,7 @@ static int parse_gfx_options(rdpSettings* settings, const COMMAND_LINE_ARGUMENT_
|
||||
if (bval < 0)
|
||||
rc = COMMAND_LINE_ERROR_UNEXPECTED_VALUE;
|
||||
else
|
||||
GfxH264 = bval > 0;
|
||||
GfxAVC444 = bval > 0;
|
||||
codecSelected = TRUE;
|
||||
}
|
||||
else if (option_starts_with("AVC420", val))
|
||||
@ -1916,7 +1916,7 @@ static int parse_gfx_options(rdpSettings* settings, const COMMAND_LINE_ARGUMENT_
|
||||
if (bval < 0)
|
||||
rc = COMMAND_LINE_ERROR_UNEXPECTED_VALUE;
|
||||
else
|
||||
GfxAVC444 = bval > 0;
|
||||
GfxH264 = bval > 0;
|
||||
codecSelected = TRUE;
|
||||
}
|
||||
else
|
||||
@ -1975,12 +1975,11 @@ static int parse_gfx_options(rdpSettings* settings, const COMMAND_LINE_ARGUMENT_
|
||||
{
|
||||
if (!freerdp_settings_set_bool(settings, FreeRDP_GfxAVC444, GfxAVC444))
|
||||
rc = COMMAND_LINE_ERROR;
|
||||
else if (!freerdp_settings_set_bool(settings, FreeRDP_GfxH264, GfxH264))
|
||||
if (!freerdp_settings_set_bool(settings, FreeRDP_GfxH264, GfxH264))
|
||||
rc = COMMAND_LINE_ERROR;
|
||||
else if (!freerdp_settings_set_bool(settings, FreeRDP_RemoteFxCodec, RemoteFxCodec))
|
||||
if (!freerdp_settings_set_bool(settings, FreeRDP_RemoteFxCodec, RemoteFxCodec))
|
||||
rc = COMMAND_LINE_ERROR;
|
||||
else if (!freerdp_settings_set_bool(settings, FreeRDP_GfxProgressive,
|
||||
GfxProgressive))
|
||||
if (!freerdp_settings_set_bool(settings, FreeRDP_GfxProgressive, GfxProgressive))
|
||||
rc = COMMAND_LINE_ERROR;
|
||||
}
|
||||
}
|
||||
@ -3354,55 +3353,9 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
|
||||
CommandLineSwitchCase(arg, "gfx-h264")
|
||||
{
|
||||
WLog_WARN(TAG, "/gfx-h264 is deprecated, use /gfx:avc420 instead");
|
||||
settings->SupportGraphicsPipeline = TRUE;
|
||||
settings->GfxH264 = TRUE;
|
||||
|
||||
if (arg->Value)
|
||||
{
|
||||
int rc = CHANNEL_RC_OK;
|
||||
union
|
||||
{
|
||||
char** p;
|
||||
const char** pc;
|
||||
} ptr;
|
||||
size_t count, x;
|
||||
|
||||
ptr.p = CommandLineParseCommaSeparatedValues(arg->Value, &count);
|
||||
if (!ptr.pc || (count == 0))
|
||||
rc = COMMAND_LINE_ERROR;
|
||||
else
|
||||
{
|
||||
for (x = 0; x < count; x++)
|
||||
{
|
||||
const char* val = ptr.pc[x];
|
||||
|
||||
if (option_starts_with("AVC444", val))
|
||||
{
|
||||
settings->GfxH264 = TRUE;
|
||||
settings->GfxAVC444 = TRUE;
|
||||
}
|
||||
else if (option_starts_with("AVC420", val))
|
||||
{
|
||||
settings->GfxH264 = TRUE;
|
||||
settings->GfxAVC444 = FALSE;
|
||||
}
|
||||
else if (option_starts_with("mask:", val))
|
||||
{
|
||||
ULONGLONG v;
|
||||
const char* uv = &val[5];
|
||||
if (!value_to_uint(uv, &v, 0, UINT32_MAX))
|
||||
rc = COMMAND_LINE_ERROR;
|
||||
else
|
||||
settings->GfxCapsFilter = (UINT32)v;
|
||||
}
|
||||
else
|
||||
rc = COMMAND_LINE_ERROR;
|
||||
}
|
||||
}
|
||||
free(ptr.p);
|
||||
if (rc != CHANNEL_RC_OK)
|
||||
return rc;
|
||||
}
|
||||
int rc = parse_gfx_options(settings, arg);
|
||||
if (rc != 0)
|
||||
return rc;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user