blob: d81f0153175a9609733b8d203beed9d7882b8ac9 [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
phoglund@webrtc.orgb15d2852012-11-21 08:02:57 +000011#include "system_wrappers/interface/cpu_wrapper.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000012
13#if defined(_WIN32)
phoglund@webrtc.orgb15d2852012-11-21 08:02:57 +000014#include "cpu_win.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000015#elif defined(WEBRTC_MAC)
phoglund@webrtc.orgb15d2852012-11-21 08:02:57 +000016#include "cpu_mac.h"
leozwang@google.comb3527002011-07-26 17:29:38 +000017#elif defined(WEBRTC_ANDROID)
phoglund@webrtc.orgb15d2852012-11-21 08:02:57 +000018// Not implemented yet, might be possible to use Linux implementation
niklase@google.com470e71d2011-07-07 08:21:25 +000019#else // defined(WEBRTC_LINUX)
phoglund@webrtc.orgb15d2852012-11-21 08:02:57 +000020#include "cpu_linux.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000021#endif
22
niklase@google.com470e71d2011-07-07 08:21:25 +000023namespace webrtc {
phoglund@webrtc.orgb15d2852012-11-21 08:02:57 +000024CpuWrapper* CpuWrapper::CreateCpu() {
niklase@google.com470e71d2011-07-07 08:21:25 +000025#if defined(_WIN32)
phoglund@webrtc.orgb15d2852012-11-21 08:02:57 +000026 return new CpuWindows();
andrew@webrtc.orgf3b65db2012-09-06 18:17:00 +000027#elif defined(WEBRTC_MAC)
phoglund@webrtc.orgb15d2852012-11-21 08:02:57 +000028 return new CpuWrapperMac();
leozwang@google.comb3527002011-07-26 17:29:38 +000029#elif defined(WEBRTC_ANDROID)
phoglund@webrtc.orgb15d2852012-11-21 08:02:57 +000030 return 0;
niklase@google.com470e71d2011-07-07 08:21:25 +000031#else
phoglund@webrtc.orgb15d2852012-11-21 08:02:57 +000032 return new CpuLinux();
niklase@google.com470e71d2011-07-07 08:21:25 +000033#endif
34}
phoglund@webrtc.orgb15d2852012-11-21 08:02:57 +000035
36} // namespace webrtc