| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #include "webrtc/media/base/videoadapter.h" | 11 #include "webrtc/media/base/videoadapter.h" |
| 12 | 12 |
| 13 #include <limits.h> // For INT_MAX | 13 #include <limits.h> // For INT_MAX |
| 14 #include <algorithm> | 14 #include <algorithm> |
| 15 | 15 |
| 16 #include "webrtc/base/logging.h" | 16 #include "webrtc/base/logging.h" |
| 17 #include "webrtc/base/timeutils.h" | 17 #include "webrtc/base/timeutils.h" |
| 18 #include "webrtc/media/base/constants.h" | 18 #include "webrtc/media/base/mediaconstants.h" |
| 19 #include "webrtc/media/base/videocommon.h" | 19 #include "webrtc/media/base/videocommon.h" |
| 20 #include "webrtc/media/base/videoframe.h" | 20 #include "webrtc/media/base/videoframe.h" |
| 21 | 21 |
| 22 namespace cricket { | 22 namespace cricket { |
| 23 | 23 |
| 24 // TODO(fbarchard): Make downgrades settable | 24 // TODO(fbarchard): Make downgrades settable |
| 25 static const int kMaxCpuDowngrades = 2; // Downgrade at most 2 times for CPU. | 25 static const int kMaxCpuDowngrades = 2; // Downgrade at most 2 times for CPU. |
| 26 // The number of cpu samples to require before adapting. This value depends on | 26 // The number of cpu samples to require before adapting. This value depends on |
| 27 // the cpu monitor sampling frequency being 2000ms. | 27 // the cpu monitor sampling frequency being 2000ms. |
| 28 static const int kCpuLoadMinSamples = 3; | 28 static const int kCpuLoadMinSamples = 3; |
| (...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 // When any adaptation occurs, historic CPU load levels are no longer | 709 // When any adaptation occurs, historic CPU load levels are no longer |
| 710 // accurate. Clear out our state so we can re-learn at the new normal. | 710 // accurate. Clear out our state so we can re-learn at the new normal. |
| 711 cpu_load_num_samples_ = 0; | 711 cpu_load_num_samples_ = 0; |
| 712 system_load_average_ = kCpuLoadInitialAverage; | 712 system_load_average_ = kCpuLoadInitialAverage; |
| 713 } | 713 } |
| 714 | 714 |
| 715 return changed; | 715 return changed; |
| 716 } | 716 } |
| 717 | 717 |
| 718 } // namespace cricket | 718 } // namespace cricket |
| OLD | NEW |