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 = packet.isFirstPacket && packet.frameType == kVideoFrameKey; | 69 bool is_keyframe = |
| 70 packet.is_first_packet_in_frame && packet.frameType == kVideoFrameKey; |
70 | 71 |
71 if (!initialized_) { | 72 if (!initialized_) { |
72 newest_seq_num_ = seq_num; | 73 newest_seq_num_ = seq_num; |
73 if (is_keyframe) | 74 if (is_keyframe) |
74 keyframe_list_.insert(seq_num); | 75 keyframe_list_.insert(seq_num); |
75 initialized_ = true; | 76 initialized_ = true; |
76 return 0; | 77 return 0; |
77 } | 78 } |
78 | 79 |
79 // Since the |newest_seq_num_| is a packet we have actually received we know | 80 // 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... |
261 reordering_histogram_.Add(diff); | 262 reordering_histogram_.Add(diff); |
262 } | 263 } |
263 | 264 |
264 int NackModule::WaitNumberOfPackets(float probability) const { | 265 int NackModule::WaitNumberOfPackets(float probability) const { |
265 if (reordering_histogram_.NumValues() == 0) | 266 if (reordering_histogram_.NumValues() == 0) |
266 return 0; | 267 return 0; |
267 return reordering_histogram_.InverseCdf(probability); | 268 return reordering_histogram_.InverseCdf(probability); |
268 } | 269 } |
269 | 270 |
270 } // namespace webrtc | 271 } // namespace webrtc |
OLD | NEW |