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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 test->ModifyVideoCaptureStartResolution(&width, &height, &frame_rate); | 146 test->ModifyVideoCaptureStartResolution(&width, &height, &frame_rate); |
147 CreateFrameGeneratorCapturer(frame_rate, width, height); | 147 CreateFrameGeneratorCapturer(frame_rate, width, height); |
148 test->OnFrameGeneratorCapturerCreated(frame_generator_capturer_.get()); | 148 test->OnFrameGeneratorCapturerCreated(frame_generator_capturer_.get()); |
149 } | 149 } |
150 | 150 |
151 Start(); | 151 Start(); |
152 }); | 152 }); |
153 | 153 |
154 test->PerformTest(); | 154 test->PerformTest(); |
155 | 155 |
156 task_queue_.SendTask([this]() { | 156 task_queue_.SendTask([this, test]() { |
157 Stop(); | 157 Stop(); |
| 158 test->OnStreamsStopped(); |
158 DestroyStreams(); | 159 DestroyStreams(); |
159 send_transport_.reset(); | 160 send_transport_.reset(); |
160 receive_transport_.reset(); | 161 receive_transport_.reset(); |
161 DestroyCalls(); | 162 DestroyCalls(); |
162 if (num_audio_streams_ > 0) | 163 if (num_audio_streams_ > 0) |
163 DestroyVoiceEngines(); | 164 DestroyVoiceEngines(); |
164 }); | 165 }); |
165 | |
166 test->OnTestFinished(); | |
167 } | 166 } |
168 | 167 |
169 void CallTest::CreateCalls(const Call::Config& sender_config, | 168 void CallTest::CreateCalls(const Call::Config& sender_config, |
170 const Call::Config& receiver_config) { | 169 const Call::Config& receiver_config) { |
171 CreateSenderCall(sender_config); | 170 CreateSenderCall(sender_config); |
172 CreateReceiverCall(receiver_config); | 171 CreateReceiverCall(receiver_config); |
173 } | 172 } |
174 | 173 |
175 void CallTest::CreateSenderCall(const Call::Config& config) { | 174 void CallTest::CreateSenderCall(const Call::Config& config) { |
176 sender_call_transport_controller_ = new RtpTransportControllerSend( | 175 sender_call_transport_controller_ = new RtpTransportControllerSend( |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 video_send_config_.rtp.extensions.push_back(RtpExtension( | 215 video_send_config_.rtp.extensions.push_back(RtpExtension( |
217 RtpExtension::kVideoRotationUri, kVideoRotationRtpExtensionId)); | 216 RtpExtension::kVideoRotationUri, kVideoRotationRtpExtensionId)); |
218 } | 217 } |
219 | 218 |
220 if (num_audio_streams > 0) { | 219 if (num_audio_streams > 0) { |
221 audio_send_config_ = AudioSendStream::Config(send_transport); | 220 audio_send_config_ = AudioSendStream::Config(send_transport); |
222 audio_send_config_.voe_channel_id = voe_send_.channel_id; | 221 audio_send_config_.voe_channel_id = voe_send_.channel_id; |
223 audio_send_config_.rtp.ssrc = kAudioSendSsrc; | 222 audio_send_config_.rtp.ssrc = kAudioSendSsrc; |
224 audio_send_config_.send_codec_spec = | 223 audio_send_config_.send_codec_spec = |
225 rtc::Optional<AudioSendStream::Config::SendCodecSpec>( | 224 rtc::Optional<AudioSendStream::Config::SendCodecSpec>( |
226 {kAudioSendPayloadType, {"OPUS", 48000, 2, {{"stereo", "1"}}}}); | 225 {kAudioSendPayloadType, {"opus", 48000, 2, {{"stereo", "1"}}}}); |
227 audio_send_config_.encoder_factory = encoder_factory_; | 226 audio_send_config_.encoder_factory = encoder_factory_; |
228 } | 227 } |
229 | 228 |
230 // TODO(brandtr): Update this when we support multistream protection. | 229 // TODO(brandtr): Update this when we support multistream protection. |
231 if (num_flexfec_streams > 0) { | 230 if (num_flexfec_streams > 0) { |
232 video_send_config_.rtp.flexfec.payload_type = kFlexfecPayloadType; | 231 video_send_config_.rtp.flexfec.payload_type = kFlexfecPayloadType; |
233 video_send_config_.rtp.flexfec.ssrc = kFlexfecSendSsrc; | 232 video_send_config_.rtp.flexfec.ssrc = kFlexfecSendSsrc; |
234 video_send_config_.rtp.flexfec.protected_media_ssrcs = {kVideoSendSsrcs[0]}; | 233 video_send_config_.rtp.flexfec.protected_media_ssrcs = {kVideoSendSsrcs[0]}; |
235 } | 234 } |
236 } | 235 } |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 void BaseTest::ModifyFlexfecConfigs( | 582 void BaseTest::ModifyFlexfecConfigs( |
584 std::vector<FlexfecReceiveStream::Config>* receive_configs) {} | 583 std::vector<FlexfecReceiveStream::Config>* receive_configs) {} |
585 | 584 |
586 void BaseTest::OnFlexfecStreamsCreated( | 585 void BaseTest::OnFlexfecStreamsCreated( |
587 const std::vector<FlexfecReceiveStream*>& receive_streams) {} | 586 const std::vector<FlexfecReceiveStream*>& receive_streams) {} |
588 | 587 |
589 void BaseTest::OnFrameGeneratorCapturerCreated( | 588 void BaseTest::OnFrameGeneratorCapturerCreated( |
590 FrameGeneratorCapturer* frame_generator_capturer) { | 589 FrameGeneratorCapturer* frame_generator_capturer) { |
591 } | 590 } |
592 | 591 |
593 void BaseTest::OnTestFinished() { | 592 void BaseTest::OnStreamsStopped() { |
594 } | 593 } |
595 | 594 |
596 SendTest::SendTest(unsigned int timeout_ms) : BaseTest(timeout_ms) { | 595 SendTest::SendTest(unsigned int timeout_ms) : BaseTest(timeout_ms) { |
597 } | 596 } |
598 | 597 |
599 bool SendTest::ShouldCreateReceivers() const { | 598 bool SendTest::ShouldCreateReceivers() const { |
600 return false; | 599 return false; |
601 } | 600 } |
602 | 601 |
603 EndToEndTest::EndToEndTest() {} | 602 EndToEndTest::EndToEndTest() {} |
604 | 603 |
605 EndToEndTest::EndToEndTest(unsigned int timeout_ms) : BaseTest(timeout_ms) { | 604 EndToEndTest::EndToEndTest(unsigned int timeout_ms) : BaseTest(timeout_ms) { |
606 } | 605 } |
607 | 606 |
608 bool EndToEndTest::ShouldCreateReceivers() const { | 607 bool EndToEndTest::ShouldCreateReceivers() const { |
609 return true; | 608 return true; |
610 } | 609 } |
611 | 610 |
612 } // namespace test | 611 } // namespace test |
613 } // namespace webrtc | 612 } // namespace webrtc |
OLD | NEW |