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 if (!receiver_->AddAndProcessReceivedPacket(packet)) |
nisse-webrtc
2017/02/10 13:46:21
Should we rename and/or drop the return value for
brandtr
2017/02/10 14:12:21
Yes, might as well do both :)
nisse-webrtc
2017/02/13 13:20:03
If I delete return value and this if statement, as
brandtr
2017/02/13 15:32:13
I understand. I think it's fine to include those.
| |
164 return false; | 163 return; |
165 | 164 |
166 // Do not report media packets in the RTCP RRs generated by |rtp_rtcp_|. | 165 // Do not report media packets in the RTCP RRs generated by |rtp_rtcp_|. |
167 if (packet.Ssrc() == config_.remote_ssrc) { | 166 if (packet.Ssrc() == config_.remote_ssrc) { |
168 RTPHeader header; | 167 RTPHeader header; |
169 packet.GetHeader(&header); | 168 packet.GetHeader(&header); |
170 // FlexFEC packets are never retransmitted. | 169 // FlexFEC packets are never retransmitted. |
171 const bool kNotRetransmitted = false; | 170 const bool kNotRetransmitted = false; |
172 rtp_receive_statistics_->IncomingPacket(header, packet.size(), | 171 rtp_receive_statistics_->IncomingPacket(header, packet.size(), |
173 kNotRetransmitted); | 172 kNotRetransmitted); |
174 } | 173 } |
175 | |
176 return true; | |
177 } | 174 } |
178 | 175 |
179 void FlexfecReceiveStreamImpl::Start() { | 176 void FlexfecReceiveStreamImpl::Start() { |
180 rtc::CritScope cs(&crit_); | 177 rtc::CritScope cs(&crit_); |
181 started_ = true; | 178 started_ = true; |
182 } | 179 } |
183 | 180 |
184 void FlexfecReceiveStreamImpl::Stop() { | 181 void FlexfecReceiveStreamImpl::Stop() { |
185 rtc::CritScope cs(&crit_); | 182 rtc::CritScope cs(&crit_); |
186 started_ = false; | 183 started_ = false; |
187 } | 184 } |
188 | 185 |
189 // TODO(brandtr): Implement this member function when we have designed the | 186 // TODO(brandtr): Implement this member function when we have designed the |
190 // stats for FlexFEC. | 187 // stats for FlexFEC. |
191 FlexfecReceiveStreamImpl::Stats FlexfecReceiveStreamImpl::GetStats() const { | 188 FlexfecReceiveStreamImpl::Stats FlexfecReceiveStreamImpl::GetStats() const { |
192 return FlexfecReceiveStream::Stats(); | 189 return FlexfecReceiveStream::Stats(); |
193 } | 190 } |
194 | 191 |
195 } // namespace webrtc | 192 } // namespace webrtc |
OLD | NEW |