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

Side by Side Diff: webrtc/call/flexfec_receive_stream_impl.cc

Issue 2709723003: Initial implementation of RtpTransportControllerReceive and related interfaces.
Patch Set: Adapt Call to use the new RtpTransportReceive class. Created 3 years, 9 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) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 } 120 }
121 121
122 } // namespace 122 } // namespace
123 123
124 FlexfecReceiveStreamImpl::FlexfecReceiveStreamImpl( 124 FlexfecReceiveStreamImpl::FlexfecReceiveStreamImpl(
125 const Config& config, 125 const Config& config,
126 RecoveredPacketReceiver* recovered_packet_receiver, 126 RecoveredPacketReceiver* recovered_packet_receiver,
127 RtcpRttStats* rtt_stats, 127 RtcpRttStats* rtt_stats,
128 ProcessThread* process_thread) 128 ProcessThread* process_thread)
129 : config_(config), 129 : config_(config),
130 rtp_header_extensions_(config.rtp_header_extensions),
130 started_(false), 131 started_(false),
131 receiver_(MaybeCreateFlexfecReceiver(config_, recovered_packet_receiver)), 132 receiver_(MaybeCreateFlexfecReceiver(config_, recovered_packet_receiver)),
132 rtp_receive_statistics_( 133 rtp_receive_statistics_(
133 ReceiveStatistics::Create(Clock::GetRealTimeClock())), 134 ReceiveStatistics::Create(Clock::GetRealTimeClock())),
134 rtp_rtcp_(CreateRtpRtcpModule(rtp_receive_statistics_.get(), 135 rtp_rtcp_(CreateRtpRtcpModule(rtp_receive_statistics_.get(),
135 config_.rtcp_send_transport, 136 config_.rtcp_send_transport,
136 rtt_stats)), 137 rtt_stats)),
137 process_thread_(process_thread) { 138 process_thread_(process_thread) {
138 LOG(LS_INFO) << "FlexfecReceiveStreamImpl: " << config_.ToString(); 139 LOG(LS_INFO) << "FlexfecReceiveStreamImpl: " << config_.ToString();
139 140
140 // RTCP reporting. 141 // RTCP reporting.
141 rtp_rtcp_->SetSendingMediaStatus(false); 142 rtp_rtcp_->SetSendingMediaStatus(false);
142 rtp_rtcp_->SetRTCPStatus(config_.rtcp_mode); 143 rtp_rtcp_->SetRTCPStatus(config_.rtcp_mode);
143 rtp_rtcp_->SetSSRC(config_.local_ssrc); 144 rtp_rtcp_->SetSSRC(config_.local_ssrc);
144 process_thread_->RegisterModule(rtp_rtcp_.get(), RTC_FROM_HERE); 145 process_thread_->RegisterModule(rtp_rtcp_.get(), RTC_FROM_HERE);
145 } 146 }
146 147
147 FlexfecReceiveStreamImpl::~FlexfecReceiveStreamImpl() { 148 FlexfecReceiveStreamImpl::~FlexfecReceiveStreamImpl() {
148 LOG(LS_INFO) << "~FlexfecReceiveStreamImpl: " << config_.ToString(); 149 LOG(LS_INFO) << "~FlexfecReceiveStreamImpl: " << config_.ToString();
149 Stop(); 150 Stop();
150 process_thread_->DeRegisterModule(rtp_rtcp_.get()); 151 process_thread_->DeRegisterModule(rtp_rtcp_.get());
151 } 152 }
152 153
154 bool FlexfecReceiveStreamImpl::OnRtpPacketReceive(RtpPacketReceived* packet) {
155 packet->IdentifyExtensions(rtp_header_extensions_);
156 OnRtpPacket(*packet);
157 return true;
158 }
159
153 void FlexfecReceiveStreamImpl::OnRtpPacket(const RtpPacketReceived& packet) { 160 void FlexfecReceiveStreamImpl::OnRtpPacket(const RtpPacketReceived& packet) {
154 { 161 {
155 rtc::CritScope cs(&crit_); 162 rtc::CritScope cs(&crit_);
156 if (!started_) 163 if (!started_)
157 return; 164 return;
158 } 165 }
159 166
160 if (!receiver_) 167 if (!receiver_)
161 return; 168 return;
162 169
(...skipping 20 matching lines...) Expand all
183 started_ = false; 190 started_ = false;
184 } 191 }
185 192
186 // TODO(brandtr): Implement this member function when we have designed the 193 // TODO(brandtr): Implement this member function when we have designed the
187 // stats for FlexFEC. 194 // stats for FlexFEC.
188 FlexfecReceiveStreamImpl::Stats FlexfecReceiveStreamImpl::GetStats() const { 195 FlexfecReceiveStreamImpl::Stats FlexfecReceiveStreamImpl::GetStats() const {
189 return FlexfecReceiveStream::Stats(); 196 return FlexfecReceiveStream::Stats();
190 } 197 }
191 198
192 } // namespace webrtc 199 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698