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/main/source/jitter_buffer.h" | 10 #include "webrtc/modules/video_coding/main/source/jitter_buffer.h" |
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 } | 907 } |
908 | 908 |
909 std::vector<uint16_t> VCMJitterBuffer::GetNackList(bool* request_key_frame) { | 909 std::vector<uint16_t> VCMJitterBuffer::GetNackList(bool* request_key_frame) { |
910 CriticalSectionScoped cs(crit_sect_); | 910 CriticalSectionScoped cs(crit_sect_); |
911 *request_key_frame = false; | 911 *request_key_frame = false; |
912 if (nack_mode_ == kNoNack) { | 912 if (nack_mode_ == kNoNack) { |
913 return std::vector<uint16_t>(); | 913 return std::vector<uint16_t>(); |
914 } | 914 } |
915 if (last_decoded_state_.in_initial_state()) { | 915 if (last_decoded_state_.in_initial_state()) { |
916 VCMFrameBuffer* next_frame = NextFrame(); | 916 VCMFrameBuffer* next_frame = NextFrame(); |
| 917 if (!next_frame) |
| 918 return std::vector<uint16_t>(); |
917 const bool first_frame_is_key = next_frame && | 919 const bool first_frame_is_key = next_frame && |
918 next_frame->FrameType() == kVideoFrameKey && | 920 next_frame->FrameType() == kVideoFrameKey && |
919 next_frame->HaveFirstPacket(); | 921 next_frame->HaveFirstPacket(); |
920 if (!first_frame_is_key) { | 922 if (!first_frame_is_key) { |
921 bool have_non_empty_frame = decodable_frames_.end() != find_if( | 923 bool have_non_empty_frame = decodable_frames_.end() != find_if( |
922 decodable_frames_.begin(), decodable_frames_.end(), | 924 decodable_frames_.begin(), decodable_frames_.end(), |
923 HasNonEmptyState); | 925 HasNonEmptyState); |
924 if (!have_non_empty_frame) { | 926 if (!have_non_empty_frame) { |
925 have_non_empty_frame = incomplete_frames_.end() != find_if( | 927 have_non_empty_frame = incomplete_frames_.end() != find_if( |
926 incomplete_frames_.begin(), incomplete_frames_.end(), | 928 incomplete_frames_.begin(), incomplete_frames_.end(), |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1253 } | 1255 } |
1254 // Evaluate if the RTT is higher than |high_rtt_nack_threshold_ms_|, and in | 1256 // Evaluate if the RTT is higher than |high_rtt_nack_threshold_ms_|, and in |
1255 // that case we don't wait for retransmissions. | 1257 // that case we don't wait for retransmissions. |
1256 if (high_rtt_nack_threshold_ms_ >= 0 && | 1258 if (high_rtt_nack_threshold_ms_ >= 0 && |
1257 rtt_ms_ >= high_rtt_nack_threshold_ms_) { | 1259 rtt_ms_ >= high_rtt_nack_threshold_ms_) { |
1258 return false; | 1260 return false; |
1259 } | 1261 } |
1260 return true; | 1262 return true; |
1261 } | 1263 } |
1262 } // namespace webrtc | 1264 } // namespace webrtc |
OLD | NEW |