| 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 index = seq_num % size_; | 59 index = seq_num % size_; |
| 60 | 60 |
| 61 // Packet buffer is still full. | 61 // Packet buffer is still full. |
| 62 if (sequence_buffer_[index].used) | 62 if (sequence_buffer_[index].used) |
| 63 return false; | 63 return false; |
| 64 } | 64 } |
| 65 | 65 |
| 66 if (AheadOf(seq_num, last_seq_num_)) | 66 if (AheadOf(seq_num, last_seq_num_)) |
| 67 last_seq_num_ = seq_num; | 67 last_seq_num_ = seq_num; |
| 68 | 68 |
| 69 // If this is a padding or FEC packet, don't insert it. |
| 70 if (packet.sizeBytes == 0) { |
| 71 reference_finder_.PaddingReceived(packet.seqNum); |
| 72 return true; |
| 73 } |
| 74 |
| 69 sequence_buffer_[index].frame_begin = packet.isFirstPacket; | 75 sequence_buffer_[index].frame_begin = packet.isFirstPacket; |
| 70 sequence_buffer_[index].frame_end = packet.markerBit; | 76 sequence_buffer_[index].frame_end = packet.markerBit; |
| 71 sequence_buffer_[index].seq_num = packet.seqNum; | 77 sequence_buffer_[index].seq_num = packet.seqNum; |
| 72 sequence_buffer_[index].continuous = false; | 78 sequence_buffer_[index].continuous = false; |
| 73 sequence_buffer_[index].frame_created = false; | 79 sequence_buffer_[index].frame_created = false; |
| 74 sequence_buffer_[index].used = true; | 80 sequence_buffer_[index].used = true; |
| 75 data_buffer_[index] = packet; | 81 data_buffer_[index] = packet; |
| 76 | 82 |
| 77 FindFrames(seq_num); | 83 FindFrames(seq_num); |
| 78 return true; | 84 return true; |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 void PacketBuffer::Clear() { | 230 void PacketBuffer::Clear() { |
| 225 rtc::CritScope lock(&crit_); | 231 rtc::CritScope lock(&crit_); |
| 226 for (size_t i = 0; i < size_; ++i) | 232 for (size_t i = 0; i < size_; ++i) |
| 227 sequence_buffer_[i].used = false; | 233 sequence_buffer_[i].used = false; |
| 228 | 234 |
| 229 first_packet_received_ = false; | 235 first_packet_received_ = false; |
| 230 } | 236 } |
| 231 | 237 |
| 232 } // namespace video_coding | 238 } // namespace video_coding |
| 233 } // namespace webrtc | 239 } // namespace webrtc |
| OLD | NEW |