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

Side by Side Diff: webrtc/video/vie_receiver.cc

Issue 1674663002: Initialize VideoSendStream members in constructor. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: feedback + test update Created 4 years, 10 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
« no previous file with comments | « webrtc/video/vie_channel.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 fec_receiver_(FecReceiver::Create(this)), 48 fec_receiver_(FecReceiver::Create(this)),
49 rtp_rtcp_(NULL), 49 rtp_rtcp_(NULL),
50 vcm_(module_vcm), 50 vcm_(module_vcm),
51 remote_bitrate_estimator_(remote_bitrate_estimator), 51 remote_bitrate_estimator_(remote_bitrate_estimator),
52 ntp_estimator_(new RemoteNtpTimeEstimator(clock_)), 52 ntp_estimator_(new RemoteNtpTimeEstimator(clock_)),
53 receiving_(false), 53 receiving_(false),
54 restored_packet_in_use_(false), 54 restored_packet_in_use_(false),
55 receiving_ast_enabled_(false), 55 receiving_ast_enabled_(false),
56 receiving_cvo_enabled_(false), 56 receiving_cvo_enabled_(false),
57 receiving_tsn_enabled_(false), 57 receiving_tsn_enabled_(false),
58 last_packet_log_ms_(-1) { 58 last_packet_log_ms_(-1) {}
59 assert(remote_bitrate_estimator);
60 }
61 59
62 ViEReceiver::~ViEReceiver() { 60 ViEReceiver::~ViEReceiver() {
63 UpdateHistograms(); 61 UpdateHistograms();
64 } 62 }
65 63
66 void ViEReceiver::UpdateHistograms() { 64 void ViEReceiver::UpdateHistograms() {
67 FecPacketCounter counter = fec_receiver_->GetPacketCounter(); 65 FecPacketCounter counter = fec_receiver_->GetPacketCounter();
68 if (counter.num_packets > 0) { 66 if (counter.num_packets > 0) {
69 RTC_HISTOGRAM_PERCENTAGE( 67 RTC_HISTOGRAM_PERCENTAGE(
70 "WebRTC.Video.ReceivedFecPacketsInPercent", 68 "WebRTC.Video.ReceivedFecPacketsInPercent",
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 return false; 237 return false;
240 } 238 }
241 header.payload_type_frequency = kVideoPayloadTypeFrequency; 239 header.payload_type_frequency = kVideoPayloadTypeFrequency;
242 bool in_order = IsPacketInOrder(header); 240 bool in_order = IsPacketInOrder(header);
243 return ReceivePacket(rtp_packet, rtp_packet_length, header, in_order); 241 return ReceivePacket(rtp_packet, rtp_packet_length, header, in_order);
244 } 242 }
245 243
246 bool ViEReceiver::DeliverRtp(const uint8_t* rtp_packet, 244 bool ViEReceiver::DeliverRtp(const uint8_t* rtp_packet,
247 size_t rtp_packet_length, 245 size_t rtp_packet_length,
248 const PacketTime& packet_time) { 246 const PacketTime& packet_time) {
247 RTC_DCHECK(remote_bitrate_estimator_);
stefan-webrtc 2016/02/11 12:28:06 Why not keep it up there to fail as early as possi
pbos-webrtc 2016/02/11 12:48:13 nullptr on the sender side, which shouldn't call D
249 { 248 {
250 rtc::CritScope lock(&receive_cs_); 249 rtc::CritScope lock(&receive_cs_);
251 if (!receiving_) { 250 if (!receiving_) {
252 return false; 251 return false;
253 } 252 }
254 } 253 }
255 254
256 RTPHeader header; 255 RTPHeader header;
257 if (!rtp_header_parser_->Parse(rtp_packet, rtp_packet_length, 256 if (!rtp_header_parser_->Parse(rtp_packet, rtp_packet_length,
258 &header)) { 257 &header)) {
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 rtp_receive_statistics_->GetStatistician(header.ssrc); 458 rtp_receive_statistics_->GetStatistician(header.ssrc);
460 if (!statistician) 459 if (!statistician)
461 return false; 460 return false;
462 // Check if this is a retransmission. 461 // Check if this is a retransmission.
463 int64_t min_rtt = 0; 462 int64_t min_rtt = 0;
464 rtp_rtcp_->RTT(rtp_receiver_->SSRC(), NULL, NULL, &min_rtt, NULL); 463 rtp_rtcp_->RTT(rtp_receiver_->SSRC(), NULL, NULL, &min_rtt, NULL);
465 return !in_order && 464 return !in_order &&
466 statistician->IsRetransmitOfOldPacket(header, min_rtt); 465 statistician->IsRetransmitOfOldPacket(header, min_rtt);
467 } 466 }
468 } // namespace webrtc 467 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/vie_channel.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698