| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 RTC_DCHECK(video_receive_streams_.empty()); | 329 RTC_DCHECK(video_receive_streams_.empty()); |
| 330 RTC_DCHECK(audio_send_stream_ == nullptr); | 330 RTC_DCHECK(audio_send_stream_ == nullptr); |
| 331 RTC_DCHECK(audio_receive_streams_.empty()); | 331 RTC_DCHECK(audio_receive_streams_.empty()); |
| 332 | 332 |
| 333 video_send_stream_ = sender_call_->CreateVideoSendStream( | 333 video_send_stream_ = sender_call_->CreateVideoSendStream( |
| 334 video_send_config_.Copy(), video_encoder_config_.Copy()); | 334 video_send_config_.Copy(), video_encoder_config_.Copy()); |
| 335 for (size_t i = 0; i < video_receive_configs_.size(); ++i) { | 335 for (size_t i = 0; i < video_receive_configs_.size(); ++i) { |
| 336 video_receive_streams_.push_back(receiver_call_->CreateVideoReceiveStream( | 336 video_receive_streams_.push_back(receiver_call_->CreateVideoReceiveStream( |
| 337 video_receive_configs_[i].Copy())); | 337 video_receive_configs_[i].Copy())); |
| 338 } | 338 } |
| 339 |
| 340 AssociateFlexfecStreamsWithVideoStreams(); |
| 339 } | 341 } |
| 340 | 342 |
| 341 void CallTest::SetFakeVideoCaptureRotation(VideoRotation rotation) { | 343 void CallTest::SetFakeVideoCaptureRotation(VideoRotation rotation) { |
| 342 frame_generator_capturer_->SetFakeRotation(rotation); | 344 frame_generator_capturer_->SetFakeRotation(rotation); |
| 343 } | 345 } |
| 344 | 346 |
| 345 void CallTest::CreateAudioStreams() { | 347 void CallTest::CreateAudioStreams() { |
| 346 audio_send_stream_ = sender_call_->CreateAudioSendStream(audio_send_config_); | 348 audio_send_stream_ = sender_call_->CreateAudioSendStream(audio_send_config_); |
| 347 for (size_t i = 0; i < audio_receive_configs_.size(); ++i) { | 349 for (size_t i = 0; i < audio_receive_configs_.size(); ++i) { |
| 348 audio_receive_streams_.push_back( | 350 audio_receive_streams_.push_back( |
| 349 receiver_call_->CreateAudioReceiveStream(audio_receive_configs_[i])); | 351 receiver_call_->CreateAudioReceiveStream(audio_receive_configs_[i])); |
| 350 } | 352 } |
| 351 } | 353 } |
| 352 | 354 |
| 353 void CallTest::CreateFlexfecStreams() { | 355 void CallTest::CreateFlexfecStreams() { |
| 354 for (size_t i = 0; i < flexfec_receive_configs_.size(); ++i) { | 356 for (size_t i = 0; i < flexfec_receive_configs_.size(); ++i) { |
| 355 flexfec_receive_streams_.push_back( | 357 flexfec_receive_streams_.push_back( |
| 356 receiver_call_->CreateFlexfecReceiveStream( | 358 receiver_call_->CreateFlexfecReceiveStream( |
| 357 flexfec_receive_configs_[i])); | 359 flexfec_receive_configs_[i])); |
| 358 } | 360 } |
| 361 |
| 362 AssociateFlexfecStreamsWithVideoStreams(); |
| 363 } |
| 364 |
| 365 void CallTest::AssociateFlexfecStreamsWithVideoStreams() { |
| 366 // All FlexFEC streams protect all of the video streams. |
| 367 for (auto* flexfec_receive_stream : flexfec_receive_streams_) { |
| 368 for (auto* video_recv_stream : video_receive_streams_) { |
| 369 video_recv_stream->AddSecondarySink(flexfec_receive_stream); |
| 370 } |
| 371 } |
| 372 } |
| 373 |
| 374 void CallTest::DissociateFlexfecStreamsFromVideoStreams() { |
| 375 for (VideoReceiveStream* video_recv_stream : video_receive_streams_) { |
| 376 for (FlexfecReceiveStream* flexfec_recv_stream : flexfec_receive_streams_) { |
| 377 video_recv_stream->RemoveSecondarySink(flexfec_recv_stream); |
| 378 } |
| 379 } |
| 359 } | 380 } |
| 360 | 381 |
| 361 void CallTest::DestroyStreams() { | 382 void CallTest::DestroyStreams() { |
| 383 DissociateFlexfecStreamsFromVideoStreams(); |
| 384 |
| 362 if (audio_send_stream_) | 385 if (audio_send_stream_) |
| 363 sender_call_->DestroyAudioSendStream(audio_send_stream_); | 386 sender_call_->DestroyAudioSendStream(audio_send_stream_); |
| 364 audio_send_stream_ = nullptr; | 387 audio_send_stream_ = nullptr; |
| 365 for (AudioReceiveStream* audio_recv_stream : audio_receive_streams_) | 388 for (AudioReceiveStream* audio_recv_stream : audio_receive_streams_) |
| 366 receiver_call_->DestroyAudioReceiveStream(audio_recv_stream); | 389 receiver_call_->DestroyAudioReceiveStream(audio_recv_stream); |
| 367 | 390 |
| 368 if (video_send_stream_) | 391 if (video_send_stream_) |
| 369 sender_call_->DestroyVideoSendStream(video_send_stream_); | 392 sender_call_->DestroyVideoSendStream(video_send_stream_); |
| 370 video_send_stream_ = nullptr; | 393 video_send_stream_ = nullptr; |
| 371 | 394 |
| 372 for (VideoReceiveStream* video_recv_stream : video_receive_streams_) | 395 for (VideoReceiveStream* video_recv_stream : video_receive_streams_) { |
| 373 receiver_call_->DestroyVideoReceiveStream(video_recv_stream); | 396 receiver_call_->DestroyVideoReceiveStream(video_recv_stream); |
| 397 } |
| 374 | 398 |
| 375 for (FlexfecReceiveStream* flexfec_recv_stream : flexfec_receive_streams_) | 399 for (FlexfecReceiveStream* flexfec_recv_stream : flexfec_receive_streams_) |
| 376 receiver_call_->DestroyFlexfecReceiveStream(flexfec_recv_stream); | 400 receiver_call_->DestroyFlexfecReceiveStream(flexfec_recv_stream); |
| 377 | 401 |
| 378 video_receive_streams_.clear(); | 402 video_receive_streams_.clear(); |
| 379 allocated_decoders_.clear(); | 403 allocated_decoders_.clear(); |
| 380 } | 404 } |
| 381 | 405 |
| 382 void CallTest::CreateVoiceEngines() { | 406 void CallTest::CreateVoiceEngines() { |
| 383 voe_send_.voice_engine = VoiceEngine::Create(); | 407 voe_send_.voice_engine = VoiceEngine::Create(); |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 | 571 |
| 548 EndToEndTest::EndToEndTest(unsigned int timeout_ms) : BaseTest(timeout_ms) { | 572 EndToEndTest::EndToEndTest(unsigned int timeout_ms) : BaseTest(timeout_ms) { |
| 549 } | 573 } |
| 550 | 574 |
| 551 bool EndToEndTest::ShouldCreateReceivers() const { | 575 bool EndToEndTest::ShouldCreateReceivers() const { |
| 552 return true; | 576 return true; |
| 553 } | 577 } |
| 554 | 578 |
| 555 } // namespace test | 579 } // namespace test |
| 556 } // namespace webrtc | 580 } // namespace webrtc |
| OLD | NEW |