28 |
#include <string.h> |
#include <string.h> |
29 |
#include <time.h> |
#include <time.h> |
30 |
|
|
31 |
|
#if !defined(_WIN32) |
32 |
|
#include <unistd.h> |
33 |
|
#endif |
34 |
|
|
35 |
#include "xvid.h" |
#include "xvid.h" |
36 |
#include "decoder.h" |
#include "decoder.h" |
37 |
#include "encoder.h" |
#include "encoder.h" |
665 |
return XVID_ERR_VERSION; |
return XVID_ERR_VERSION; |
666 |
|
|
667 |
info->actual_version = XVID_VERSION; |
info->actual_version = XVID_VERSION; |
668 |
info->build = "xvid-1.2.0-dev"; |
info->build = "xvid-1.3.0-dev"; |
669 |
info->cpu_flags = detect_cpu_flags(); |
info->cpu_flags = detect_cpu_flags(); |
670 |
info->num_threads = 0; |
info->num_threads = 0; |
671 |
|
|
672 |
#if defined(_WIN32) |
#if defined(_WIN32) |
673 |
|
|
674 |
{ |
{ |
675 |
DWORD dwProcessAffinityMask, dwSystemAffinityMask; |
SYSTEM_INFO siSysInfo; |
676 |
if (GetProcessAffinityMask(GetCurrentProcess(), (PDWORD_PTR) &dwProcessAffinityMask, (PDWORD_PTR) &dwSystemAffinityMask)) { |
GetSystemInfo(&siSysInfo); |
677 |
int i; |
info->num_threads = siSysInfo.dwNumberOfProcessors; /* number of _logical_ cores */ |
|
for(i=0; i<32; i++) { |
|
|
if ((dwProcessAffinityMask & (1<<i))) |
|
|
info->num_threads++; |
|
|
} |
|
|
} |
|
678 |
} |
} |
679 |
|
|
680 |
#else |
#else |
681 |
|
|
|
#include <unistd.h> |
|
682 |
info->num_threads = sysconf(_SC_NPROCESSORS_CONF); |
info->num_threads = sysconf(_SC_NPROCESSORS_CONF); |
683 |
|
|
684 |
#endif |
#endif |