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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 test->ModifyVideoConfigs(&video_send_config_, &video_receive_configs_, | 93 test->ModifyVideoConfigs(&video_send_config_, &video_receive_configs_, |
94 &video_encoder_config_); | 94 &video_encoder_config_); |
95 } | 95 } |
96 if (num_audio_streams_ > 0) { | 96 if (num_audio_streams_ > 0) { |
97 test->ModifyAudioConfigs(&audio_send_config_, &audio_receive_configs_); | 97 test->ModifyAudioConfigs(&audio_send_config_, &audio_receive_configs_); |
98 } | 98 } |
99 if (num_flexfec_streams_ > 0) { | 99 if (num_flexfec_streams_ > 0) { |
100 test->ModifyFlexfecConfigs(&flexfec_receive_configs_); | 100 test->ModifyFlexfecConfigs(&flexfec_receive_configs_); |
101 } | 101 } |
102 | 102 |
| 103 if (num_flexfec_streams_ > 0) { |
| 104 CreateFlexfecStreams(); |
| 105 test->OnFlexfecStreamsCreated(flexfec_receive_streams_); |
| 106 } |
103 if (num_video_streams_ > 0) { | 107 if (num_video_streams_ > 0) { |
104 CreateVideoStreams(); | 108 CreateVideoStreams(); |
105 test->OnVideoStreamsCreated(video_send_stream_, video_receive_streams_); | 109 test->OnVideoStreamsCreated(video_send_stream_, video_receive_streams_); |
106 } | 110 } |
107 if (num_audio_streams_ > 0) { | 111 if (num_audio_streams_ > 0) { |
108 CreateAudioStreams(); | 112 CreateAudioStreams(); |
109 test->OnAudioStreamsCreated(audio_send_stream_, audio_receive_streams_); | 113 test->OnAudioStreamsCreated(audio_send_stream_, audio_receive_streams_); |
110 } | 114 } |
111 if (num_flexfec_streams_ > 0) { | |
112 CreateFlexfecStreams(); | |
113 test->OnFlexfecStreamsCreated(flexfec_receive_streams_); | |
114 } | |
115 | 115 |
116 if (num_video_streams_ > 0) { | 116 if (num_video_streams_ > 0) { |
117 int width = kDefaultWidth; | 117 int width = kDefaultWidth; |
118 int height = kDefaultHeight; | 118 int height = kDefaultHeight; |
119 int frame_rate = kDefaultFramerate; | 119 int frame_rate = kDefaultFramerate; |
120 test->ModifyVideoCaptureStartResolution(&width, &height, &frame_rate); | 120 test->ModifyVideoCaptureStartResolution(&width, &height, &frame_rate); |
121 CreateFrameGeneratorCapturer(frame_rate, width, height); | 121 CreateFrameGeneratorCapturer(frame_rate, width, height); |
122 test->OnFrameGeneratorCapturerCreated(frame_generator_capturer_.get()); | 122 test->OnFrameGeneratorCapturerCreated(frame_generator_capturer_.get()); |
123 } | 123 } |
124 | 124 |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 | 345 |
346 void CallTest::CreateFlexfecStreams() { | 346 void CallTest::CreateFlexfecStreams() { |
347 for (size_t i = 0; i < flexfec_receive_configs_.size(); ++i) { | 347 for (size_t i = 0; i < flexfec_receive_configs_.size(); ++i) { |
348 flexfec_receive_streams_.push_back( | 348 flexfec_receive_streams_.push_back( |
349 receiver_call_->CreateFlexfecReceiveStream( | 349 receiver_call_->CreateFlexfecReceiveStream( |
350 flexfec_receive_configs_[i])); | 350 flexfec_receive_configs_[i])); |
351 } | 351 } |
352 } | 352 } |
353 | 353 |
354 void CallTest::DestroyStreams() { | 354 void CallTest::DestroyStreams() { |
| 355 if (audio_send_stream_) |
| 356 sender_call_->DestroyAudioSendStream(audio_send_stream_); |
| 357 audio_send_stream_ = nullptr; |
| 358 for (AudioReceiveStream* audio_recv_stream : audio_receive_streams_) |
| 359 receiver_call_->DestroyAudioReceiveStream(audio_recv_stream); |
| 360 |
355 if (video_send_stream_) | 361 if (video_send_stream_) |
356 sender_call_->DestroyVideoSendStream(video_send_stream_); | 362 sender_call_->DestroyVideoSendStream(video_send_stream_); |
357 video_send_stream_ = nullptr; | 363 video_send_stream_ = nullptr; |
358 for (VideoReceiveStream* video_recv_stream : video_receive_streams_) | 364 for (VideoReceiveStream* video_recv_stream : video_receive_streams_) |
359 receiver_call_->DestroyVideoReceiveStream(video_recv_stream); | 365 receiver_call_->DestroyVideoReceiveStream(video_recv_stream); |
360 | 366 |
361 if (audio_send_stream_) | |
362 sender_call_->DestroyAudioSendStream(audio_send_stream_); | |
363 audio_send_stream_ = nullptr; | |
364 for (AudioReceiveStream* audio_recv_stream : audio_receive_streams_) | |
365 receiver_call_->DestroyAudioReceiveStream(audio_recv_stream); | |
366 | |
367 for (FlexfecReceiveStream* flexfec_recv_stream : flexfec_receive_streams_) | 367 for (FlexfecReceiveStream* flexfec_recv_stream : flexfec_receive_streams_) |
368 receiver_call_->DestroyFlexfecReceiveStream(flexfec_recv_stream); | 368 receiver_call_->DestroyFlexfecReceiveStream(flexfec_recv_stream); |
369 | 369 |
370 video_receive_streams_.clear(); | 370 video_receive_streams_.clear(); |
371 allocated_decoders_.clear(); | 371 allocated_decoders_.clear(); |
372 } | 372 } |
373 | 373 |
374 void CallTest::CreateVoiceEngines() { | 374 void CallTest::CreateVoiceEngines() { |
375 CreateFakeAudioDevices(); | 375 CreateFakeAudioDevices(); |
376 voe_send_.voice_engine = VoiceEngine::Create(); | 376 voe_send_.voice_engine = VoiceEngine::Create(); |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 | 509 |
510 EndToEndTest::EndToEndTest(unsigned int timeout_ms) : BaseTest(timeout_ms) { | 510 EndToEndTest::EndToEndTest(unsigned int timeout_ms) : BaseTest(timeout_ms) { |
511 } | 511 } |
512 | 512 |
513 bool EndToEndTest::ShouldCreateReceivers() const { | 513 bool EndToEndTest::ShouldCreateReceivers() const { |
514 return true; | 514 return true; |
515 } | 515 } |
516 | 516 |
517 } // namespace test | 517 } // namespace test |
518 } // namespace webrtc | 518 } // namespace webrtc |
OLD | NEW |