OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 kDefaultStartBitrate; | 169 kDefaultStartBitrate; |
170 | 170 |
171 return codec; | 171 return codec; |
172 } | 172 } |
173 } // namespace | 173 } // namespace |
174 | 174 |
175 namespace internal { | 175 namespace internal { |
176 | 176 |
177 VideoReceiveStream::VideoReceiveStream( | 177 VideoReceiveStream::VideoReceiveStream( |
178 int num_cpu_cores, | 178 int num_cpu_cores, |
179 bool protected_by_flexfec, | |
180 PacketRouter* packet_router, | 179 PacketRouter* packet_router, |
181 VideoReceiveStream::Config config, | 180 VideoReceiveStream::Config config, |
182 ProcessThread* process_thread, | 181 ProcessThread* process_thread, |
183 CallStats* call_stats, | 182 CallStats* call_stats, |
184 VieRemb* remb) | 183 VieRemb* remb) |
185 : transport_adapter_(config.rtcp_send_transport), | 184 : transport_adapter_(config.rtcp_send_transport), |
186 config_(std::move(config)), | 185 config_(std::move(config)), |
187 num_cpu_cores_(num_cpu_cores), | 186 num_cpu_cores_(num_cpu_cores), |
188 protected_by_flexfec_(protected_by_flexfec), | |
189 process_thread_(process_thread), | 187 process_thread_(process_thread), |
190 clock_(Clock::GetRealTimeClock()), | 188 clock_(Clock::GetRealTimeClock()), |
191 decode_thread_(DecodeThreadFunction, this, "DecodingThread"), | 189 decode_thread_(DecodeThreadFunction, this, "DecodingThread"), |
192 call_stats_(call_stats), | 190 call_stats_(call_stats), |
193 timing_(new VCMTiming(clock_)), | 191 timing_(new VCMTiming(clock_)), |
194 video_receiver_(clock_, nullptr, this, timing_.get(), this, this), | 192 video_receiver_(clock_, nullptr, this, timing_.get(), this, this), |
195 stats_proxy_(&config_, clock_), | 193 stats_proxy_(&config_, clock_), |
196 rtp_stream_receiver_(&transport_adapter_, | 194 rtp_stream_receiver_(&transport_adapter_, |
197 call_stats_->rtcp_rtt_stats(), | 195 call_stats_->rtcp_rtt_stats(), |
198 packet_router, | 196 packet_router, |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 void VideoReceiveStream::SetSync(Syncable* audio_syncable) { | 262 void VideoReceiveStream::SetSync(Syncable* audio_syncable) { |
265 RTC_DCHECK_RUN_ON(&worker_thread_checker_); | 263 RTC_DCHECK_RUN_ON(&worker_thread_checker_); |
266 rtp_stream_sync_.ConfigureSync(audio_syncable); | 264 rtp_stream_sync_.ConfigureSync(audio_syncable); |
267 } | 265 } |
268 | 266 |
269 void VideoReceiveStream::Start() { | 267 void VideoReceiveStream::Start() { |
270 RTC_DCHECK_RUN_ON(&worker_thread_checker_); | 268 RTC_DCHECK_RUN_ON(&worker_thread_checker_); |
271 if (decode_thread_.IsRunning()) | 269 if (decode_thread_.IsRunning()) |
272 return; | 270 return; |
273 | 271 |
274 bool protected_by_fec = | 272 bool protected_by_fec = config_.rtp.protected_by_flexfec || |
275 protected_by_flexfec_ || rtp_stream_receiver_.IsUlpfecEnabled(); | 273 rtp_stream_receiver_.IsUlpfecEnabled(); |
276 | 274 |
277 frame_buffer_->Start(); | 275 frame_buffer_->Start(); |
278 call_stats_->RegisterStatsObserver(&rtp_stream_receiver_); | 276 call_stats_->RegisterStatsObserver(&rtp_stream_receiver_); |
279 | 277 |
280 if (rtp_stream_receiver_.IsRetransmissionsEnabled() && protected_by_fec) { | 278 if (rtp_stream_receiver_.IsRetransmissionsEnabled() && protected_by_fec) { |
281 frame_buffer_->SetProtectionMode(kProtectionNackFEC); | 279 frame_buffer_->SetProtectionMode(kProtectionNackFEC); |
282 } | 280 } |
283 | 281 |
284 transport_adapter_.Enable(); | 282 transport_adapter_.Enable(); |
285 rtc::VideoSinkInterface<VideoFrame>* renderer = nullptr; | 283 rtc::VideoSinkInterface<VideoFrame>* renderer = nullptr; |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 rtp_stream_receiver_.FrameDecoded(frame->picture_id); | 486 rtp_stream_receiver_.FrameDecoded(frame->picture_id); |
489 } else { | 487 } else { |
490 LOG(LS_WARNING) << "No decodable frame in " << kMaxWaitForFrameMs | 488 LOG(LS_WARNING) << "No decodable frame in " << kMaxWaitForFrameMs |
491 << " ms, requesting keyframe."; | 489 << " ms, requesting keyframe."; |
492 RequestKeyFrame(); | 490 RequestKeyFrame(); |
493 } | 491 } |
494 return true; | 492 return true; |
495 } | 493 } |
496 } // namespace internal | 494 } // namespace internal |
497 } // namespace webrtc | 495 } // namespace webrtc |
OLD | NEW |