Chromium Code Reviews| 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 161 receiver_controller->AddSink(ssrc, this); | 161 receiver_controller->AddSink(ssrc, this); |
| 162 } | 162 } |
| 163 | 163 |
| 164 FlexfecReceiveStreamImpl::~FlexfecReceiveStreamImpl() { | 164 FlexfecReceiveStreamImpl::~FlexfecReceiveStreamImpl() { |
| 165 LOG(LS_INFO) << "~FlexfecReceiveStreamImpl: " << config_.ToString(); | 165 LOG(LS_INFO) << "~FlexfecReceiveStreamImpl: " << config_.ToString(); |
| 166 Stop(); | 166 Stop(); |
| 167 process_thread_->DeRegisterModule(rtp_rtcp_.get()); | 167 process_thread_->DeRegisterModule(rtp_rtcp_.get()); |
| 168 } | 168 } |
| 169 | 169 |
| 170 void FlexfecReceiveStreamImpl::OnRtpPacket(const RtpPacketReceived& packet) { | 170 void FlexfecReceiveStreamImpl::OnRtpPacket(const RtpPacketReceived& packet) { |
| 171 { | 171 if (!started_) |
|
danilchap
2017/07/24 13:40:23
prefer .load() over operator bool to be explicit i
eladalon
2017/07/24 16:09:02
Done.
| |
| 172 rtc::CritScope cs(&crit_); | 172 return; |
| 173 if (!started_) | |
| 174 return; | |
| 175 } | |
| 176 | 173 |
| 177 if (!receiver_) | 174 if (!receiver_) |
| 178 return; | 175 return; |
| 179 | 176 |
| 180 receiver_->OnRtpPacket(packet); | 177 receiver_->OnRtpPacket(packet); |
| 181 | 178 |
| 182 // Do not report media packets in the RTCP RRs generated by |rtp_rtcp_|. | 179 // Do not report media packets in the RTCP RRs generated by |rtp_rtcp_|. |
| 183 if (packet.Ssrc() == config_.remote_ssrc) { | 180 if (packet.Ssrc() == config_.remote_ssrc) { |
| 184 RTPHeader header; | 181 RTPHeader header; |
| 185 packet.GetHeader(&header); | 182 packet.GetHeader(&header); |
| 186 // FlexFEC packets are never retransmitted. | 183 // FlexFEC packets are never retransmitted. |
| 187 const bool kNotRetransmitted = false; | 184 const bool kNotRetransmitted = false; |
| 188 rtp_receive_statistics_->IncomingPacket(header, packet.size(), | 185 rtp_receive_statistics_->IncomingPacket(header, packet.size(), |
| 189 kNotRetransmitted); | 186 kNotRetransmitted); |
| 190 } | 187 } |
| 191 } | 188 } |
| 192 | 189 |
| 193 void FlexfecReceiveStreamImpl::Start() { | 190 void FlexfecReceiveStreamImpl::Start() { |
| 194 rtc::CritScope cs(&crit_); | |
| 195 started_ = true; | 191 started_ = true; |
|
danilchap
2017/07/24 13:40:23
same here: prefer store
eladalon
2017/07/24 16:09:02
Done.
| |
| 196 } | 192 } |
| 197 | 193 |
| 198 void FlexfecReceiveStreamImpl::Stop() { | 194 void FlexfecReceiveStreamImpl::Stop() { |
| 199 rtc::CritScope cs(&crit_); | |
| 200 started_ = false; | 195 started_ = false; |
| 201 } | 196 } |
| 202 | 197 |
| 203 // TODO(brandtr): Implement this member function when we have designed the | 198 // TODO(brandtr): Implement this member function when we have designed the |
| 204 // stats for FlexFEC. | 199 // stats for FlexFEC. |
| 205 FlexfecReceiveStreamImpl::Stats FlexfecReceiveStreamImpl::GetStats() const { | 200 FlexfecReceiveStreamImpl::Stats FlexfecReceiveStreamImpl::GetStats() const { |
| 206 return FlexfecReceiveStream::Stats(); | 201 return FlexfecReceiveStream::Stats(); |
| 207 } | 202 } |
| 208 | 203 |
| 209 } // namespace webrtc | 204 } // namespace webrtc |
| OLD | NEW |