[FFmpeg-devel] [PATCH] Runtime detection for the number of processors/cores

François Revol revol
Wed May 21 18:18:41 CEST 2008

> The function av_get_processor_num is now located in new
> cpu.[hc] files under libavutil.

There is *no* reason to create a file just for this.
As the code is platform dependant and threading related it should go to 
the existing platform-specific files libavcodec/*thread.c

Unless you need it from libavutils (then those should be moved to it).

Just declare av_get_num_processors() (or get_processor_count, but 
"get_processor_num" is semantically different, it means "get (the) 
processor number (but which number, ID ?)) in avcodec.h since other 
thread funcs are there.

> I added some checks to the configure script to check for 
> <sched.h> and <windows.h> .

sched.h seems quite common to me as system header name, at least it 
could potentially exist on non-linux for another API, you should likely 
check for the exact function you need.
And fall back to sysconf for pthread.

I'll take care of the beos code.

Just write a stub for OS/2 I suppose.


More information about the ffmpeg-devel mailing list