Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
ad29ecbf
Commit
ad29ecbf
authored
Dec 21, 2011
by
Janne Grunau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windows: use number of CPUs as automatic thread count
parent
ea4d5f48
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
configure
configure
+2
-0
pthread.c
libavcodec/pthread.c
+6
-0
No files found.
configure
View file @
ad29ecbf
...
...
@@ -1086,6 +1086,7 @@ HAVE_LIST="
gethrtime
GetProcessMemoryInfo
GetProcessTimes
GetSystemInfo
getrusage
gnu_as
ibm_asm
...
...
@@ -2859,6 +2860,7 @@ 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 GetProcessTimes
check_func_headers windows.h GetSystemInfo
check_func_headers windows.h MapViewOfFile
check_func_headers windows.h VirtualAlloc
...
...
libavcodec/pthread.c
View file @
ad29ecbf
...
...
@@ -34,6 +34,8 @@
#if HAVE_SCHED_GETAFFINITY
#define _GNU_SOURCE
#include <sched.h>
#elif HAVE_GETSYSTEMINFO
#include <windows.h>
#endif
#include "avcodec.h"
...
...
@@ -156,6 +158,10 @@ 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
;
#endif
av_log
(
avctx
,
AV_LOG_DEBUG
,
"detected %d logical cores
\n
"
,
nb_cpus
);
return
FFMIN
(
nb_cpus
,
MAX_AUTO_THREADS
);
...
...
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