| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 int NackModule::OnReceivedPacket(const VCMPacket& packet) { | 59 int NackModule::OnReceivedPacket(const VCMPacket& packet) { |
| 60 rtc::CritScope lock(&crit_); | 60 rtc::CritScope lock(&crit_); |
| 61 if (!running_) | 61 if (!running_) |
| 62 return -1; | 62 return -1; |
| 63 uint16_t seq_num = packet.seqNum; | 63 uint16_t seq_num = packet.seqNum; |
| 64 // TODO(philipel): When the packet includes information whether it is | 64 // TODO(philipel): When the packet includes information whether it is |
| 65 // retransmitted or not, use that value instead. For | 65 // retransmitted or not, use that value instead. For |
| 66 // now set it to true, which will cause the reordering | 66 // now set it to true, which will cause the reordering |
| 67 // statistics to never be updated. | 67 // statistics to never be updated. |
| 68 bool is_retransmitted = true; | 68 bool is_retransmitted = true; |
| 69 bool is_keyframe = | 69 bool is_keyframe = packet.isFirstPacket && packet.frameType == kVideoFrameKey; |
| 70 packet.is_first_packet_in_frame && packet.frameType == kVideoFrameKey; | |
| 71 | 70 |
| 72 if (!initialized_) { | 71 if (!initialized_) { |
| 73 newest_seq_num_ = seq_num; | 72 newest_seq_num_ = seq_num; |
| 74 if (is_keyframe) | 73 if (is_keyframe) |
| 75 keyframe_list_.insert(seq_num); | 74 keyframe_list_.insert(seq_num); |
| 76 initialized_ = true; | 75 initialized_ = true; |
| 77 return 0; | 76 return 0; |
| 78 } | 77 } |
| 79 | 78 |
| 80 // Since the |newest_seq_num_| is a packet we have actually received we know | 79 // Since the |newest_seq_num_| is a packet we have actually received we know |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 reordering_histogram_.Add(diff); | 261 reordering_histogram_.Add(diff); |
| 263 } | 262 } |
| 264 | 263 |
| 265 int NackModule::WaitNumberOfPackets(float probability) const { | 264 int NackModule::WaitNumberOfPackets(float probability) const { |
| 266 if (reordering_histogram_.NumValues() == 0) | 265 if (reordering_histogram_.NumValues() == 0) |
| 267 return 0; | 266 return 0; |
| 268 return reordering_histogram_.InverseCdf(probability); | 267 return reordering_histogram_.InverseCdf(probability); |
| 269 } | 268 } |
| 270 | 269 |
| 271 } // namespace webrtc | 270 } // namespace webrtc |
| OLD | NEW |