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 #include "webrtc/modules/video_coding/jitter_buffer.h" | 10 #include "webrtc/modules/video_coding/jitter_buffer.h" |
(...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1198 bool key_frame_found = false; | 1198 bool key_frame_found = false; |
1199 int dropped_frames = 0; | 1199 int dropped_frames = 0; |
1200 dropped_frames += incomplete_frames_.RecycleFramesUntilKeyFrame( | 1200 dropped_frames += incomplete_frames_.RecycleFramesUntilKeyFrame( |
1201 &key_frame_it, &free_frames_); | 1201 &key_frame_it, &free_frames_); |
1202 key_frame_found = key_frame_it != incomplete_frames_.end(); | 1202 key_frame_found = key_frame_it != incomplete_frames_.end(); |
1203 if (dropped_frames == 0) { | 1203 if (dropped_frames == 0) { |
1204 dropped_frames += decodable_frames_.RecycleFramesUntilKeyFrame( | 1204 dropped_frames += decodable_frames_.RecycleFramesUntilKeyFrame( |
1205 &key_frame_it, &free_frames_); | 1205 &key_frame_it, &free_frames_); |
1206 key_frame_found = key_frame_it != decodable_frames_.end(); | 1206 key_frame_found = key_frame_it != decodable_frames_.end(); |
1207 } | 1207 } |
1208 TRACE_EVENT_INSTANT0("webrtc", "JB::RecycleFramesUntilKeyFrame"); | |
1209 if (key_frame_found) { | 1208 if (key_frame_found) { |
1210 LOG(LS_INFO) << "Found key frame while dropping frames."; | 1209 LOG(LS_INFO) << "Found key frame while dropping frames."; |
1211 // Reset last decoded state to make sure the next frame decoded is a key | 1210 // Reset last decoded state to make sure the next frame decoded is a key |
1212 // frame, and start NACKing from here. | 1211 // frame, and start NACKing from here. |
1213 last_decoded_state_.Reset(); | 1212 last_decoded_state_.Reset(); |
1214 DropPacketsFromNackList(EstimatedLowSequenceNumber(*key_frame_it->second)); | 1213 DropPacketsFromNackList(EstimatedLowSequenceNumber(*key_frame_it->second)); |
1215 } else if (decodable_frames_.empty()) { | 1214 } else if (decodable_frames_.empty()) { |
1216 // All frames dropped. Reset the decoding state and clear missing sequence | 1215 // All frames dropped. Reset the decoding state and clear missing sequence |
1217 // numbers as we're starting fresh. | 1216 // numbers as we're starting fresh. |
1218 last_decoded_state_.Reset(); | 1217 last_decoded_state_.Reset(); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1334 } | 1333 } |
1335 // Evaluate if the RTT is higher than |high_rtt_nack_threshold_ms_|, and in | 1334 // Evaluate if the RTT is higher than |high_rtt_nack_threshold_ms_|, and in |
1336 // that case we don't wait for retransmissions. | 1335 // that case we don't wait for retransmissions. |
1337 if (high_rtt_nack_threshold_ms_ >= 0 && | 1336 if (high_rtt_nack_threshold_ms_ >= 0 && |
1338 rtt_ms_ >= high_rtt_nack_threshold_ms_) { | 1337 rtt_ms_ >= high_rtt_nack_threshold_ms_) { |
1339 return false; | 1338 return false; |
1340 } | 1339 } |
1341 return true; | 1340 return true; |
1342 } | 1341 } |
1343 } // namespace webrtc | 1342 } // namespace webrtc |
OLD | NEW |