OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 | 116 |
117 const BandwidthUsage prior_state = estimator->detector.State(); | 117 const BandwidthUsage prior_state = estimator->detector.State(); |
118 uint32_t timestamp_delta = 0; | 118 uint32_t timestamp_delta = 0; |
119 int64_t time_delta = 0; | 119 int64_t time_delta = 0; |
120 int size_delta = 0; | 120 int size_delta = 0; |
121 if (estimator->inter_arrival.ComputeDeltas( | 121 if (estimator->inter_arrival.ComputeDeltas( |
122 rtp_timestamp, arrival_time_ms, now_ms, payload_size, | 122 rtp_timestamp, arrival_time_ms, now_ms, payload_size, |
123 ×tamp_delta, &time_delta, &size_delta)) { | 123 ×tamp_delta, &time_delta, &size_delta)) { |
124 double timestamp_delta_ms = timestamp_delta * kTimestampToMs; | 124 double timestamp_delta_ms = timestamp_delta * kTimestampToMs; |
125 estimator->estimator.Update(time_delta, timestamp_delta_ms, size_delta, | 125 estimator->estimator.Update(time_delta, timestamp_delta_ms, size_delta, |
126 estimator->detector.State()); | 126 estimator->detector.State(), now_ms); |
127 estimator->detector.Detect(estimator->estimator.offset(), | 127 estimator->detector.Detect(estimator->estimator.offset(), |
128 timestamp_delta_ms, | 128 timestamp_delta_ms, |
129 estimator->estimator.num_of_deltas(), now_ms); | 129 estimator->estimator.num_of_deltas(), now_ms); |
130 } | 130 } |
131 if (estimator->detector.State() == kBwOverusing) { | 131 if (estimator->detector.State() == kBwOverusing) { |
132 rtc::Optional<uint32_t> incoming_bitrate_bps = | 132 rtc::Optional<uint32_t> incoming_bitrate_bps = |
133 incoming_bitrate_.Rate(now_ms); | 133 incoming_bitrate_.Rate(now_ms); |
134 if (incoming_bitrate_bps && | 134 if (incoming_bitrate_bps && |
135 (prior_state != kBwOverusing || | 135 (prior_state != kBwOverusing || |
136 remote_rate_->TimeToReduceFurther(now_ms, *incoming_bitrate_bps))) { | 136 remote_rate_->TimeToReduceFurther(now_ms, *incoming_bitrate_bps))) { |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 (*ssrcs)[i] = it->first; | 249 (*ssrcs)[i] = it->first; |
250 } | 250 } |
251 } | 251 } |
252 | 252 |
253 void RemoteBitrateEstimatorSingleStream::SetMinBitrate(int min_bitrate_bps) { | 253 void RemoteBitrateEstimatorSingleStream::SetMinBitrate(int min_bitrate_bps) { |
254 CriticalSectionScoped cs(crit_sect_.get()); | 254 CriticalSectionScoped cs(crit_sect_.get()); |
255 remote_rate_->SetMinBitrate(min_bitrate_bps); | 255 remote_rate_->SetMinBitrate(min_bitrate_bps); |
256 } | 256 } |
257 | 257 |
258 } // namespace webrtc | 258 } // namespace webrtc |
OLD | NEW |