OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2016 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/common_video/include/bitrate_adjuster.h" | 11 #include "webrtc/common_video/include/bitrate_adjuster.h" |
12 | 12 |
| 13 #include <algorithm> |
13 #include <cmath> | 14 #include <cmath> |
14 | 15 |
15 #include "webrtc/base/checks.h" | 16 #include "webrtc/base/checks.h" |
16 #include "webrtc/base/logging.h" | 17 #include "webrtc/base/logging.h" |
17 #include "webrtc/system_wrappers/include/clock.h" | 18 #include "webrtc/system_wrappers/include/clock.h" |
18 | 19 |
19 namespace webrtc { | 20 namespace webrtc { |
20 | 21 |
21 // Update bitrate at most once every second. | 22 // Update bitrate at most once every second. |
22 const uint32_t BitrateAdjuster::kBitrateUpdateIntervalMs = 1000; | 23 const uint32_t BitrateAdjuster::kBitrateUpdateIntervalMs = 1000; |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 << static_cast<uint32_t>(adjusted_bitrate_bps); | 152 << static_cast<uint32_t>(adjusted_bitrate_bps); |
152 adjusted_bitrate_bps_ = adjusted_bitrate_bps; | 153 adjusted_bitrate_bps_ = adjusted_bitrate_bps; |
153 } | 154 } |
154 } | 155 } |
155 last_bitrate_update_time_ms_ = current_time_ms; | 156 last_bitrate_update_time_ms_ = current_time_ms; |
156 frames_since_last_update_ = 0; | 157 frames_since_last_update_ = 0; |
157 last_adjusted_target_bitrate_bps_ = target_bitrate_bps_; | 158 last_adjusted_target_bitrate_bps_ = target_bitrate_bps_; |
158 } | 159 } |
159 | 160 |
160 } // namespace webrtc | 161 } // namespace webrtc |
OLD | NEW |