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

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

Issue 2495553002: Add overhead per packet observer to the rtp_sender. (Closed)
Patch Set: Rebased. Created 4 years, 1 month 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/include/rtp_rtcp.h ('k') | webrtc/modules/rtp_rtcp/source/rtp_sender.h » ('j') | 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 configuration.outgoing_transport, 75 configuration.outgoing_transport,
76 configuration.paced_sender, 76 configuration.paced_sender,
77 configuration.flexfec_sender, 77 configuration.flexfec_sender,
78 configuration.transport_sequence_number_allocator, 78 configuration.transport_sequence_number_allocator,
79 configuration.transport_feedback_callback, 79 configuration.transport_feedback_callback,
80 configuration.send_bitrate_observer, 80 configuration.send_bitrate_observer,
81 configuration.send_frame_count_observer, 81 configuration.send_frame_count_observer,
82 configuration.send_side_delay_observer, 82 configuration.send_side_delay_observer,
83 configuration.event_log, 83 configuration.event_log,
84 configuration.send_packet_observer, 84 configuration.send_packet_observer,
85 configuration.retransmission_rate_limiter), 85 configuration.retransmission_rate_limiter,
86 configuration.overhead_observer),
86 rtcp_sender_(configuration.audio, 87 rtcp_sender_(configuration.audio,
87 configuration.clock, 88 configuration.clock,
88 configuration.receive_statistics, 89 configuration.receive_statistics,
89 configuration.rtcp_packet_type_counter_observer, 90 configuration.rtcp_packet_type_counter_observer,
90 configuration.event_log, 91 configuration.event_log,
91 configuration.outgoing_transport), 92 configuration.outgoing_transport),
92 rtcp_receiver_(configuration.clock, 93 rtcp_receiver_(configuration.clock,
93 configuration.receiver_only, 94 configuration.receiver_only,
94 configuration.rtcp_packet_type_counter_observer, 95 configuration.rtcp_packet_type_counter_observer,
95 configuration.bandwidth_callback, 96 configuration.bandwidth_callback,
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 return 0; 454 return 0;
454 } 455 }
455 456
456 void ModuleRtpRtcpImpl::SetTransportOverhead( 457 void ModuleRtpRtcpImpl::SetTransportOverhead(
457 int transport_overhead_per_packet) { 458 int transport_overhead_per_packet) {
458 RTC_DCHECK_GT(transport_overhead_per_packet, 0); 459 RTC_DCHECK_GT(transport_overhead_per_packet, 0);
459 int mtu = rtp_sender_.MaxPayloadLength() + packet_overhead_; 460 int mtu = rtp_sender_.MaxPayloadLength() + packet_overhead_;
460 RTC_DCHECK_LT(transport_overhead_per_packet, mtu); 461 RTC_DCHECK_LT(transport_overhead_per_packet, mtu);
461 size_t max_payload_length = mtu - transport_overhead_per_packet; 462 size_t max_payload_length = mtu - transport_overhead_per_packet;
462 packet_overhead_ = transport_overhead_per_packet; 463 packet_overhead_ = transport_overhead_per_packet;
464 rtp_sender_.SetTransportOverhead(packet_overhead_);
463 rtcp_sender_.SetMaxPayloadLength(max_payload_length); 465 rtcp_sender_.SetMaxPayloadLength(max_payload_length);
464 rtp_sender_.SetMaxPayloadLength(max_payload_length); 466 rtp_sender_.SetMaxPayloadLength(max_payload_length);
465 } 467 }
466 468
467 int32_t ModuleRtpRtcpImpl::SetMaxTransferUnit(uint16_t mtu) { 469 int32_t ModuleRtpRtcpImpl::SetMaxTransferUnit(uint16_t mtu) {
468 RTC_DCHECK_LE(mtu, IP_PACKET_SIZE) << "MTU too large: " << mtu; 470 RTC_DCHECK_LE(mtu, IP_PACKET_SIZE) << "MTU too large: " << mtu;
469 RTC_DCHECK_GT(mtu, packet_overhead_) << "MTU too small: " << mtu; 471 RTC_DCHECK_GT(mtu, packet_overhead_) << "MTU too small: " << mtu;
470 size_t max_payload_length = mtu - packet_overhead_; 472 size_t max_payload_length = mtu - packet_overhead_;
471 rtcp_sender_.SetMaxPayloadLength(max_payload_length); 473 rtcp_sender_.SetMaxPayloadLength(max_payload_length);
472 rtp_sender_.SetMaxPayloadLength(max_payload_length); 474 rtp_sender_.SetMaxPayloadLength(max_payload_length);
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
945 void ModuleRtpRtcpImpl::RegisterSendChannelRtpStatisticsCallback( 947 void ModuleRtpRtcpImpl::RegisterSendChannelRtpStatisticsCallback(
946 StreamDataCountersCallback* callback) { 948 StreamDataCountersCallback* callback) {
947 rtp_sender_.RegisterRtpStatisticsCallback(callback); 949 rtp_sender_.RegisterRtpStatisticsCallback(callback);
948 } 950 }
949 951
950 StreamDataCountersCallback* 952 StreamDataCountersCallback*
951 ModuleRtpRtcpImpl::GetSendChannelRtpStatisticsCallback() const { 953 ModuleRtpRtcpImpl::GetSendChannelRtpStatisticsCallback() const {
952 return rtp_sender_.GetRtpStatisticsCallback(); 954 return rtp_sender_.GetRtpStatisticsCallback();
953 } 955 }
954 } // namespace webrtc 956 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/include/rtp_rtcp.h ('k') | webrtc/modules/rtp_rtcp/source/rtp_sender.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698