@@ -2451,28 +2451,50 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
24512451
24522452if (arg -> Value )
24532453{
2454- #ifdef WITH_GFX_H264
2454+ int rc = CHANNEL_RC_OK ;
2455+ char * * p ;
2456+ size_t count , x ;
24552457
2456- if (_strnicmp ("AVC444" , arg -> Value , 7 ) == 0 )
2457- {
2458- settings -> GfxH264 = TRUE;
2459- settings -> GfxAVC444 = TRUE;
2460- }
2461- else if (_strnicmp ("AVC420" , arg -> Value , 7 ) == 0 )
2458+ p = freerdp_command_line_parse_comma_separated_values (arg -> Value , & count );
2459+ if (!p || (count == 0 ))
2460+ rc = COMMAND_LINE_ERROR ;
2461+ for (x = 0 ; x < count ; x ++ )
24622462{
2463- settings -> GfxH264 = TRUE;
2464- settings -> GfxAVC444 = FALSE;
2465- }
2466- else
2463+ const char * val = p [x ];
2464+ #ifdef WITH_GFX_H264
2465+ if (_strnicmp ("AVC444" , val , 7 ) == 0 )
2466+ {
2467+ settings -> GfxH264 = TRUE;
2468+ settings -> GfxAVC444 = TRUE;
2469+ }
2470+ else if (_strnicmp ("AVC420" , val , 7 ) == 0 )
2471+ {
2472+ settings -> GfxH264 = TRUE;
2473+ settings -> GfxAVC444 = FALSE;
2474+ }
2475+ else
24672476#endif
2468- if (_strnicmp ("RFX" , arg -> Value , 4 ) == 0 )
2469- {
2470- settings -> GfxAVC444 = FALSE;
2471- settings -> GfxH264 = FALSE;
2472- settings -> RemoteFxCodec = TRUE;
2477+ if (_strnicmp ("RFX" , val , 4 ) == 0 )
2478+ {
2479+ settings -> GfxAVC444 = FALSE;
2480+ settings -> GfxH264 = FALSE;
2481+ settings -> RemoteFxCodec = TRUE;
2482+ }
2483+ else if (_strnicmp ("mask:" , val , 5 ) == 0 )
2484+ {
2485+ ULONGLONG v ;
2486+ const char * uv = & val [5 ];
2487+ if (!value_to_uint (uv , & v , 0 , UINT32_MAX ))
2488+ rc = COMMAND_LINE_ERROR ;
2489+ else
2490+ settings -> GfxCapsFilter = (UINT32 )v ;
2491+ }
2492+ else
2493+ rc = COMMAND_LINE_ERROR ;
24732494}
2474- else
2475- return COMMAND_LINE_ERROR ;
2495+ free (p );
2496+ if (rc != CHANNEL_RC_OK )
2497+ return rc ;
24762498}
24772499}
24782500CommandLineSwitchCase (arg , "gfx-thin-client" )
@@ -2507,12 +2529,36 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
25072529
25082530if (arg -> Value )
25092531{
2510- if (_strnicmp ("AVC444" , arg -> Value , 7 ) == 0 )
2532+ int rc = CHANNEL_RC_OK ;
2533+ char * * p ;
2534+ size_t count , x ;
2535+
2536+ p = freerdp_command_line_parse_comma_separated_values (arg -> Value , & count );
2537+ if (!p || (count == 0 ))
2538+ rc = COMMAND_LINE_ERROR ;
2539+ for (x = 0 ; x < count ; x ++ )
25112540{
2512- settings -> GfxAVC444 = TRUE;
2541+ const char * val = p [x ];
2542+
2543+ if (_strnicmp ("AVC444" , val , 7 ) == 0 )
2544+ {
2545+ settings -> GfxAVC444 = TRUE;
2546+ }
2547+ else if (_strnicmp ("AVC420" , val , 7 ) != 0 )
2548+ rc = COMMAND_LINE_ERROR ;
2549+ else if (_strnicmp ("mask:" , val , 5 ) == 0 )
2550+ {
2551+ ULONGLONG v ;
2552+ const char * uv = & val [5 ];
2553+ if (!value_to_uint (uv , & v , 0 , UINT32_MAX ))
2554+ rc = COMMAND_LINE_ERROR ;
2555+ else
2556+ settings -> GfxCapsFilter = (UINT32 )v ;
2557+ }
25132558}
2514- else if (_strnicmp ("AVC420" , arg -> Value , 7 ) != 0 )
2515- return COMMAND_LINE_ERROR ;
2559+ free (p );
2560+ if (rc != CHANNEL_RC_OK )
2561+ return rc ;
25162562}
25172563}
25182564#endif
0 commit comments