MCPcopy Create free account
hub / github.com/VirtualGL/virtualgl / fconfig_reloadenv

Function fconfig_reloadenv

server/fakerconfig.cpp:281–495  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

279
280
281void fconfig_reloadenv(void)
282{
283 char *env;
284
285 CriticalSection::SafeLock l(fcmutex);
286
287 FETCHENV_BOOL("VGL_ALLOWINDIRECT", allowindirect);
288 FETCHENV_BOOL("VGL_AMDGPUHACK", amdgpuHack);
289 FETCHENV_BOOL("VGL_AUTOTEST", autotest);
290 FETCHENV_BOOL("VGL_CHROMEHACK", chromeHack);
291 FETCHENV_STR("VGL_CLIENT", client);
292 if((env = getenv("VGL_SUBSAMP")) != NULL && strlen(env) > 0)
293 {
294 int subsamp = -1;
295 if(!strnicmp(env, "G", 1)) subsamp = 0;
296 else
297 {
298 char *t = NULL; int itemp = strtol(env, &t, 10);
299 if(t && t != env)
300 {
301 switch(itemp)
302 {
303 case 0: subsamp = 0; break;
304 case 444: case 11: case 1: subsamp = 1; break;
305 case 422: case 21: case 2: subsamp = 2; break;
306 case 411: case 420: case 22: case 4: subsamp = 4; break;
307 case 410: case 42: case 8: subsamp = 8; break;
308 case 44: case 16: subsamp = 16; break;
309 }
310 }
311 }
312 if(subsamp >= 0 && (!fconfig_envset || fconfig_env.subsamp != subsamp))
313 fconfig.subsamp = fconfig_env.subsamp = subsamp;
314 }
315 FETCHENV_STR("VGL_TRANSPORT", transport);
316 if((env = getenv("VGL_COMPRESS")) != NULL && strlen(env) > 0)
317 {
318 char *t = NULL; int itemp = strtol(env, &t, 10);
319 int compress = -1;
320 if(t && t != env && itemp >= 0
321 && (itemp < RR_COMPRESSOPT || strlen(fconfig.transport) > 0))
322 compress = itemp;
323 else if(!strnicmp(env, "p", 1)) compress = RRCOMP_PROXY;
324 else if(!strnicmp(env, "j", 1)) compress = RRCOMP_JPEG;
325 else if(!strnicmp(env, "r", 1)) compress = RRCOMP_RGB;
326 else if(!strnicmp(env, "x", 1)) compress = RRCOMP_XV;
327 else if(!strnicmp(env, "y", 1)) compress = RRCOMP_YUV;
328 if(compress >= 0 && (!fconfig_envset || fconfig_env.compress != compress))
329 {
330 fconfig_setcompress(fconfig, compress);
331 fconfig_env.compress = compress;
332 }
333 }
334 FETCHENV_STR("VGL_CONFIG", config);
335 FETCHENV_STR("VGL_DEFAULTFBCONFIG", defaultfbconfig);
336 if((env = getenv("VGL_DISPLAY")) != NULL && strlen(env) > 0)
337 {
338 if(!fconfig_envset || strncmp(env, fconfig_env.localdpystring, MAXSTR - 1))

Callers 5

readbackMethod · 0.85
fconfig_initFunction · 0.85
initFunction · 0.85
isDisplayStringExcludedFunction · 0.85
readbackMethod · 0.85

Calls 5

getenvFunction · 0.85
fconfig_setcompressFunction · 0.85
fconfig_setgammaFunction · 0.85
NumProcsFunction · 0.85
minFunction · 0.50

Tested by

no test coverage detected