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