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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 kDefaultStartBitrate; | 167 kDefaultStartBitrate; |
168 | 168 |
169 return codec; | 169 return codec; |
170 } | 170 } |
171 } // namespace | 171 } // namespace |
172 | 172 |
173 namespace internal { | 173 namespace internal { |
174 | 174 |
175 VideoReceiveStream::VideoReceiveStream( | 175 VideoReceiveStream::VideoReceiveStream( |
176 int num_cpu_cores, | 176 int num_cpu_cores, |
177 bool protected_by_flexfec, | |
178 PacketRouter* packet_router, | 177 PacketRouter* packet_router, |
179 VideoReceiveStream::Config config, | 178 VideoReceiveStream::Config config, |
180 ProcessThread* process_thread, | 179 ProcessThread* process_thread, |
181 CallStats* call_stats, | 180 CallStats* call_stats, |
182 VieRemb* remb) | 181 VieRemb* remb) |
183 : transport_adapter_(config.rtcp_send_transport), | 182 : transport_adapter_(config.rtcp_send_transport), |
184 config_(std::move(config)), | 183 config_(std::move(config)), |
185 num_cpu_cores_(num_cpu_cores), | 184 num_cpu_cores_(num_cpu_cores), |
186 protected_by_flexfec_(protected_by_flexfec), | |
187 process_thread_(process_thread), | 185 process_thread_(process_thread), |
188 clock_(Clock::GetRealTimeClock()), | 186 clock_(Clock::GetRealTimeClock()), |
189 decode_thread_(DecodeThreadFunction, this, "DecodingThread"), | 187 decode_thread_(DecodeThreadFunction, this, "DecodingThread"), |
190 call_stats_(call_stats), | 188 call_stats_(call_stats), |
191 timing_(new VCMTiming(clock_)), | 189 timing_(new VCMTiming(clock_)), |
192 video_receiver_(clock_, nullptr, this, timing_.get(), this, this), | 190 video_receiver_(clock_, nullptr, this, timing_.get(), this, this), |
193 stats_proxy_(&config_, clock_), | 191 stats_proxy_(&config_, clock_), |
194 rtp_stream_receiver_(&video_receiver_, | 192 rtp_stream_receiver_(&video_receiver_, |
195 &transport_adapter_, | 193 &transport_adapter_, |
196 call_stats_->rtcp_rtt_stats(), | 194 call_stats_->rtcp_rtt_stats(), |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 void VideoReceiveStream::SetSync(Syncable* audio_syncable) { | 266 void VideoReceiveStream::SetSync(Syncable* audio_syncable) { |
269 RTC_DCHECK_RUN_ON(&worker_thread_checker_); | 267 RTC_DCHECK_RUN_ON(&worker_thread_checker_); |
270 rtp_stream_sync_.ConfigureSync(audio_syncable); | 268 rtp_stream_sync_.ConfigureSync(audio_syncable); |
271 } | 269 } |
272 | 270 |
273 void VideoReceiveStream::Start() { | 271 void VideoReceiveStream::Start() { |
274 RTC_DCHECK_RUN_ON(&worker_thread_checker_); | 272 RTC_DCHECK_RUN_ON(&worker_thread_checker_); |
275 if (decode_thread_.IsRunning()) | 273 if (decode_thread_.IsRunning()) |
276 return; | 274 return; |
277 | 275 |
278 bool protected_by_fec = | 276 bool protected_by_fec = config_.rtp.protected_by_flexfec || |
279 protected_by_flexfec_ || rtp_stream_receiver_.IsUlpfecEnabled(); | 277 rtp_stream_receiver_.IsUlpfecEnabled(); |
280 | 278 |
281 if (jitter_buffer_experiment_) { | 279 if (jitter_buffer_experiment_) { |
282 frame_buffer_->Start(); | 280 frame_buffer_->Start(); |
283 call_stats_->RegisterStatsObserver(&rtp_stream_receiver_); | 281 call_stats_->RegisterStatsObserver(&rtp_stream_receiver_); |
284 | 282 |
285 if (rtp_stream_receiver_.IsRetransmissionsEnabled() && protected_by_fec) { | 283 if (rtp_stream_receiver_.IsRetransmissionsEnabled() && protected_by_fec) { |
286 frame_buffer_->SetProtectionMode(kProtectionNackFEC); | 284 frame_buffer_->SetProtectionMode(kProtectionNackFEC); |
287 } | 285 } |
288 } | 286 } |
289 transport_adapter_.Enable(); | 287 transport_adapter_.Enable(); |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 LOG(LS_WARNING) << "No decodable frame in " << kMaxWaitForFrameMs | 497 LOG(LS_WARNING) << "No decodable frame in " << kMaxWaitForFrameMs |
500 << " ms, requesting keyframe."; | 498 << " ms, requesting keyframe."; |
501 RequestKeyFrame(); | 499 RequestKeyFrame(); |
502 } | 500 } |
503 } else { | 501 } else { |
504 video_receiver_.Decode(kMaxDecodeWaitTimeMs); | 502 video_receiver_.Decode(kMaxDecodeWaitTimeMs); |
505 } | 503 } |
506 } | 504 } |
507 } // namespace internal | 505 } // namespace internal |
508 } // namespace webrtc | 506 } // namespace webrtc |
OLD | NEW |