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

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

Issue 2649913002: Count FlexFEC packets in |fec_bitrate_| in RTPSenderVideo. (Closed)
Patch Set: danilchap comments 2. Created 3 years, 11 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/modules/rtp_rtcp/source/rtp_sender_unittest.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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 191
192 if (protect_media_packet) 192 if (protect_media_packet)
193 flexfec_sender_->AddRtpPacketAndGenerateFec(*media_packet); 193 flexfec_sender_->AddRtpPacketAndGenerateFec(*media_packet);
194 194
195 SendVideoPacket(std::move(media_packet), media_packet_storage); 195 SendVideoPacket(std::move(media_packet), media_packet_storage);
196 196
197 if (flexfec_sender_->FecAvailable()) { 197 if (flexfec_sender_->FecAvailable()) {
198 std::vector<std::unique_ptr<RtpPacketToSend>> fec_packets = 198 std::vector<std::unique_ptr<RtpPacketToSend>> fec_packets =
199 flexfec_sender_->GetFecPackets(); 199 flexfec_sender_->GetFecPackets();
200 for (auto& fec_packet : fec_packets) { 200 for (auto& fec_packet : fec_packets) {
201 size_t packet_length = fec_packet->size();
201 uint32_t timestamp = fec_packet->Timestamp(); 202 uint32_t timestamp = fec_packet->Timestamp();
202 uint16_t seq_num = fec_packet->SequenceNumber(); 203 uint16_t seq_num = fec_packet->SequenceNumber();
203 if (rtp_sender_->SendToNetwork(std::move(fec_packet), kDontRetransmit, 204 if (rtp_sender_->SendToNetwork(std::move(fec_packet), kDontRetransmit,
204 RtpPacketSender::kLowPriority)) { 205 RtpPacketSender::kLowPriority)) {
205 // TODO(brandtr): Wire up stats here. 206 rtc::CritScope cs(&stats_crit_);
207 fec_bitrate_.Update(packet_length, clock_->TimeInMilliseconds());
206 TRACE_EVENT_INSTANT2(TRACE_DISABLED_BY_DEFAULT("webrtc_rtp"), 208 TRACE_EVENT_INSTANT2(TRACE_DISABLED_BY_DEFAULT("webrtc_rtp"),
207 "Video::PacketFlexfec", "timestamp", timestamp, 209 "Video::PacketFlexfec", "timestamp", timestamp,
208 "seqnum", seq_num); 210 "seqnum", seq_num);
209 } else { 211 } else {
210 LOG(LS_WARNING) << "Failed to send FlexFEC packet " << seq_num; 212 LOG(LS_WARNING) << "Failed to send FlexFEC packet " << seq_num;
211 } 213 }
212 } 214 }
213 } 215 }
214 } 216 }
215 217
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 rtc::CritScope cs(&crit_); 417 rtc::CritScope cs(&crit_);
416 return retransmission_settings_; 418 return retransmission_settings_;
417 } 419 }
418 420
419 void RTPSenderVideo::SetSelectiveRetransmissions(uint8_t settings) { 421 void RTPSenderVideo::SetSelectiveRetransmissions(uint8_t settings) {
420 rtc::CritScope cs(&crit_); 422 rtc::CritScope cs(&crit_);
421 retransmission_settings_ = settings; 423 retransmission_settings_ = settings;
422 } 424 }
423 425
424 } // namespace webrtc 426 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698