huangcm
2025-07-01 676035278781360996553c427a12bf358249ebf7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
 *  Copyright 2008 The WebRTC Project Authors. All rights reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */
 
#ifndef WEBRTC_BASE_SYSTEMINFO_H__
#define WEBRTC_BASE_SYSTEMINFO_H__
 
#include <string>
 
#include "webrtc/base/basictypes.h"
 
namespace rtc {
 
class SystemInfo {
 public:
  enum Architecture {
    SI_ARCH_UNKNOWN = -1,
    SI_ARCH_X86 = 0,
    SI_ARCH_X64 = 1,
    SI_ARCH_ARM = 2
  };
 
  SystemInfo();
 
  // The number of CPU Threads in the system.
  static int GetMaxCpus();
  // The number of CPU Threads currently available to this process.
  static int GetCurCpus();
  // Identity of the CPUs.
  Architecture GetCpuArchitecture();
  std::string GetCpuVendor();
  // Total amount of physical memory, in bytes.
  int64_t GetMemorySize();
  // The model name of the machine, e.g. "MacBookAir1,1"
  std::string GetMachineModel();
 
 private:
  static int logical_cpus_;
};
 
}  // namespace rtc
 
#endif  // WEBRTC_BASE_SYSTEMINFO_H__