OLD | NEW |
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 transport_feedback_callback(nullptr), | 56 transport_feedback_callback(nullptr), |
57 rtt_stats(nullptr), | 57 rtt_stats(nullptr), |
58 rtcp_packet_type_counter_observer(nullptr), | 58 rtcp_packet_type_counter_observer(nullptr), |
59 remote_bitrate_estimator(nullptr), | 59 remote_bitrate_estimator(nullptr), |
60 paced_sender(nullptr), | 60 paced_sender(nullptr), |
61 transport_sequence_number_allocator(nullptr), | 61 transport_sequence_number_allocator(nullptr), |
62 send_bitrate_observer(nullptr), | 62 send_bitrate_observer(nullptr), |
63 send_frame_count_observer(nullptr), | 63 send_frame_count_observer(nullptr), |
64 send_side_delay_observer(nullptr), | 64 send_side_delay_observer(nullptr), |
65 event_log(nullptr), | 65 event_log(nullptr), |
66 send_packet_observer(nullptr) {} | 66 send_packet_observer(nullptr), |
| 67 retransmission_rate_limiter(nullptr) {} |
67 | 68 |
68 RtpRtcp* RtpRtcp::CreateRtpRtcp(const RtpRtcp::Configuration& configuration) { | 69 RtpRtcp* RtpRtcp::CreateRtpRtcp(const RtpRtcp::Configuration& configuration) { |
69 if (configuration.clock) { | 70 if (configuration.clock) { |
70 return new ModuleRtpRtcpImpl(configuration); | 71 return new ModuleRtpRtcpImpl(configuration); |
71 } else { | 72 } else { |
72 // No clock implementation provided, use default clock. | 73 // No clock implementation provided, use default clock. |
73 RtpRtcp::Configuration configuration_copy; | 74 RtpRtcp::Configuration configuration_copy; |
74 memcpy(&configuration_copy, &configuration, | 75 memcpy(&configuration_copy, &configuration, |
75 sizeof(RtpRtcp::Configuration)); | 76 sizeof(RtpRtcp::Configuration)); |
76 configuration_copy.clock = Clock::GetRealTimeClock(); | 77 configuration_copy.clock = Clock::GetRealTimeClock(); |
77 return new ModuleRtpRtcpImpl(configuration_copy); | 78 return new ModuleRtpRtcpImpl(configuration_copy); |
78 } | 79 } |
79 } | 80 } |
80 | 81 |
81 ModuleRtpRtcpImpl::ModuleRtpRtcpImpl(const Configuration& configuration) | 82 ModuleRtpRtcpImpl::ModuleRtpRtcpImpl(const Configuration& configuration) |
82 : rtp_sender_(configuration.audio, | 83 : rtp_sender_(configuration.audio, |
83 configuration.clock, | 84 configuration.clock, |
84 configuration.outgoing_transport, | 85 configuration.outgoing_transport, |
85 configuration.paced_sender, | 86 configuration.paced_sender, |
86 configuration.transport_sequence_number_allocator, | 87 configuration.transport_sequence_number_allocator, |
87 configuration.transport_feedback_callback, | 88 configuration.transport_feedback_callback, |
88 configuration.send_bitrate_observer, | 89 configuration.send_bitrate_observer, |
89 configuration.send_frame_count_observer, | 90 configuration.send_frame_count_observer, |
90 configuration.send_side_delay_observer, | 91 configuration.send_side_delay_observer, |
91 configuration.event_log, | 92 configuration.event_log, |
92 configuration.send_packet_observer), | 93 configuration.send_packet_observer, |
| 94 configuration.retransmission_rate_limiter), |
93 rtcp_sender_(configuration.audio, | 95 rtcp_sender_(configuration.audio, |
94 configuration.clock, | 96 configuration.clock, |
95 configuration.receive_statistics, | 97 configuration.receive_statistics, |
96 configuration.rtcp_packet_type_counter_observer, | 98 configuration.rtcp_packet_type_counter_observer, |
97 configuration.event_log, | 99 configuration.event_log, |
98 configuration.outgoing_transport), | 100 configuration.outgoing_transport), |
99 rtcp_receiver_(configuration.clock, | 101 rtcp_receiver_(configuration.clock, |
100 configuration.receiver_only, | 102 configuration.receiver_only, |
101 configuration.rtcp_packet_type_counter_observer, | 103 configuration.rtcp_packet_type_counter_observer, |
102 configuration.bandwidth_callback, | 104 configuration.bandwidth_callback, |
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 int32_t ModuleRtpRtcpImpl::SetSendREDPayloadType( | 815 int32_t ModuleRtpRtcpImpl::SetSendREDPayloadType( |
814 const int8_t payload_type) { | 816 const int8_t payload_type) { |
815 return rtp_sender_.SetRED(payload_type); | 817 return rtp_sender_.SetRED(payload_type); |
816 } | 818 } |
817 | 819 |
818 // Get payload type for Redundant Audio Data RFC 2198. | 820 // Get payload type for Redundant Audio Data RFC 2198. |
819 int32_t ModuleRtpRtcpImpl::SendREDPayloadType(int8_t* payload_type) const { | 821 int32_t ModuleRtpRtcpImpl::SendREDPayloadType(int8_t* payload_type) const { |
820 return rtp_sender_.RED(payload_type); | 822 return rtp_sender_.RED(payload_type); |
821 } | 823 } |
822 | 824 |
823 void ModuleRtpRtcpImpl::SetTargetSendBitrate(uint32_t bitrate_bps) { | |
824 rtp_sender_.SetTargetBitrate(bitrate_bps); | |
825 } | |
826 | |
827 int32_t ModuleRtpRtcpImpl::SetKeyFrameRequestMethod( | 825 int32_t ModuleRtpRtcpImpl::SetKeyFrameRequestMethod( |
828 const KeyFrameRequestMethod method) { | 826 const KeyFrameRequestMethod method) { |
829 key_frame_req_method_ = method; | 827 key_frame_req_method_ = method; |
830 return 0; | 828 return 0; |
831 } | 829 } |
832 | 830 |
833 int32_t ModuleRtpRtcpImpl::RequestKeyFrame() { | 831 int32_t ModuleRtpRtcpImpl::RequestKeyFrame() { |
834 switch (key_frame_req_method_) { | 832 switch (key_frame_req_method_) { |
835 case kKeyFrameReqPliRtcp: | 833 case kKeyFrameReqPliRtcp: |
836 return SendRTCP(kRtcpPli); | 834 return SendRTCP(kRtcpPli); |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
996 void ModuleRtpRtcpImpl::RegisterSendChannelRtpStatisticsCallback( | 994 void ModuleRtpRtcpImpl::RegisterSendChannelRtpStatisticsCallback( |
997 StreamDataCountersCallback* callback) { | 995 StreamDataCountersCallback* callback) { |
998 rtp_sender_.RegisterRtpStatisticsCallback(callback); | 996 rtp_sender_.RegisterRtpStatisticsCallback(callback); |
999 } | 997 } |
1000 | 998 |
1001 StreamDataCountersCallback* | 999 StreamDataCountersCallback* |
1002 ModuleRtpRtcpImpl::GetSendChannelRtpStatisticsCallback() const { | 1000 ModuleRtpRtcpImpl::GetSendChannelRtpStatisticsCallback() const { |
1003 return rtp_sender_.GetRtpStatisticsCallback(); | 1001 return rtp_sender_.GetRtpStatisticsCallback(); |
1004 } | 1002 } |
1005 } // namespace webrtc | 1003 } // namespace webrtc |
OLD | NEW |