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 21 matching lines...) Expand all Loading... | |
342 void VideoReceiveStream::Stop() { | 345 void VideoReceiveStream::Stop() { |
343 incoming_video_stream_.Stop(); | 346 incoming_video_stream_.Stop(); |
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) { |
355 VoEVideoSync* voe_sync_interface = nullptr; | |
352 if (voice_engine != nullptr && audio_channel_id != -1) { | 356 if (voice_engine != nullptr && audio_channel_id != -1) { |
danilchap
2016/02/16 08:54:06
Probably better to leave old way of branching to c
pbos-webrtc
2016/02/16 10:10:23
Done.
| |
353 VoEVideoSync* voe_sync_interface = VoEVideoSync::GetInterface(voice_engine); | 357 voe_sync_interface = VoEVideoSync::GetInterface(voice_engine); |
354 vie_channel_.SetVoiceChannel(audio_channel_id, voe_sync_interface); | 358 } else { |
359 audio_channel_id = -1; | |
360 } | |
361 vie_sync_.ConfigureSync(audio_channel_id, voe_sync_interface, rtp_rtcp_, | |
362 vie_receiver_->GetRtpReceiver()); | |
363 if (voe_sync_interface) | |
355 voe_sync_interface->Release(); | 364 voe_sync_interface->Release(); |
356 } else { | |
357 vie_channel_.SetVoiceChannel(-1, nullptr); | |
358 } | |
359 } | 365 } |
360 | 366 |
361 VideoReceiveStream::Stats VideoReceiveStream::GetStats() const { | 367 VideoReceiveStream::Stats VideoReceiveStream::GetStats() const { |
362 return stats_proxy_.GetStats(); | 368 return stats_proxy_.GetStats(); |
363 } | 369 } |
364 | 370 |
365 bool VideoReceiveStream::DeliverRtcp(const uint8_t* packet, size_t length) { | 371 bool VideoReceiveStream::DeliverRtcp(const uint8_t* packet, size_t length) { |
366 return vie_receiver_->DeliverRtcp(packet, length); | 372 return vie_receiver_->DeliverRtcp(packet, length); |
367 } | 373 } |
368 | 374 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
423 return true; | 429 return true; |
424 } | 430 } |
425 | 431 |
426 void VideoReceiveStream::Decode() { | 432 void VideoReceiveStream::Decode() { |
427 static const int kMaxDecodeWaitTimeMs = 50; | 433 static const int kMaxDecodeWaitTimeMs = 50; |
428 vcm_->Decode(kMaxDecodeWaitTimeMs); | 434 vcm_->Decode(kMaxDecodeWaitTimeMs); |
429 } | 435 } |
430 | 436 |
431 } // namespace internal | 437 } // namespace internal |
432 } // namespace webrtc | 438 } // namespace webrtc |
OLD | NEW |