| 316 | | CFArrayRef list = CFPreferencesCopyAppValue(CFSTR("FrameDroppingWhiteList"), CFSTR("org.perian.Perian")); |
|---|
| 317 | | |
|---|
| 318 | | if (list) { |
|---|
| 319 | | int count = CFArrayGetCount(list); |
|---|
| 320 | | CFStringRef names[count]; |
|---|
| 321 | | |
|---|
| 322 | | CFArrayGetValues(list, CFRangeMake(0, count), (void *)names); |
|---|
| 323 | | enabled = findNameInList(myProcessName, names, count); |
|---|
| 324 | | CFRelease(list); |
|---|
| 325 | | } else { |
|---|
| 326 | | int count = sizeof(defaultFrameDroppingWhiteList)/sizeof(defaultFrameDroppingWhiteList[0]); |
|---|
| 327 | | enabled = findNameInList(myProcessName, defaultFrameDroppingWhiteList, count); |
|---|
| 328 | | } |
|---|
| 329 | | //Codecprintf(NULL, "Frame Dropping enabled is %d for %s\n", enabled, CFStringGetCStringPtr(myProcessName, kCFStringEncodingMacRoman)); |
|---|
| 330 | | CFRelease(myProcessName); |
|---|
| | 315 | processInformation = ProcessInformationCopyDictionary(&myProcess, kProcessDictionaryIncludeAllInformationMask); |
|---|
| | 316 | |
|---|
| | 317 | if (!processInformation) enabled = FALSE; |
|---|
| | 318 | else { |
|---|
| | 319 | CFArrayRef list = CFPreferencesCopyAppValue(CFSTR("FrameDroppingWhiteList"), CFSTR("org.perian.Perian")); |
|---|
| | 320 | CFStringRef path = CFDictionaryGetValue(processInformation, kCFBundleExecutableKey); |
|---|
| | 321 | CFRange entireRange = CFRangeMake(0, CFStringGetLength(path)), basename; |
|---|
| | 322 | |
|---|
| | 323 | CFStringFindWithOptions(path, CFSTR("/"), entireRange, kCFCompareBackwards, &basename); |
|---|
| | 324 | |
|---|
| | 325 | basename.location += 1; //advance past "/" |
|---|
| | 326 | basename.length = entireRange.length - basename.location; |
|---|
| | 327 | |
|---|
| | 328 | CFStringRef myProcessName = CFStringCreateWithSubstring(NULL, path, basename); |
|---|
| | 329 | |
|---|
| | 330 | if (list) { |
|---|
| | 331 | int count = CFArrayGetCount(list); |
|---|
| | 332 | CFStringRef names[count]; |
|---|
| | 333 | |
|---|
| | 334 | CFArrayGetValues(list, CFRangeMake(0, count), (void *)names); |
|---|
| | 335 | enabled = findNameInList(myProcessName, names, count); |
|---|
| | 336 | CFRelease(list); |
|---|
| | 337 | } else { |
|---|
| | 338 | int count = sizeof(defaultFrameDroppingWhiteList)/sizeof(defaultFrameDroppingWhiteList[0]); |
|---|
| | 339 | enabled = findNameInList(myProcessName, defaultFrameDroppingWhiteList, count); |
|---|
| | 340 | } |
|---|
| | 341 | //Codecprintf(NULL, "Frame Dropping enabled is %d for %s\n", enabled, CFStringGetCStringPtr(myProcessName, kCFStringEncodingMacRoman)); |
|---|
| | 342 | CFRelease(myProcessName); |
|---|
| | 343 | CFRelease(path); |
|---|
| | 344 | } |
|---|