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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 return; | 158 return; |
159 } | 159 } |
160 if (current_delay_ms_ + delayed_ms <= target_delay_ms) { | 160 if (current_delay_ms_ + delayed_ms <= target_delay_ms) { |
161 current_delay_ms_ += static_cast<uint32_t>(delayed_ms); | 161 current_delay_ms_ += static_cast<uint32_t>(delayed_ms); |
162 } else { | 162 } else { |
163 current_delay_ms_ = target_delay_ms; | 163 current_delay_ms_ = target_delay_ms; |
164 } | 164 } |
165 } | 165 } |
166 | 166 |
167 int32_t VCMTiming::StopDecodeTimer(uint32_t time_stamp, | 167 int32_t VCMTiming::StopDecodeTimer(uint32_t time_stamp, |
168 int64_t start_time_ms, | 168 int32_t decode_time_ms, |
169 int64_t now_ms, | 169 int64_t now_ms, |
170 int64_t render_time_ms) { | 170 int64_t render_time_ms) { |
171 CriticalSectionScoped cs(crit_sect_); | 171 CriticalSectionScoped cs(crit_sect_); |
172 int32_t time_diff_ms = codec_timer_.StopTimer(start_time_ms, now_ms); | 172 codec_timer_.MaxFilter(decode_time_ms, now_ms); |
173 assert(time_diff_ms >= 0); | 173 assert(decode_time_ms >= 0); |
174 last_decode_ms_ = time_diff_ms; | 174 last_decode_ms_ = decode_time_ms; |
175 | 175 |
176 // Update stats. | 176 // Update stats. |
177 ++num_decoded_frames_; | 177 ++num_decoded_frames_; |
178 if (num_decoded_frames_ == 1) { | 178 if (num_decoded_frames_ == 1) { |
179 first_decoded_frame_ms_ = now_ms; | 179 first_decoded_frame_ms_ = now_ms; |
180 } | 180 } |
181 int time_until_rendering_ms = render_time_ms - render_delay_ms_ - now_ms; | 181 int time_until_rendering_ms = render_time_ms - render_delay_ms_ - now_ms; |
182 if (time_until_rendering_ms < 0) { | 182 if (time_until_rendering_ms < 0) { |
183 sum_missed_render_deadline_ms_ += -time_until_rendering_ms; | 183 sum_missed_render_deadline_ms_ += -time_until_rendering_ms; |
184 ++num_delayed_decoded_frames_; | 184 ++num_delayed_decoded_frames_; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 *decode_ms = last_decode_ms_; | 270 *decode_ms = last_decode_ms_; |
271 *max_decode_ms = MaxDecodeTimeMs(); | 271 *max_decode_ms = MaxDecodeTimeMs(); |
272 *current_delay_ms = current_delay_ms_; | 272 *current_delay_ms = current_delay_ms_; |
273 *target_delay_ms = TargetDelayInternal(); | 273 *target_delay_ms = TargetDelayInternal(); |
274 *jitter_buffer_ms = jitter_delay_ms_; | 274 *jitter_buffer_ms = jitter_delay_ms_; |
275 *min_playout_delay_ms = min_playout_delay_ms_; | 275 *min_playout_delay_ms = min_playout_delay_ms_; |
276 *render_delay_ms = render_delay_ms_; | 276 *render_delay_ms = render_delay_ms_; |
277 } | 277 } |
278 | 278 |
279 } // namespace webrtc | 279 } // namespace webrtc |
OLD | NEW |