| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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/modules/pacing/bitrate_prober.h" | 11 #include "webrtc/modules/pacing/bitrate_prober.h" |
| 12 | 12 |
| 13 #include <algorithm> | 13 #include <algorithm> |
| 14 | 14 |
| 15 #include "webrtc/base/checks.h" |
| 16 #include "webrtc/base/logging.h" |
| 15 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" | 17 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" |
| 16 #include "webrtc/modules/pacing/paced_sender.h" | 18 #include "webrtc/modules/pacing/paced_sender.h" |
| 17 #include "webrtc/rtc_base/checks.h" | |
| 18 #include "webrtc/rtc_base/logging.h" | |
| 19 | 19 |
| 20 namespace webrtc { | 20 namespace webrtc { |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 // A minimum interval between probes to allow scheduling to be feasible. | 24 // A minimum interval between probes to allow scheduling to be feasible. |
| 25 constexpr int kMinProbeDeltaMs = 1; | 25 constexpr int kMinProbeDeltaMs = 1; |
| 26 | 26 |
| 27 // The minimum number probing packets used. | 27 // The minimum number probing packets used. |
| 28 constexpr int kMinProbePacketsSent = 5; | 28 constexpr int kMinProbePacketsSent = 5; |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 // Compute the time delta from the cluster start to ensure probe bitrate stays | 194 // Compute the time delta from the cluster start to ensure probe bitrate stays |
| 195 // close to the target bitrate. Result is in milliseconds. | 195 // close to the target bitrate. Result is in milliseconds. |
| 196 int64_t delta_ms = | 196 int64_t delta_ms = |
| 197 (8000ll * cluster.sent_bytes + cluster.pace_info.send_bitrate_bps / 2) / | 197 (8000ll * cluster.sent_bytes + cluster.pace_info.send_bitrate_bps / 2) / |
| 198 cluster.pace_info.send_bitrate_bps; | 198 cluster.pace_info.send_bitrate_bps; |
| 199 return cluster.time_started_ms + delta_ms; | 199 return cluster.time_started_ms + delta_ms; |
| 200 } | 200 } |
| 201 | 201 |
| 202 | 202 |
| 203 } // namespace webrtc | 203 } // namespace webrtc |
| OLD | NEW |