mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 00:31:13 +00:00
mpeg2enc: Get number of processors on win32
Fixes #573848. Signed-off-by: David Schleef <ds@schleef.org>
This commit is contained in:
parent
dd4bd78f33
commit
bc29123723
1 changed files with 9 additions and 0 deletions
|
@ -24,6 +24,9 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "gstmpeg2encoptions.hh"
|
#include "gstmpeg2encoptions.hh"
|
||||||
|
#if WIN32
|
||||||
|
# include <windows.h> //For GetSystemInfo
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
|
|
||||||
|
@ -285,7 +288,13 @@ GstMpeg2EncOptions::GstMpeg2EncOptions ():
|
||||||
MPEG2EncOptions ()
|
MPEG2EncOptions ()
|
||||||
{
|
{
|
||||||
/* autodetect number of CPUs */
|
/* autodetect number of CPUs */
|
||||||
|
#ifndef WIN32
|
||||||
num_cpus = sysconf (_SC_NPROCESSORS_ONLN);
|
num_cpus = sysconf (_SC_NPROCESSORS_ONLN);
|
||||||
|
#else
|
||||||
|
SYSTEM_INFO si;
|
||||||
|
GetSystemInfo(&si);
|
||||||
|
num_cpus = si.dwNumberOfProcessors;
|
||||||
|
#endif
|
||||||
if (num_cpus < 0)
|
if (num_cpus < 0)
|
||||||
num_cpus = 1;
|
num_cpus = 1;
|
||||||
if (num_cpus > 32)
|
if (num_cpus > 32)
|
||||||
|
|
Loading…
Reference in a new issue