Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Side by Side Diff: webrtc/modules/rtp_rtcp/source/fec_receiver_impl.cc

Issue 2080553003: Style updates for ForwardErrorCorrection and related classes (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Re-add <iterator> in forward_error_correction.cc. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
11 #include "webrtc/modules/rtp_rtcp/source/fec_receiver_impl.h" 11 #include "webrtc/modules/rtp_rtcp/source/fec_receiver_impl.h"
12 12
13 #include <assert.h>
14
15 #include <memory> 13 #include <memory>
16 14
15 #include "webrtc/base/checks.h"
17 #include "webrtc/base/logging.h" 16 #include "webrtc/base/logging.h"
18 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" 17 #include "webrtc/modules/rtp_rtcp/source/byte_io.h"
19 #include "webrtc/modules/rtp_rtcp/source/rtp_receiver_video.h" 18 #include "webrtc/modules/rtp_rtcp/source/rtp_receiver_video.h"
20 19
21 // RFC 5109 20 // RFC 5109
22 namespace webrtc { 21 namespace webrtc {
23 22
24 FecReceiver* FecReceiver::Create(RtpData* callback) { 23 FecReceiver* FecReceiver::Create(RtpData* callback) {
25 return new FecReceiverImpl(callback); 24 return new FecReceiverImpl(callback);
26 } 25 }
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 if (!recovered_packet_callback_->OnRecoveredPacket(packet->data, 227 if (!recovered_packet_callback_->OnRecoveredPacket(packet->data,
229 packet->length)) { 228 packet->length)) {
230 return -1; 229 return -1;
231 } 230 }
232 crit_sect_.Enter(); 231 crit_sect_.Enter();
233 } 232 }
234 if (fec_->DecodeFEC(&received_packet_list_, &recovered_packet_list_) != 0) { 233 if (fec_->DecodeFEC(&received_packet_list_, &recovered_packet_list_) != 0) {
235 crit_sect_.Leave(); 234 crit_sect_.Leave();
236 return -1; 235 return -1;
237 } 236 }
238 assert(received_packet_list_.empty()); 237 RTC_DCHECK(received_packet_list_.empty());
239 } 238 }
240 // Send any recovered media packets to VCM. 239 // Send any recovered media packets to VCM.
241 ForwardErrorCorrection::RecoveredPacketList::iterator it = 240 for(auto* recovered_packet : recovered_packet_list_) {
242 recovered_packet_list_.begin(); 241 if (recovered_packet->returned) {
243 for (; it != recovered_packet_list_.end(); ++it) { 242 // Already sent to the VCM and the jitter buffer.
244 if ((*it)->returned) // Already sent to the VCM and the jitter buffer.
245 continue; 243 continue;
246 ForwardErrorCorrection::Packet* packet = (*it)->pkt; 244 }
245 ForwardErrorCorrection::Packet* packet = recovered_packet->pkt;
247 ++packet_counter_.num_recovered_packets; 246 ++packet_counter_.num_recovered_packets;
248 crit_sect_.Leave(); 247 crit_sect_.Leave();
249 if (!recovered_packet_callback_->OnRecoveredPacket(packet->data, 248 if (!recovered_packet_callback_->OnRecoveredPacket(packet->data,
250 packet->length)) { 249 packet->length)) {
251 return -1; 250 return -1;
252 } 251 }
253 crit_sect_.Enter(); 252 crit_sect_.Enter();
254 (*it)->returned = true; 253 recovered_packet->returned = true;
255 } 254 }
256 crit_sect_.Leave(); 255 crit_sect_.Leave();
257 return 0; 256 return 0;
258 } 257 }
259 258
260 } // namespace webrtc 259 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698