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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 nullptr, | 171 nullptr, |
172 nullptr, | 172 nullptr, |
173 congestion_controller_->GetRemoteBitrateEstimator( | 173 congestion_controller_->GetRemoteBitrateEstimator( |
174 UseSendSideBwe(config_)), | 174 UseSendSideBwe(config_)), |
175 call_stats_->rtcp_rtt_stats(), | 175 call_stats_->rtcp_rtt_stats(), |
176 congestion_controller_->pacer(), | 176 congestion_controller_->pacer(), |
177 congestion_controller_->packet_router(), | 177 congestion_controller_->packet_router(), |
178 1, | 178 1, |
179 false), | 179 false), |
180 vie_receiver_(vie_channel_.vie_receiver()), | 180 vie_receiver_(vie_channel_.vie_receiver()), |
| 181 vie_sync_(vcm_.get()), |
181 rtp_rtcp_(vie_channel_.rtp_rtcp()) { | 182 rtp_rtcp_(vie_channel_.rtp_rtcp()) { |
182 LOG(LS_INFO) << "VideoReceiveStream: " << config_.ToString(); | 183 LOG(LS_INFO) << "VideoReceiveStream: " << config_.ToString(); |
183 | 184 |
184 RTC_DCHECK(process_thread_); | 185 RTC_DCHECK(process_thread_); |
185 RTC_DCHECK(congestion_controller_); | 186 RTC_DCHECK(congestion_controller_); |
186 RTC_DCHECK(call_stats_); | 187 RTC_DCHECK(call_stats_); |
187 RTC_DCHECK(remb_); | 188 RTC_DCHECK(remb_); |
188 RTC_CHECK(vie_channel_.Init() == 0); | 189 RTC_CHECK(vie_channel_.Init() == 0); |
189 | 190 |
190 // Register the channel to receive stats updates. | 191 // Register the channel to receive stats updates. |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 } | 296 } |
296 | 297 |
297 vcm_->SetRenderDelay(config.render_delay_ms); | 298 vcm_->SetRenderDelay(config.render_delay_ms); |
298 incoming_video_stream_.SetExpectedRenderDelay(config.render_delay_ms); | 299 incoming_video_stream_.SetExpectedRenderDelay(config.render_delay_ms); |
299 vcm_->RegisterPreDecodeImageCallback(this); | 300 vcm_->RegisterPreDecodeImageCallback(this); |
300 incoming_video_stream_.SetExternalCallback(this); | 301 incoming_video_stream_.SetExternalCallback(this); |
301 vie_channel_.SetIncomingVideoStream(&incoming_video_stream_); | 302 vie_channel_.SetIncomingVideoStream(&incoming_video_stream_); |
302 vie_channel_.RegisterPreRenderCallback(this); | 303 vie_channel_.RegisterPreRenderCallback(this); |
303 | 304 |
304 process_thread_->RegisterModule(vcm_.get()); | 305 process_thread_->RegisterModule(vcm_.get()); |
| 306 process_thread_->RegisterModule(&vie_sync_); |
305 } | 307 } |
306 | 308 |
307 VideoReceiveStream::~VideoReceiveStream() { | 309 VideoReceiveStream::~VideoReceiveStream() { |
308 LOG(LS_INFO) << "~VideoReceiveStream: " << config_.ToString(); | 310 LOG(LS_INFO) << "~VideoReceiveStream: " << config_.ToString(); |
309 Stop(); | 311 Stop(); |
310 | 312 |
| 313 process_thread_->DeRegisterModule(&vie_sync_); |
311 process_thread_->DeRegisterModule(vcm_.get()); | 314 process_thread_->DeRegisterModule(vcm_.get()); |
312 | 315 |
313 // Deregister external decoders so that they are no longer running during | 316 // Deregister external decoders so that they are no longer running during |
314 // destruction. This effectively stops the VCM since the decoder thread is | 317 // destruction. This effectively stops the VCM since the decoder thread is |
315 // stopped, the VCM is deregistered and no asynchronous decoder threads are | 318 // stopped, the VCM is deregistered and no asynchronous decoder threads are |
316 // running. | 319 // running. |
317 for (const Decoder& decoder : config_.decoders) | 320 for (const Decoder& decoder : config_.decoders) |
318 vcm_->RegisterExternalDecoder(nullptr, decoder.payload_type); | 321 vcm_->RegisterExternalDecoder(nullptr, decoder.payload_type); |
319 | 322 |
320 vie_channel_.RegisterPreRenderCallback(nullptr); | 323 vie_channel_.RegisterPreRenderCallback(nullptr); |
(...skipping 23 matching lines...) Expand all Loading... |
344 vie_receiver_->StopReceive(); | 347 vie_receiver_->StopReceive(); |
345 vcm_->TriggerDecoderShutdown(); | 348 vcm_->TriggerDecoderShutdown(); |
346 decode_thread_.Stop(); | 349 decode_thread_.Stop(); |
347 transport_adapter_.Disable(); | 350 transport_adapter_.Disable(); |
348 } | 351 } |
349 | 352 |
350 void VideoReceiveStream::SetSyncChannel(VoiceEngine* voice_engine, | 353 void VideoReceiveStream::SetSyncChannel(VoiceEngine* voice_engine, |
351 int audio_channel_id) { | 354 int audio_channel_id) { |
352 if (voice_engine != nullptr && audio_channel_id != -1) { | 355 if (voice_engine != nullptr && audio_channel_id != -1) { |
353 VoEVideoSync* voe_sync_interface = VoEVideoSync::GetInterface(voice_engine); | 356 VoEVideoSync* voe_sync_interface = VoEVideoSync::GetInterface(voice_engine); |
354 vie_channel_.SetVoiceChannel(audio_channel_id, voe_sync_interface); | 357 vie_sync_.ConfigureSync(audio_channel_id, voe_sync_interface, rtp_rtcp_, |
| 358 vie_receiver_->GetRtpReceiver()); |
355 voe_sync_interface->Release(); | 359 voe_sync_interface->Release(); |
356 } else { | 360 return; |
357 vie_channel_.SetVoiceChannel(-1, nullptr); | |
358 } | 361 } |
| 362 vie_sync_.ConfigureSync(-1, nullptr, rtp_rtcp_, |
| 363 vie_receiver_->GetRtpReceiver()); |
359 } | 364 } |
360 | 365 |
361 VideoReceiveStream::Stats VideoReceiveStream::GetStats() const { | 366 VideoReceiveStream::Stats VideoReceiveStream::GetStats() const { |
362 return stats_proxy_.GetStats(); | 367 return stats_proxy_.GetStats(); |
363 } | 368 } |
364 | 369 |
365 bool VideoReceiveStream::DeliverRtcp(const uint8_t* packet, size_t length) { | 370 bool VideoReceiveStream::DeliverRtcp(const uint8_t* packet, size_t length) { |
366 return vie_receiver_->DeliverRtcp(packet, length); | 371 return vie_receiver_->DeliverRtcp(packet, length); |
367 } | 372 } |
368 | 373 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 return true; | 428 return true; |
424 } | 429 } |
425 | 430 |
426 void VideoReceiveStream::Decode() { | 431 void VideoReceiveStream::Decode() { |
427 static const int kMaxDecodeWaitTimeMs = 50; | 432 static const int kMaxDecodeWaitTimeMs = 50; |
428 vcm_->Decode(kMaxDecodeWaitTimeMs); | 433 vcm_->Decode(kMaxDecodeWaitTimeMs); |
429 } | 434 } |
430 | 435 |
431 } // namespace internal | 436 } // namespace internal |
432 } // namespace webrtc | 437 } // namespace webrtc |
OLD | NEW |