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

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

Issue 2589743002: Make OverheadObserver::OnOverheadChanged count RTP headers only (Closed)
Patch Set: Add explicit cast. 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
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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 if (flexfec_enabled()) 330 if (flexfec_enabled())
331 flexfec_sender_->SetFecParameters(fec_params); 331 flexfec_sender_->SetFecParameters(fec_params);
332 if (ulpfec_enabled()) 332 if (ulpfec_enabled())
333 ulpfec_generator_.SetFecParameters(fec_params); 333 ulpfec_generator_.SetFecParameters(fec_params);
334 334
335 fec_packet_overhead = CalculateFecPacketOverhead(); 335 fec_packet_overhead = CalculateFecPacketOverhead();
336 red_enabled = this->red_enabled(); 336 red_enabled = this->red_enabled();
337 retransmission_settings = retransmission_settings_; 337 retransmission_settings = retransmission_settings_;
338 } 338 }
339 339
340 size_t packet_capacity = rtp_sender_->MaxPayloadLength() - 340 size_t packet_capacity = rtp_sender_->MaxRtpPacketSize() -
341 fec_packet_overhead - 341 fec_packet_overhead -
342 (rtp_sender_->RtxStatus() ? kRtxHeaderSize : 0); 342 (rtp_sender_->RtxStatus() ? kRtxHeaderSize : 0);
343 RTC_DCHECK_LE(packet_capacity, rtp_header->capacity()); 343 RTC_DCHECK_LE(packet_capacity, rtp_header->capacity());
344 RTC_DCHECK_GT(packet_capacity, rtp_header->headers_size()); 344 RTC_DCHECK_GT(packet_capacity, rtp_header->headers_size());
345 size_t max_data_payload_length = packet_capacity - rtp_header->headers_size(); 345 size_t max_data_payload_length = packet_capacity - rtp_header->headers_size();
346 346
347 std::unique_ptr<RtpPacketizer> packetizer(RtpPacketizer::Create( 347 std::unique_ptr<RtpPacketizer> packetizer(RtpPacketizer::Create(
348 video_type, max_data_payload_length, 348 video_type, max_data_payload_length,
349 video_header ? &(video_header->codecHeader) : nullptr, frame_type)); 349 video_header ? &(video_header->codecHeader) : nullptr, frame_type));
350 // Media packet storage. 350 // Media packet storage.
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 rtc::CritScope cs(&crit_); 415 rtc::CritScope cs(&crit_);
416 return retransmission_settings_; 416 return retransmission_settings_;
417 } 417 }
418 418
419 void RTPSenderVideo::SetSelectiveRetransmissions(uint8_t settings) { 419 void RTPSenderVideo::SetSelectiveRetransmissions(uint8_t settings) {
420 rtc::CritScope cs(&crit_); 420 rtc::CritScope cs(&crit_);
421 retransmission_settings_ = settings; 421 retransmission_settings_ = settings;
422 } 422 }
423 423
424 } // namespace webrtc 424 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc ('k') | webrtc/modules/rtp_rtcp/test/testAPI/test_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698