| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 if (frame_timestamp < 0x0000ffff && prev_frame_timestamp_ > 0xffff0000) { | 147 if (frame_timestamp < 0x0000ffff && prev_frame_timestamp_ > 0xffff0000) { |
| 148 // wrap | 148 // wrap |
| 149 max_change_ms = kDelayMaxChangeMsPerS * | 149 max_change_ms = kDelayMaxChangeMsPerS * |
| 150 (frame_timestamp + (static_cast<int64_t>(1) << 32) - | 150 (frame_timestamp + (static_cast<int64_t>(1) << 32) - |
| 151 prev_frame_timestamp_) / | 151 prev_frame_timestamp_) / |
| 152 90000; | 152 90000; |
| 153 } else { | 153 } else { |
| 154 max_change_ms = kDelayMaxChangeMsPerS * | 154 max_change_ms = kDelayMaxChangeMsPerS * |
| 155 (frame_timestamp - prev_frame_timestamp_) / 90000; | 155 (frame_timestamp - prev_frame_timestamp_) / 90000; |
| 156 } | 156 } |
| 157 |
| 157 if (max_change_ms <= 0) { | 158 if (max_change_ms <= 0) { |
| 158 // Any changes less than 1 ms are truncated and | 159 // Any changes less than 1 ms are truncated and |
| 159 // will be postponed. Negative change will be due | 160 // will be postponed. Negative change will be due |
| 160 // to reordering and should be ignored. | 161 // to reordering and should be ignored. |
| 161 return; | 162 return; |
| 162 } | 163 } |
| 163 delay_diff_ms = std::max(delay_diff_ms, -max_change_ms); | 164 delay_diff_ms = std::max(delay_diff_ms, -max_change_ms); |
| 164 delay_diff_ms = std::min(delay_diff_ms, max_change_ms); | 165 delay_diff_ms = std::min(delay_diff_ms, max_change_ms); |
| 165 | 166 |
| 166 current_delay_ms_ = current_delay_ms_ + delay_diff_ms; | 167 current_delay_ms_ = current_delay_ms_ + delay_diff_ms; |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 *decode_ms = last_decode_ms_; | 299 *decode_ms = last_decode_ms_; |
| 299 *max_decode_ms = RequiredDecodeTimeMs(); | 300 *max_decode_ms = RequiredDecodeTimeMs(); |
| 300 *current_delay_ms = current_delay_ms_; | 301 *current_delay_ms = current_delay_ms_; |
| 301 *target_delay_ms = TargetDelayInternal(); | 302 *target_delay_ms = TargetDelayInternal(); |
| 302 *jitter_buffer_ms = jitter_delay_ms_; | 303 *jitter_buffer_ms = jitter_delay_ms_; |
| 303 *min_playout_delay_ms = min_playout_delay_ms_; | 304 *min_playout_delay_ms = min_playout_delay_ms_; |
| 304 *render_delay_ms = render_delay_ms_; | 305 *render_delay_ms = render_delay_ms_; |
| 305 } | 306 } |
| 306 | 307 |
| 307 } // namespace webrtc | 308 } // namespace webrtc |
| OLD | NEW |