| 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 #ifndef WEBRTC_COMMON_VIDEO_INCLUDE_BITRATE_ADJUSTER_H_ | 11 #ifndef WEBRTC_COMMON_VIDEO_INCLUDE_BITRATE_ADJUSTER_H_ |
| 12 #define WEBRTC_COMMON_VIDEO_INCLUDE_BITRATE_ADJUSTER_H_ | 12 #define WEBRTC_COMMON_VIDEO_INCLUDE_BITRATE_ADJUSTER_H_ |
| 13 | 13 |
| 14 #include <functional> | 14 #include <functional> |
| 15 | 15 |
| 16 #include "webrtc/rtc_base/criticalsection.h" | 16 #include "webrtc/base/criticalsection.h" |
| 17 #include "webrtc/rtc_base/rate_statistics.h" | 17 #include "webrtc/base/rate_statistics.h" |
| 18 | 18 |
| 19 namespace webrtc { | 19 namespace webrtc { |
| 20 | 20 |
| 21 class Clock; | 21 class Clock; |
| 22 | 22 |
| 23 // Certain hardware encoders tend to consistently overshoot the bitrate that | 23 // Certain hardware encoders tend to consistently overshoot the bitrate that |
| 24 // they are configured to encode at. This class estimates an adjusted bitrate | 24 // they are configured to encode at. This class estimates an adjusted bitrate |
| 25 // that when set on the encoder will produce the desired bitrate. | 25 // that when set on the encoder will produce the desired bitrate. |
| 26 class BitrateAdjuster { | 26 class BitrateAdjuster { |
| 27 public: | 27 public: |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 RateStatistics bitrate_tracker_ GUARDED_BY(crit_); | 80 RateStatistics bitrate_tracker_ GUARDED_BY(crit_); |
| 81 // The last time we tried to adjust the bitrate. | 81 // The last time we tried to adjust the bitrate. |
| 82 uint32_t last_bitrate_update_time_ms_ GUARDED_BY(crit_); | 82 uint32_t last_bitrate_update_time_ms_ GUARDED_BY(crit_); |
| 83 // The number of frames since the last time we tried to adjust the bitrate. | 83 // The number of frames since the last time we tried to adjust the bitrate. |
| 84 uint32_t frames_since_last_update_ GUARDED_BY(crit_); | 84 uint32_t frames_since_last_update_ GUARDED_BY(crit_); |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 } // namespace webrtc | 87 } // namespace webrtc |
| 88 | 88 |
| 89 #endif // WEBRTC_COMMON_VIDEO_INCLUDE_BITRATE_ADJUSTER_H_ | 89 #endif // WEBRTC_COMMON_VIDEO_INCLUDE_BITRATE_ADJUSTER_H_ |
| OLD | NEW |