| OLD | NEW |
| 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 Loading... |
| 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_->SetRTCPStatus(config_.rtcp_mode); | 142 rtp_rtcp_->SetRTCPStatus(config_.rtcp_mode); |
| 142 rtp_rtcp_->SetSSRC(config_.local_ssrc); | 143 rtp_rtcp_->SetSSRC(config_.local_ssrc); |
| 143 process_thread_->RegisterModule(rtp_rtcp_.get(), RTC_FROM_HERE); | 144 process_thread_->RegisterModule(rtp_rtcp_.get(), RTC_FROM_HERE); |
| 144 } | 145 } |
| 145 | 146 |
| 146 FlexfecReceiveStreamImpl::~FlexfecReceiveStreamImpl() { | 147 FlexfecReceiveStreamImpl::~FlexfecReceiveStreamImpl() { |
| 147 LOG(LS_INFO) << "~FlexfecReceiveStreamImpl: " << config_.ToString(); | 148 LOG(LS_INFO) << "~FlexfecReceiveStreamImpl: " << config_.ToString(); |
| 148 Stop(); | 149 Stop(); |
| 149 process_thread_->DeRegisterModule(rtp_rtcp_.get()); | 150 process_thread_->DeRegisterModule(rtp_rtcp_.get()); |
| 150 } | 151 } |
| 151 | 152 |
| 153 bool FlexfecReceiveStreamImpl::OnRtpPacketReceive(RtpPacketReceived* packet) { |
| 154 packet->IdentifyExtensions(rtp_header_extensions_); |
| 155 OnRtpPacket(*packet); |
| 156 return true; |
| 157 } |
| 158 |
| 152 void FlexfecReceiveStreamImpl::OnRtpPacket(const RtpPacketReceived& packet) { | 159 void FlexfecReceiveStreamImpl::OnRtpPacket(const RtpPacketReceived& packet) { |
| 153 { | 160 { |
| 154 rtc::CritScope cs(&crit_); | 161 rtc::CritScope cs(&crit_); |
| 155 if (!started_) | 162 if (!started_) |
| 156 return; | 163 return; |
| 157 } | 164 } |
| 158 | 165 |
| 159 if (!receiver_) | 166 if (!receiver_) |
| 160 return; | 167 return; |
| 161 | 168 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 182 started_ = false; | 189 started_ = false; |
| 183 } | 190 } |
| 184 | 191 |
| 185 // TODO(brandtr): Implement this member function when we have designed the | 192 // TODO(brandtr): Implement this member function when we have designed the |
| 186 // stats for FlexFEC. | 193 // stats for FlexFEC. |
| 187 FlexfecReceiveStreamImpl::Stats FlexfecReceiveStreamImpl::GetStats() const { | 194 FlexfecReceiveStreamImpl::Stats FlexfecReceiveStreamImpl::GetStats() const { |
| 188 return FlexfecReceiveStream::Stats(); | 195 return FlexfecReceiveStream::Stats(); |
| 189 } | 196 } |
| 190 | 197 |
| 191 } // namespace webrtc | 198 } // namespace webrtc |
| OLD | NEW |