| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 rtp_rtcp_->SetSSRC(config_.local_ssrc); | 142 rtp_rtcp_->SetSSRC(config_.local_ssrc); |
| 143 process_thread_->RegisterModule(rtp_rtcp_.get()); | 143 process_thread_->RegisterModule(rtp_rtcp_.get()); |
| 144 } | 144 } |
| 145 | 145 |
| 146 FlexfecReceiveStreamImpl::~FlexfecReceiveStreamImpl() { | 146 FlexfecReceiveStreamImpl::~FlexfecReceiveStreamImpl() { |
| 147 LOG(LS_INFO) << "~FlexfecReceiveStreamImpl: " << config_.ToString(); | 147 LOG(LS_INFO) << "~FlexfecReceiveStreamImpl: " << config_.ToString(); |
| 148 Stop(); | 148 Stop(); |
| 149 process_thread_->DeRegisterModule(rtp_rtcp_.get()); | 149 process_thread_->DeRegisterModule(rtp_rtcp_.get()); |
| 150 } | 150 } |
| 151 | 151 |
| 152 bool FlexfecReceiveStreamImpl::AddAndProcessReceivedPacket( | 152 void FlexfecReceiveStreamImpl::OnRtpPacket(const RtpPacketReceived& packet) { |
| 153 const RtpPacketReceived& packet) { | |
| 154 { | 153 { |
| 155 rtc::CritScope cs(&crit_); | 154 rtc::CritScope cs(&crit_); |
| 156 if (!started_) | 155 if (!started_) |
| 157 return false; | 156 return; |
| 158 } | 157 } |
| 159 | 158 |
| 160 if (!receiver_) | 159 if (!receiver_) |
| 161 return false; | 160 return; |
| 162 | 161 |
| 163 if (!receiver_->AddAndProcessReceivedPacket(packet)) | 162 receiver_->OnRtpPacket(packet); |
| 164 return false; | |
| 165 | 163 |
| 166 // Do not report media packets in the RTCP RRs generated by |rtp_rtcp_|. | 164 // Do not report media packets in the RTCP RRs generated by |rtp_rtcp_|. |
| 167 if (packet.Ssrc() == config_.remote_ssrc) { | 165 if (packet.Ssrc() == config_.remote_ssrc) { |
| 168 RTPHeader header; | 166 RTPHeader header; |
| 169 packet.GetHeader(&header); | 167 packet.GetHeader(&header); |
| 170 // FlexFEC packets are never retransmitted. | 168 // FlexFEC packets are never retransmitted. |
| 171 const bool kNotRetransmitted = false; | 169 const bool kNotRetransmitted = false; |
| 172 rtp_receive_statistics_->IncomingPacket(header, packet.size(), | 170 rtp_receive_statistics_->IncomingPacket(header, packet.size(), |
| 173 kNotRetransmitted); | 171 kNotRetransmitted); |
| 174 } | 172 } |
| 175 | |
| 176 return true; | |
| 177 } | 173 } |
| 178 | 174 |
| 179 void FlexfecReceiveStreamImpl::Start() { | 175 void FlexfecReceiveStreamImpl::Start() { |
| 180 rtc::CritScope cs(&crit_); | 176 rtc::CritScope cs(&crit_); |
| 181 started_ = true; | 177 started_ = true; |
| 182 } | 178 } |
| 183 | 179 |
| 184 void FlexfecReceiveStreamImpl::Stop() { | 180 void FlexfecReceiveStreamImpl::Stop() { |
| 185 rtc::CritScope cs(&crit_); | 181 rtc::CritScope cs(&crit_); |
| 186 started_ = false; | 182 started_ = false; |
| 187 } | 183 } |
| 188 | 184 |
| 189 // TODO(brandtr): Implement this member function when we have designed the | 185 // TODO(brandtr): Implement this member function when we have designed the |
| 190 // stats for FlexFEC. | 186 // stats for FlexFEC. |
| 191 FlexfecReceiveStreamImpl::Stats FlexfecReceiveStreamImpl::GetStats() const { | 187 FlexfecReceiveStreamImpl::Stats FlexfecReceiveStreamImpl::GetStats() const { |
| 192 return FlexfecReceiveStream::Stats(); | 188 return FlexfecReceiveStream::Stats(); |
| 193 } | 189 } |
| 194 | 190 |
| 195 } // namespace webrtc | 191 } // namespace webrtc |
| OLD | NEW |