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

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtcp_sender.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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 ssrc_(0), 169 ssrc_(0),
170 remote_ssrc_(0), 170 remote_ssrc_(0),
171 receive_statistics_(receive_statistics), 171 receive_statistics_(receive_statistics),
172 172
173 sequence_number_fir_(0), 173 sequence_number_fir_(0),
174 174
175 remb_bitrate_(0), 175 remb_bitrate_(0),
176 176
177 tmmbr_send_bps_(0), 177 tmmbr_send_bps_(0),
178 packet_oh_send_(0), 178 packet_oh_send_(0),
179 max_payload_length_(IP_PACKET_SIZE - 28), // IPv4 + UDP by default. 179 max_packet_size_(IP_PACKET_SIZE - 28), // IPv4 + UDP by default.
180 180
181 app_sub_type_(0), 181 app_sub_type_(0),
182 app_name_(0), 182 app_name_(0),
183 app_data_(nullptr), 183 app_data_(nullptr),
184 app_length_(0), 184 app_length_(0),
185 185
186 xr_send_receiver_reference_time_enabled_(false), 186 xr_send_receiver_reference_time_enabled_(false),
187 packet_type_counter_observer_(packet_type_counter_observer) { 187 packet_type_counter_observer_(packet_type_counter_observer) {
188 RTC_DCHECK(transport_ != nullptr); 188 RTC_DCHECK(transport_ != nullptr);
189 189
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 276
277 void RTCPSender::SetTMMBRStatus(bool enable) { 277 void RTCPSender::SetTMMBRStatus(bool enable) {
278 rtc::CritScope lock(&critical_section_rtcp_sender_); 278 rtc::CritScope lock(&critical_section_rtcp_sender_);
279 if (enable) { 279 if (enable) {
280 SetFlag(RTCPPacketType::kRtcpTmmbr, false); 280 SetFlag(RTCPPacketType::kRtcpTmmbr, false);
281 } else { 281 } else {
282 ConsumeFlag(RTCPPacketType::kRtcpTmmbr, true); 282 ConsumeFlag(RTCPPacketType::kRtcpTmmbr, true);
283 } 283 }
284 } 284 }
285 285
286 void RTCPSender::SetMaxPayloadLength(size_t max_payload_length) { 286 void RTCPSender::SetMaxRtpPacketSize(size_t max_packet_size) {
287 max_payload_length_ = max_payload_length; 287 max_packet_size_ = max_packet_size;
288 } 288 }
289 289
290 void RTCPSender::SetTimestampOffset(uint32_t timestamp_offset) { 290 void RTCPSender::SetTimestampOffset(uint32_t timestamp_offset) {
291 rtc::CritScope lock(&critical_section_rtcp_sender_); 291 rtc::CritScope lock(&critical_section_rtcp_sender_);
292 timestamp_offset_ = timestamp_offset; 292 timestamp_offset_ = timestamp_offset;
293 } 293 }
294 294
295 void RTCPSender::SetLastRtpTime(uint32_t rtp_timestamp, 295 void RTCPSender::SetLastRtpTime(uint32_t rtp_timestamp,
296 int64_t capture_time_ms) { 296 int64_t capture_time_ms) {
297 rtc::CritScope lock(&critical_section_rtcp_sender_); 297 rtc::CritScope lock(&critical_section_rtcp_sender_);
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
821 } 821 }
822 822
823 if (packet_type_counter_observer_ != nullptr) { 823 if (packet_type_counter_observer_ != nullptr) {
824 packet_type_counter_observer_->RtcpPacketTypesCounterUpdated( 824 packet_type_counter_observer_->RtcpPacketTypesCounterUpdated(
825 remote_ssrc_, packet_type_counter_); 825 remote_ssrc_, packet_type_counter_);
826 } 826 }
827 827
828 RTC_DCHECK(AllVolatileFlagsConsumed()); 828 RTC_DCHECK(AllVolatileFlagsConsumed());
829 } 829 }
830 830
831 size_t bytes_sent = container.SendPackets(max_payload_length_); 831 size_t bytes_sent = container.SendPackets(max_packet_size_);
832 return bytes_sent == 0 ? -1 : 0; 832 return bytes_sent == 0 ? -1 : 0;
833 } 833 }
834 834
835 void RTCPSender::PrepareReport(const FeedbackState& feedback_state) { 835 void RTCPSender::PrepareReport(const FeedbackState& feedback_state) {
836 bool generate_report; 836 bool generate_report;
837 if (IsFlagPresent(kRtcpSr) || IsFlagPresent(kRtcpRr)) { 837 if (IsFlagPresent(kRtcpSr) || IsFlagPresent(kRtcpRr)) {
838 // Report type already explicitly set, don't automatically populate. 838 // Report type already explicitly set, don't automatically populate.
839 generate_report = true; 839 generate_report = true;
840 RTC_DCHECK(ConsumeFlag(kRtcpReport) == false); 840 RTC_DCHECK(ConsumeFlag(kRtcpReport) == false);
841 } else { 841 } else {
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
1042 } 1042 }
1043 1043
1044 Transport* const transport_; 1044 Transport* const transport_;
1045 RtcEventLog* const event_log_; 1045 RtcEventLog* const event_log_;
1046 bool send_failure_; 1046 bool send_failure_;
1047 // TODO(terelius): We would like to 1047 // TODO(terelius): We would like to
1048 // RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(Sender); 1048 // RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(Sender);
1049 // but we can't because of an incorrect warning (C4822) in MVS 2013. 1049 // but we can't because of an incorrect warning (C4822) in MVS 2013.
1050 } sender(transport_, event_log_); 1050 } sender(transport_, event_log_);
1051 1051
1052 RTC_DCHECK_LE(max_payload_length_, IP_PACKET_SIZE); 1052 RTC_DCHECK_LE(max_packet_size_, IP_PACKET_SIZE);
1053 uint8_t buffer[IP_PACKET_SIZE]; 1053 uint8_t buffer[IP_PACKET_SIZE];
1054 return packet.BuildExternalBuffer(buffer, max_payload_length_, &sender) && 1054 return packet.BuildExternalBuffer(buffer, max_packet_size_, &sender) &&
1055 !sender.send_failure_; 1055 !sender.send_failure_;
1056 } 1056 }
1057 1057
1058 } // namespace webrtc 1058 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_sender.h ('k') | webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698