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 21 matching lines...) Expand all Loading... |
32 | 32 |
33 namespace webrtc { | 33 namespace webrtc { |
34 | 34 |
35 std::unique_ptr<RtpRtcp> CreateRtpRtcpModule( | 35 std::unique_ptr<RtpRtcp> CreateRtpRtcpModule( |
36 ReceiveStatistics* receive_statistics, | 36 ReceiveStatistics* receive_statistics, |
37 Transport* outgoing_transport, | 37 Transport* outgoing_transport, |
38 RtcpRttStats* rtt_stats, | 38 RtcpRttStats* rtt_stats, |
39 RtcpPacketTypeCounterObserver* rtcp_packet_type_counter_observer, | 39 RtcpPacketTypeCounterObserver* rtcp_packet_type_counter_observer, |
40 RemoteBitrateEstimator* remote_bitrate_estimator, | 40 RemoteBitrateEstimator* remote_bitrate_estimator, |
41 RtpPacketSender* paced_sender, | 41 RtpPacketSender* paced_sender, |
42 TransportSequenceNumberAllocator* transport_sequence_number_allocator) { | 42 TransportSequenceNumberAllocator* transport_sequence_number_allocator, |
| 43 RateLimiter* retransmission_rate_limiter) { |
43 RtpRtcp::Configuration configuration; | 44 RtpRtcp::Configuration configuration; |
44 configuration.audio = false; | 45 configuration.audio = false; |
45 configuration.receiver_only = true; | 46 configuration.receiver_only = true; |
46 configuration.receive_statistics = receive_statistics; | 47 configuration.receive_statistics = receive_statistics; |
47 configuration.outgoing_transport = outgoing_transport; | 48 configuration.outgoing_transport = outgoing_transport; |
48 configuration.intra_frame_callback = nullptr; | 49 configuration.intra_frame_callback = nullptr; |
49 configuration.rtt_stats = rtt_stats; | 50 configuration.rtt_stats = rtt_stats; |
50 configuration.rtcp_packet_type_counter_observer = | 51 configuration.rtcp_packet_type_counter_observer = |
51 rtcp_packet_type_counter_observer; | 52 rtcp_packet_type_counter_observer; |
52 configuration.paced_sender = paced_sender; | 53 configuration.paced_sender = paced_sender; |
53 configuration.transport_sequence_number_allocator = | 54 configuration.transport_sequence_number_allocator = |
54 transport_sequence_number_allocator; | 55 transport_sequence_number_allocator; |
55 configuration.send_bitrate_observer = nullptr; | 56 configuration.send_bitrate_observer = nullptr; |
56 configuration.send_frame_count_observer = nullptr; | 57 configuration.send_frame_count_observer = nullptr; |
57 configuration.send_side_delay_observer = nullptr; | 58 configuration.send_side_delay_observer = nullptr; |
58 configuration.send_packet_observer = nullptr; | 59 configuration.send_packet_observer = nullptr; |
59 configuration.bandwidth_callback = nullptr; | 60 configuration.bandwidth_callback = nullptr; |
60 configuration.transport_feedback_callback = nullptr; | 61 configuration.transport_feedback_callback = nullptr; |
61 configuration.retransmission_rate_limiter = nullptr; | 62 configuration.retransmission_rate_limiter = retransmission_rate_limiter; |
62 | 63 |
63 std::unique_ptr<RtpRtcp> rtp_rtcp(RtpRtcp::CreateRtpRtcp(configuration)); | 64 std::unique_ptr<RtpRtcp> rtp_rtcp(RtpRtcp::CreateRtpRtcp(configuration)); |
64 rtp_rtcp->SetSendingStatus(false); | 65 rtp_rtcp->SetSendingStatus(false); |
65 rtp_rtcp->SetSendingMediaStatus(false); | 66 rtp_rtcp->SetSendingMediaStatus(false); |
66 rtp_rtcp->SetRTCPStatus(RtcpMode::kCompound); | 67 rtp_rtcp->SetRTCPStatus(RtcpMode::kCompound); |
67 | 68 |
68 return rtp_rtcp; | 69 return rtp_rtcp; |
69 } | 70 } |
70 | 71 |
71 static const int kPacketLogIntervalMs = 10000; | 72 static const int kPacketLogIntervalMs = 10000; |
72 | 73 |
73 RtpStreamReceiver::RtpStreamReceiver( | 74 RtpStreamReceiver::RtpStreamReceiver( |
74 vcm::VideoReceiver* video_receiver, | 75 vcm::VideoReceiver* video_receiver, |
75 RemoteBitrateEstimator* remote_bitrate_estimator, | 76 RemoteBitrateEstimator* remote_bitrate_estimator, |
76 Transport* transport, | 77 Transport* transport, |
77 RtcpRttStats* rtt_stats, | 78 RtcpRttStats* rtt_stats, |
78 PacedSender* paced_sender, | 79 PacedSender* paced_sender, |
79 PacketRouter* packet_router, | 80 PacketRouter* packet_router, |
80 VieRemb* remb, | 81 VieRemb* remb, |
81 const VideoReceiveStream::Config* config, | 82 const VideoReceiveStream::Config* config, |
82 ReceiveStatisticsProxy* receive_stats_proxy, | 83 ReceiveStatisticsProxy* receive_stats_proxy, |
83 ProcessThread* process_thread) | 84 ProcessThread* process_thread, |
| 85 RateLimiter* retransmission_rate_limiter) |
84 : clock_(Clock::GetRealTimeClock()), | 86 : clock_(Clock::GetRealTimeClock()), |
85 config_(*config), | 87 config_(*config), |
86 video_receiver_(video_receiver), | 88 video_receiver_(video_receiver), |
87 remote_bitrate_estimator_(remote_bitrate_estimator), | 89 remote_bitrate_estimator_(remote_bitrate_estimator), |
88 packet_router_(packet_router), | 90 packet_router_(packet_router), |
89 remb_(remb), | 91 remb_(remb), |
90 process_thread_(process_thread), | 92 process_thread_(process_thread), |
91 ntp_estimator_(clock_), | 93 ntp_estimator_(clock_), |
92 rtp_payload_registry_(RTPPayloadStrategy::CreateStrategy(false)), | 94 rtp_payload_registry_(RTPPayloadStrategy::CreateStrategy(false)), |
93 rtp_header_parser_(RtpHeaderParser::Create()), | 95 rtp_header_parser_(RtpHeaderParser::Create()), |
94 rtp_receiver_(RtpReceiver::CreateVideoReceiver(clock_, | 96 rtp_receiver_(RtpReceiver::CreateVideoReceiver(clock_, |
95 this, | 97 this, |
96 this, | 98 this, |
97 &rtp_payload_registry_)), | 99 &rtp_payload_registry_)), |
98 rtp_receive_statistics_(ReceiveStatistics::Create(clock_)), | 100 rtp_receive_statistics_(ReceiveStatistics::Create(clock_)), |
99 fec_receiver_(FecReceiver::Create(this)), | 101 fec_receiver_(FecReceiver::Create(this)), |
100 receiving_(false), | 102 receiving_(false), |
101 restored_packet_in_use_(false), | 103 restored_packet_in_use_(false), |
102 last_packet_log_ms_(-1), | 104 last_packet_log_ms_(-1), |
103 rtp_rtcp_(CreateRtpRtcpModule(rtp_receive_statistics_.get(), | 105 rtp_rtcp_(CreateRtpRtcpModule(rtp_receive_statistics_.get(), |
104 transport, | 106 transport, |
105 rtt_stats, | 107 rtt_stats, |
106 receive_stats_proxy, | 108 receive_stats_proxy, |
107 remote_bitrate_estimator_, | 109 remote_bitrate_estimator_, |
108 paced_sender, | 110 paced_sender, |
109 packet_router)) { | 111 packet_router, |
| 112 retransmission_rate_limiter)) { |
110 packet_router_->AddRtpModule(rtp_rtcp_.get()); | 113 packet_router_->AddRtpModule(rtp_rtcp_.get()); |
111 rtp_receive_statistics_->RegisterRtpStatisticsCallback(receive_stats_proxy); | 114 rtp_receive_statistics_->RegisterRtpStatisticsCallback(receive_stats_proxy); |
112 rtp_receive_statistics_->RegisterRtcpStatisticsCallback(receive_stats_proxy); | 115 rtp_receive_statistics_->RegisterRtcpStatisticsCallback(receive_stats_proxy); |
113 | 116 |
114 RTC_DCHECK(config_.rtp.rtcp_mode != RtcpMode::kOff) | 117 RTC_DCHECK(config_.rtp.rtcp_mode != RtcpMode::kOff) |
115 << "A stream should not be configured with RTCP disabled. This value is " | 118 << "A stream should not be configured with RTCP disabled. This value is " |
116 "reserved for internal usage."; | 119 "reserved for internal usage."; |
117 RTC_DCHECK(config_.rtp.remote_ssrc != 0); | 120 RTC_DCHECK(config_.rtp.remote_ssrc != 0); |
118 // TODO(pbos): What's an appropriate local_ssrc for receive-only streams? | 121 // TODO(pbos): What's an appropriate local_ssrc for receive-only streams? |
119 RTC_DCHECK(config_.rtp.local_ssrc != 0); | 122 RTC_DCHECK(config_.rtp.local_ssrc != 0); |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 const std::string& extension, int id) { | 538 const std::string& extension, int id) { |
536 // One-byte-extension local identifiers are in the range 1-14 inclusive. | 539 // One-byte-extension local identifiers are in the range 1-14 inclusive. |
537 RTC_DCHECK_GE(id, 1); | 540 RTC_DCHECK_GE(id, 1); |
538 RTC_DCHECK_LE(id, 14); | 541 RTC_DCHECK_LE(id, 14); |
539 RTC_DCHECK(RtpExtension::IsSupportedForVideo(extension)); | 542 RTC_DCHECK(RtpExtension::IsSupportedForVideo(extension)); |
540 RTC_CHECK(rtp_header_parser_->RegisterRtpHeaderExtension( | 543 RTC_CHECK(rtp_header_parser_->RegisterRtpHeaderExtension( |
541 StringToRtpExtensionType(extension), id)); | 544 StringToRtpExtensionType(extension), id)); |
542 } | 545 } |
543 | 546 |
544 } // namespace webrtc | 547 } // namespace webrtc |
OLD | NEW |