Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
02e8f427
Commit
02e8f427
authored
Jan 01, 2012
by
Daniel Verkamp
Committed by
Janne Grunau
Jan 03, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32: detect number of CPUs using affinity
Signed-off-by:
Janne Grunau
<
janne-libav@jannau.net
>
parent
b73ec054
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
configure
configure
+2
-2
pthread.c
libavcodec/pthread.c
+6
-5
No files found.
configure
View file @
02e8f427
...
...
@@ -1084,9 +1084,9 @@ HAVE_LIST="
fork
getaddrinfo
gethrtime
GetProcessAffinityMask
GetProcessMemoryInfo
GetProcessTimes
GetSystemInfo
getrusage
gnu_as
ibm_asm
...
...
@@ -2864,8 +2864,8 @@ check_func sysctl
check_func_headers io.h setmode
check_func_headers lzo/lzo1x.h lzo1x_999_compress
check_lib2
"windows.h psapi.h"
GetProcessMemoryInfo
-lpsapi
check_func_headers windows.h GetProcessAffinityMask
check_func_headers windows.h GetProcessTimes
check_func_headers windows.h GetSystemInfo
check_func_headers windows.h MapViewOfFile
check_func_headers windows.h VirtualAlloc
...
...
libavcodec/pthread.c
View file @
02e8f427
...
...
@@ -35,7 +35,7 @@
#define _GNU_SOURCE
#include <sched.h>
#endif
#if HAVE_GET
SYSTEMINFO
#if HAVE_GET
PROCESSAFFINITYMASK
#include <windows.h>
#endif
#if HAVE_SYSCTL
...
...
@@ -169,10 +169,11 @@ static int get_logical_cpus(AVCodecContext *avctx)
if
(
!
ret
)
{
nb_cpus
=
CPU_COUNT
(
&
cpuset
);
}
#elif HAVE_GETSYSTEMINFO
SYSTEM_INFO
sysinfo
;
GetSystemInfo
(
&
sysinfo
);
nb_cpus
=
sysinfo
.
dwNumberOfProcessors
;
#elif HAVE_GETPROCESSAFFINITYMASK
DWORD_PTR
proc_aff
,
sys_aff
;
ret
=
GetProcessAffinityMask
(
GetCurrentProcess
(),
&
proc_aff
,
&
sys_aff
);
if
(
ret
)
nb_cpus
=
av_popcount64
(
proc_aff
);
#elif HAVE_SYSCTL && defined(HW_NCPU)
int
mib
[
2
]
=
{
CTL_HW
,
HW_NCPU
};
size_t
len
=
sizeof
(
nb_cpus
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment