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 | 10 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 bool RTPPacketHistory::StorePackets() const { | 69 bool RTPPacketHistory::StorePackets() const { |
70 CriticalSectionScoped cs(critsect_.get()); | 70 CriticalSectionScoped cs(critsect_.get()); |
71 return store_; | 71 return store_; |
72 } | 72 } |
73 | 73 |
74 int32_t RTPPacketHistory::PutRTPPacket(const uint8_t* packet, | 74 int32_t RTPPacketHistory::PutRTPPacket(const uint8_t* packet, |
75 size_t packet_length, | 75 size_t packet_length, |
76 int64_t capture_time_ms, | 76 int64_t capture_time_ms, |
77 StorageType type) { | 77 StorageType type) { |
78 if (type == kDontStore) { | |
79 return 0; | |
80 } | |
81 | |
82 CriticalSectionScoped cs(critsect_.get()); | 78 CriticalSectionScoped cs(critsect_.get()); |
83 if (!store_) { | 79 if (!store_) { |
84 return 0; | 80 return 0; |
85 } | 81 } |
86 | 82 |
87 assert(packet); | 83 assert(packet); |
88 assert(packet_length > 3); | 84 assert(packet_length > 3); |
89 | 85 |
90 if (packet_length > IP_PACKET_SIZE) { | 86 if (packet_length > IP_PACKET_SIZE) { |
91 LOG(LS_WARNING) << "Failed to store RTP packet with length: " | 87 LOG(LS_WARNING) << "Failed to store RTP packet with length: " |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 min_diff = diff; | 284 min_diff = diff; |
289 best_index = static_cast<int>(i); | 285 best_index = static_cast<int>(i); |
290 } | 286 } |
291 } | 287 } |
292 return best_index; | 288 return best_index; |
293 } | 289 } |
294 | 290 |
295 RTPPacketHistory::StoredPacket::StoredPacket() {} | 291 RTPPacketHistory::StoredPacket::StoredPacket() {} |
296 | 292 |
297 } // namespace webrtc | 293 } // namespace webrtc |
OLD | NEW |