OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 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 |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 } | 142 } |
143 | 143 |
144 // Gracefully handle bad RTP timestamps and render time issues. | 144 // Gracefully handle bad RTP timestamps and render time issues. |
145 if (HasBadRenderTiming(*frame, now_ms)) { | 145 if (HasBadRenderTiming(*frame, now_ms)) { |
146 jitter_estimator_->Reset(); | 146 jitter_estimator_->Reset(); |
147 timing_->Reset(); | 147 timing_->Reset(); |
148 frame->SetRenderTime(timing_->RenderTimeMs(frame->timestamp, now_ms)); | 148 frame->SetRenderTime(timing_->RenderTimeMs(frame->timestamp, now_ms)); |
149 } | 149 } |
150 | 150 |
151 UpdateJitterDelay(); | 151 UpdateJitterDelay(); |
| 152 UpdateTimingFrameInfo(); |
152 PropagateDecodability(next_frame_it_->second); | 153 PropagateDecodability(next_frame_it_->second); |
153 | 154 |
154 // Sanity check for RTP timestamp monotonicity. | 155 // Sanity check for RTP timestamp monotonicity. |
155 if (last_decoded_frame_it_ != frames_.end()) { | 156 if (last_decoded_frame_it_ != frames_.end()) { |
156 const FrameKey& last_decoded_frame_key = last_decoded_frame_it_->first; | 157 const FrameKey& last_decoded_frame_key = last_decoded_frame_it_->first; |
157 const FrameKey& frame_key = next_frame_it_->first; | 158 const FrameKey& frame_key = next_frame_it_->first; |
158 | 159 |
159 const bool frame_is_higher_spatial_layer_of_last_decoded_frame = | 160 const bool frame_is_higher_spatial_layer_of_last_decoded_frame = |
160 last_decoded_frame_timestamp_ == frame->timestamp && | 161 last_decoded_frame_timestamp_ == frame->timestamp && |
161 last_decoded_frame_key.picture_id == frame_key.picture_id && | 162 last_decoded_frame_key.picture_id == frame_key.picture_id && |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 int render_delay_ms; | 528 int render_delay_ms; |
528 if (timing_->GetTimings(&decode_ms, &max_decode_ms, ¤t_delay_ms, | 529 if (timing_->GetTimings(&decode_ms, &max_decode_ms, ¤t_delay_ms, |
529 &target_delay_ms, &jitter_buffer_ms, | 530 &target_delay_ms, &jitter_buffer_ms, |
530 &min_playout_delay_ms, &render_delay_ms)) { | 531 &min_playout_delay_ms, &render_delay_ms)) { |
531 stats_callback_->OnFrameBufferTimingsUpdated( | 532 stats_callback_->OnFrameBufferTimingsUpdated( |
532 decode_ms, max_decode_ms, current_delay_ms, target_delay_ms, | 533 decode_ms, max_decode_ms, current_delay_ms, target_delay_ms, |
533 jitter_buffer_ms, min_playout_delay_ms, render_delay_ms); | 534 jitter_buffer_ms, min_playout_delay_ms, render_delay_ms); |
534 } | 535 } |
535 } | 536 } |
536 | 537 |
| 538 void FrameBuffer::UpdateTimingFrameInfo() { |
| 539 TRACE_EVENT0("webrtc", "FrameBuffer::UpdateTimingFrameInfo"); |
| 540 rtc::Optional<TimingFrameInfo> info = timing_->GetTimingFrameInfo(); |
| 541 if (info) |
| 542 stats_callback_->OnTimingFrameInfoUpdated(*info); |
| 543 } |
| 544 |
537 void FrameBuffer::ClearFramesAndHistory() { | 545 void FrameBuffer::ClearFramesAndHistory() { |
538 TRACE_EVENT0("webrtc", "FrameBuffer::UpdateJitterDelay"); | 546 TRACE_EVENT0("webrtc", "FrameBuffer::ClearFramesAndHistory"); |
539 frames_.clear(); | 547 frames_.clear(); |
540 last_decoded_frame_it_ = frames_.end(); | 548 last_decoded_frame_it_ = frames_.end(); |
541 last_continuous_frame_it_ = frames_.end(); | 549 last_continuous_frame_it_ = frames_.end(); |
542 next_frame_it_ = frames_.end(); | 550 next_frame_it_ = frames_.end(); |
543 num_frames_history_ = 0; | 551 num_frames_history_ = 0; |
544 num_frames_buffered_ = 0; | 552 num_frames_buffered_ = 0; |
545 } | 553 } |
546 | 554 |
547 } // namespace video_coding | 555 } // namespace video_coding |
548 } // namespace webrtc | 556 } // namespace webrtc |
OLD | NEW |