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 |
| 11 #include "webrtc/test/call_test.h" |
| 12 |
| 13 #include <algorithm> |
| 14 |
10 #include "webrtc/base/checks.h" | 15 #include "webrtc/base/checks.h" |
11 #include "webrtc/config.h" | 16 #include "webrtc/config.h" |
12 #include "webrtc/modules/audio_coding/codecs/builtin_audio_decoder_factory.h" | 17 #include "webrtc/modules/audio_coding/codecs/builtin_audio_decoder_factory.h" |
13 #include "webrtc/test/call_test.h" | |
14 #include "webrtc/test/testsupport/fileutils.h" | 18 #include "webrtc/test/testsupport/fileutils.h" |
15 #include "webrtc/voice_engine/include/voe_base.h" | 19 #include "webrtc/voice_engine/include/voe_base.h" |
16 | 20 |
17 namespace webrtc { | 21 namespace webrtc { |
18 namespace test { | 22 namespace test { |
19 | 23 |
20 namespace { | 24 namespace { |
21 const int kVideoRotationRtpExtensionId = 4; | 25 const int kVideoRotationRtpExtensionId = 4; |
22 } | 26 } |
23 | 27 |
24 CallTest::CallTest() | 28 CallTest::CallTest() |
25 : clock_(Clock::GetRealTimeClock()), | 29 : clock_(Clock::GetRealTimeClock()), |
26 video_send_config_(nullptr), | 30 video_send_config_(nullptr), |
27 video_send_stream_(nullptr), | 31 video_send_stream_(nullptr), |
28 audio_send_config_(nullptr), | 32 audio_send_config_(nullptr), |
29 audio_send_stream_(nullptr), | 33 audio_send_stream_(nullptr), |
30 fake_encoder_(clock_), | 34 fake_encoder_(clock_), |
31 num_video_streams_(1), | 35 num_video_streams_(1), |
32 num_audio_streams_(0), | 36 num_audio_streams_(0), |
| 37 num_flexfec_streams_(0), |
33 decoder_factory_(CreateBuiltinAudioDecoderFactory()), | 38 decoder_factory_(CreateBuiltinAudioDecoderFactory()), |
34 fake_send_audio_device_(nullptr), | 39 fake_send_audio_device_(nullptr), |
35 fake_recv_audio_device_(nullptr) {} | 40 fake_recv_audio_device_(nullptr) {} |
36 | 41 |
37 CallTest::~CallTest() { | 42 CallTest::~CallTest() { |
38 } | 43 } |
39 | 44 |
40 void CallTest::RunBaseTest(BaseTest* test) { | 45 void CallTest::RunBaseTest(BaseTest* test) { |
41 num_video_streams_ = test->GetNumVideoStreams(); | 46 num_video_streams_ = test->GetNumVideoStreams(); |
42 num_audio_streams_ = test->GetNumAudioStreams(); | 47 num_audio_streams_ = test->GetNumAudioStreams(); |
| 48 num_flexfec_streams_ = test->GetNumFlexfecStreams(); |
43 RTC_DCHECK(num_video_streams_ > 0 || num_audio_streams_ > 0); | 49 RTC_DCHECK(num_video_streams_ > 0 || num_audio_streams_ > 0); |
44 Call::Config send_config(test->GetSenderCallConfig()); | 50 Call::Config send_config(test->GetSenderCallConfig()); |
45 if (num_audio_streams_ > 0) { | 51 if (num_audio_streams_ > 0) { |
46 CreateVoiceEngines(); | 52 CreateVoiceEngines(); |
47 AudioState::Config audio_state_config; | 53 AudioState::Config audio_state_config; |
48 audio_state_config.voice_engine = voe_send_.voice_engine; | 54 audio_state_config.voice_engine = voe_send_.voice_engine; |
49 send_config.audio_state = AudioState::Create(audio_state_config); | 55 send_config.audio_state = AudioState::Create(audio_state_config); |
50 } | 56 } |
51 CreateSenderCall(send_config); | 57 CreateSenderCall(send_config); |
52 if (test->ShouldCreateReceivers()) { | 58 if (test->ShouldCreateReceivers()) { |
(...skipping 11 matching lines...) Expand all Loading... |
64 | 70 |
65 if (test->ShouldCreateReceivers()) { | 71 if (test->ShouldCreateReceivers()) { |
66 send_transport_->SetReceiver(receiver_call_->Receiver()); | 72 send_transport_->SetReceiver(receiver_call_->Receiver()); |
67 receive_transport_->SetReceiver(sender_call_->Receiver()); | 73 receive_transport_->SetReceiver(sender_call_->Receiver()); |
68 } else { | 74 } else { |
69 // Sender-only call delivers to itself. | 75 // Sender-only call delivers to itself. |
70 send_transport_->SetReceiver(sender_call_->Receiver()); | 76 send_transport_->SetReceiver(sender_call_->Receiver()); |
71 receive_transport_->SetReceiver(nullptr); | 77 receive_transport_->SetReceiver(nullptr); |
72 } | 78 } |
73 | 79 |
74 CreateSendConfig(num_video_streams_, num_audio_streams_, | 80 CreateSendConfig(num_video_streams_, num_audio_streams_, num_flexfec_streams_, |
75 send_transport_.get()); | 81 send_transport_.get()); |
76 if (test->ShouldCreateReceivers()) { | 82 if (test->ShouldCreateReceivers()) { |
77 CreateMatchingReceiveConfigs(receive_transport_.get()); | 83 CreateMatchingReceiveConfigs(receive_transport_.get()); |
78 } | 84 } |
79 if (num_video_streams_ > 0) { | 85 if (num_video_streams_ > 0) { |
80 test->ModifyVideoConfigs(&video_send_config_, &video_receive_configs_, | 86 test->ModifyVideoConfigs(&video_send_config_, &video_receive_configs_, |
81 &video_encoder_config_); | 87 &video_encoder_config_); |
82 } | 88 } |
83 if (num_audio_streams_ > 0) | 89 if (num_audio_streams_ > 0) { |
84 test->ModifyAudioConfigs(&audio_send_config_, &audio_receive_configs_); | 90 test->ModifyAudioConfigs(&audio_send_config_, &audio_receive_configs_); |
| 91 } |
| 92 if (num_flexfec_streams_ > 0) { |
| 93 test->ModifyFlexfecConfigs(&flexfec_receive_configs_); |
| 94 } |
85 | 95 |
86 if (num_video_streams_ > 0) { | 96 if (num_video_streams_ > 0) { |
87 CreateVideoStreams(); | 97 CreateVideoStreams(); |
88 test->OnVideoStreamsCreated(video_send_stream_, video_receive_streams_); | 98 test->OnVideoStreamsCreated(video_send_stream_, video_receive_streams_); |
89 } | 99 } |
90 if (num_audio_streams_ > 0) { | 100 if (num_audio_streams_ > 0) { |
91 CreateAudioStreams(); | 101 CreateAudioStreams(); |
92 test->OnAudioStreamsCreated(audio_send_stream_, audio_receive_streams_); | 102 test->OnAudioStreamsCreated(audio_send_stream_, audio_receive_streams_); |
93 } | 103 } |
| 104 if (num_flexfec_streams_ > 0) { |
| 105 CreateFlexfecStreams(); |
| 106 test->OnFlexfecStreamsCreated(flexfec_receive_streams_); |
| 107 } |
94 | 108 |
95 if (num_video_streams_ > 0) { | 109 if (num_video_streams_ > 0) { |
96 int width = kDefaultWidth; | 110 int width = kDefaultWidth; |
97 int height = kDefaultHeight; | 111 int height = kDefaultHeight; |
98 int frame_rate = kDefaultFramerate; | 112 int frame_rate = kDefaultFramerate; |
99 test->ModifyVideoCaptureStartResolution(&width, &height, &frame_rate); | 113 test->ModifyVideoCaptureStartResolution(&width, &height, &frame_rate); |
100 CreateFrameGeneratorCapturer(frame_rate, width, height); | 114 CreateFrameGeneratorCapturer(frame_rate, width, height); |
101 test->OnFrameGeneratorCapturerCreated(frame_generator_capturer_.get()); | 115 test->OnFrameGeneratorCapturerCreated(frame_generator_capturer_.get()); |
102 } | 116 } |
103 | 117 |
(...skipping 18 matching lines...) Expand all Loading... |
122 fake_send_audio_device_->Start(); | 136 fake_send_audio_device_->Start(); |
123 audio_send_stream_->Start(); | 137 audio_send_stream_->Start(); |
124 EXPECT_EQ(0, voe_send_.base->StartSend(voe_send_.channel_id)); | 138 EXPECT_EQ(0, voe_send_.base->StartSend(voe_send_.channel_id)); |
125 } | 139 } |
126 for (AudioReceiveStream* audio_recv_stream : audio_receive_streams_) | 140 for (AudioReceiveStream* audio_recv_stream : audio_receive_streams_) |
127 audio_recv_stream->Start(); | 141 audio_recv_stream->Start(); |
128 if (!audio_receive_streams_.empty()) { | 142 if (!audio_receive_streams_.empty()) { |
129 fake_recv_audio_device_->Start(); | 143 fake_recv_audio_device_->Start(); |
130 EXPECT_EQ(0, voe_recv_.base->StartPlayout(voe_recv_.channel_id)); | 144 EXPECT_EQ(0, voe_recv_.base->StartPlayout(voe_recv_.channel_id)); |
131 } | 145 } |
| 146 for (FlexfecReceiveStream* flexfec_recv_stream : flexfec_receive_streams_) |
| 147 flexfec_recv_stream->Start(); |
132 if (frame_generator_capturer_.get() != NULL) | 148 if (frame_generator_capturer_.get() != NULL) |
133 frame_generator_capturer_->Start(); | 149 frame_generator_capturer_->Start(); |
134 } | 150 } |
135 | 151 |
136 void CallTest::Stop() { | 152 void CallTest::Stop() { |
137 if (frame_generator_capturer_.get() != NULL) | 153 if (frame_generator_capturer_.get() != NULL) |
138 frame_generator_capturer_->Stop(); | 154 frame_generator_capturer_->Stop(); |
| 155 for (FlexfecReceiveStream* flexfec_recv_stream : flexfec_receive_streams_) |
| 156 flexfec_recv_stream->Stop(); |
139 if (!audio_receive_streams_.empty()) { | 157 if (!audio_receive_streams_.empty()) { |
140 fake_recv_audio_device_->Stop(); | 158 fake_recv_audio_device_->Stop(); |
141 EXPECT_EQ(0, voe_recv_.base->StopPlayout(voe_recv_.channel_id)); | 159 EXPECT_EQ(0, voe_recv_.base->StopPlayout(voe_recv_.channel_id)); |
142 } | 160 } |
143 for (AudioReceiveStream* audio_recv_stream : audio_receive_streams_) | 161 for (AudioReceiveStream* audio_recv_stream : audio_receive_streams_) |
144 audio_recv_stream->Stop(); | 162 audio_recv_stream->Stop(); |
145 if (audio_send_stream_) { | 163 if (audio_send_stream_) { |
146 fake_send_audio_device_->Stop(); | 164 fake_send_audio_device_->Stop(); |
147 EXPECT_EQ(0, voe_send_.base->StopSend(voe_send_.channel_id)); | 165 EXPECT_EQ(0, voe_send_.base->StopSend(voe_send_.channel_id)); |
148 audio_send_stream_->Stop(); | 166 audio_send_stream_->Stop(); |
(...skipping 18 matching lines...) Expand all Loading... |
167 receiver_call_.reset(Call::Create(config)); | 185 receiver_call_.reset(Call::Create(config)); |
168 } | 186 } |
169 | 187 |
170 void CallTest::DestroyCalls() { | 188 void CallTest::DestroyCalls() { |
171 sender_call_.reset(); | 189 sender_call_.reset(); |
172 receiver_call_.reset(); | 190 receiver_call_.reset(); |
173 } | 191 } |
174 | 192 |
175 void CallTest::CreateSendConfig(size_t num_video_streams, | 193 void CallTest::CreateSendConfig(size_t num_video_streams, |
176 size_t num_audio_streams, | 194 size_t num_audio_streams, |
| 195 size_t num_flexfec_streams, |
177 Transport* send_transport) { | 196 Transport* send_transport) { |
178 RTC_DCHECK(num_video_streams <= kNumSsrcs); | 197 RTC_DCHECK(num_video_streams <= kNumSsrcs); |
179 RTC_DCHECK_LE(num_audio_streams, 1u); | 198 RTC_DCHECK_LE(num_audio_streams, 1u); |
| 199 RTC_DCHECK_LE(num_flexfec_streams, 1u); |
180 RTC_DCHECK(num_audio_streams == 0 || voe_send_.channel_id >= 0); | 200 RTC_DCHECK(num_audio_streams == 0 || voe_send_.channel_id >= 0); |
181 if (num_video_streams > 0) { | 201 if (num_video_streams > 0) { |
182 video_send_config_ = VideoSendStream::Config(send_transport); | 202 video_send_config_ = VideoSendStream::Config(send_transport); |
183 video_send_config_.encoder_settings.encoder = &fake_encoder_; | 203 video_send_config_.encoder_settings.encoder = &fake_encoder_; |
184 video_send_config_.encoder_settings.payload_name = "FAKE"; | 204 video_send_config_.encoder_settings.payload_name = "FAKE"; |
185 video_send_config_.encoder_settings.payload_type = | 205 video_send_config_.encoder_settings.payload_type = |
186 kFakeVideoSendPayloadType; | 206 kFakeVideoSendPayloadType; |
187 video_send_config_.rtp.extensions.push_back( | 207 video_send_config_.rtp.extensions.push_back( |
188 RtpExtension(RtpExtension::kAbsSendTimeUri, kAbsSendTimeExtensionId)); | 208 RtpExtension(RtpExtension::kAbsSendTimeUri, kAbsSendTimeExtensionId)); |
189 FillEncoderConfiguration(num_video_streams, &video_encoder_config_); | 209 FillEncoderConfiguration(num_video_streams, &video_encoder_config_); |
190 | 210 |
191 for (size_t i = 0; i < num_video_streams; ++i) | 211 for (size_t i = 0; i < num_video_streams; ++i) |
192 video_send_config_.rtp.ssrcs.push_back(kVideoSendSsrcs[i]); | 212 video_send_config_.rtp.ssrcs.push_back(kVideoSendSsrcs[i]); |
193 video_send_config_.rtp.extensions.push_back(RtpExtension( | 213 video_send_config_.rtp.extensions.push_back(RtpExtension( |
194 RtpExtension::kVideoRotationUri, kVideoRotationRtpExtensionId)); | 214 RtpExtension::kVideoRotationUri, kVideoRotationRtpExtensionId)); |
195 } | 215 } |
196 | 216 |
197 if (num_audio_streams > 0) { | 217 if (num_audio_streams > 0) { |
198 audio_send_config_ = AudioSendStream::Config(send_transport); | 218 audio_send_config_ = AudioSendStream::Config(send_transport); |
199 audio_send_config_.voe_channel_id = voe_send_.channel_id; | 219 audio_send_config_.voe_channel_id = voe_send_.channel_id; |
200 audio_send_config_.rtp.ssrc = kAudioSendSsrc; | 220 audio_send_config_.rtp.ssrc = kAudioSendSsrc; |
201 audio_send_config_.send_codec_spec.codec_inst = | 221 audio_send_config_.send_codec_spec.codec_inst = |
202 CodecInst{kAudioSendPayloadType, "ISAC", 16000, 480, 1, 32000}; | 222 CodecInst{kAudioSendPayloadType, "ISAC", 16000, 480, 1, 32000}; |
203 } | 223 } |
| 224 |
| 225 // TODO(brandtr): Update this when we support multistream protection. |
| 226 if (num_flexfec_streams > 0) { |
| 227 video_send_config_.rtp.flexfec.flexfec_payload_type = kFlexfecPayloadType; |
| 228 video_send_config_.rtp.flexfec.flexfec_ssrc = kFlexfecSendSsrc; |
| 229 video_send_config_.rtp.flexfec.protected_media_ssrcs = {kVideoSendSsrcs[0]}; |
| 230 } |
204 } | 231 } |
205 | 232 |
206 void CallTest::CreateMatchingReceiveConfigs(Transport* rtcp_send_transport) { | 233 void CallTest::CreateMatchingReceiveConfigs(Transport* rtcp_send_transport) { |
207 RTC_DCHECK(video_receive_configs_.empty()); | 234 RTC_DCHECK(video_receive_configs_.empty()); |
208 RTC_DCHECK(allocated_decoders_.empty()); | 235 RTC_DCHECK(allocated_decoders_.empty()); |
209 if (num_video_streams_ > 0) { | 236 if (num_video_streams_ > 0) { |
210 RTC_DCHECK(!video_send_config_.rtp.ssrcs.empty()); | 237 RTC_DCHECK(!video_send_config_.rtp.ssrcs.empty()); |
211 VideoReceiveStream::Config video_config(rtcp_send_transport); | 238 VideoReceiveStream::Config video_config(rtcp_send_transport); |
212 video_config.rtp.remb = true; | 239 video_config.rtp.remb = true; |
213 video_config.rtp.local_ssrc = kReceiverLocalVideoSsrc; | 240 video_config.rtp.local_ssrc = kReceiverLocalVideoSsrc; |
(...skipping 16 matching lines...) Expand all Loading... |
230 if (num_audio_streams_ == 1) { | 257 if (num_audio_streams_ == 1) { |
231 RTC_DCHECK_LE(0, voe_send_.channel_id); | 258 RTC_DCHECK_LE(0, voe_send_.channel_id); |
232 AudioReceiveStream::Config audio_config; | 259 AudioReceiveStream::Config audio_config; |
233 audio_config.rtp.local_ssrc = kReceiverLocalAudioSsrc; | 260 audio_config.rtp.local_ssrc = kReceiverLocalAudioSsrc; |
234 audio_config.rtcp_send_transport = rtcp_send_transport; | 261 audio_config.rtcp_send_transport = rtcp_send_transport; |
235 audio_config.voe_channel_id = voe_recv_.channel_id; | 262 audio_config.voe_channel_id = voe_recv_.channel_id; |
236 audio_config.rtp.remote_ssrc = audio_send_config_.rtp.ssrc; | 263 audio_config.rtp.remote_ssrc = audio_send_config_.rtp.ssrc; |
237 audio_config.decoder_factory = decoder_factory_; | 264 audio_config.decoder_factory = decoder_factory_; |
238 audio_receive_configs_.push_back(audio_config); | 265 audio_receive_configs_.push_back(audio_config); |
239 } | 266 } |
| 267 |
| 268 // TODO(brandtr): Update this when we support multistream protection. |
| 269 RTC_DCHECK(num_flexfec_streams_ <= 1); |
| 270 if (num_flexfec_streams_ == 1) { |
| 271 FlexfecReceiveStream::Config flexfec_config; |
| 272 flexfec_config.flexfec_payload_type = kFlexfecPayloadType; |
| 273 flexfec_config.flexfec_ssrc = kFlexfecSendSsrc; |
| 274 flexfec_config.protected_media_ssrcs = {kVideoSendSsrcs[0]}; |
| 275 flexfec_receive_configs_.push_back(flexfec_config); |
| 276 } |
240 } | 277 } |
241 | 278 |
242 void CallTest::CreateFrameGeneratorCapturerWithDrift(Clock* clock, | 279 void CallTest::CreateFrameGeneratorCapturerWithDrift(Clock* clock, |
243 float speed, | 280 float speed, |
244 int framerate, | 281 int framerate, |
245 int width, | 282 int width, |
246 int height) { | 283 int height) { |
247 frame_generator_capturer_.reset(test::FrameGeneratorCapturer::Create( | 284 frame_generator_capturer_.reset(test::FrameGeneratorCapturer::Create( |
248 width, height, framerate * speed, clock)); | 285 width, height, framerate * speed, clock)); |
249 video_send_stream_->SetSource( | 286 video_send_stream_->SetSource( |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 } | 326 } |
290 | 327 |
291 void CallTest::CreateAudioStreams() { | 328 void CallTest::CreateAudioStreams() { |
292 audio_send_stream_ = sender_call_->CreateAudioSendStream(audio_send_config_); | 329 audio_send_stream_ = sender_call_->CreateAudioSendStream(audio_send_config_); |
293 for (size_t i = 0; i < audio_receive_configs_.size(); ++i) { | 330 for (size_t i = 0; i < audio_receive_configs_.size(); ++i) { |
294 audio_receive_streams_.push_back( | 331 audio_receive_streams_.push_back( |
295 receiver_call_->CreateAudioReceiveStream(audio_receive_configs_[i])); | 332 receiver_call_->CreateAudioReceiveStream(audio_receive_configs_[i])); |
296 } | 333 } |
297 } | 334 } |
298 | 335 |
| 336 void CallTest::CreateFlexfecStreams() { |
| 337 for (size_t i = 0; i < flexfec_receive_configs_.size(); ++i) { |
| 338 flexfec_receive_streams_.push_back( |
| 339 receiver_call_->CreateFlexfecReceiveStream( |
| 340 flexfec_receive_configs_[i])); |
| 341 } |
| 342 } |
| 343 |
299 void CallTest::DestroyStreams() { | 344 void CallTest::DestroyStreams() { |
300 if (video_send_stream_) | 345 if (video_send_stream_) |
301 sender_call_->DestroyVideoSendStream(video_send_stream_); | 346 sender_call_->DestroyVideoSendStream(video_send_stream_); |
302 video_send_stream_ = nullptr; | 347 video_send_stream_ = nullptr; |
303 for (VideoReceiveStream* video_recv_stream : video_receive_streams_) | 348 for (VideoReceiveStream* video_recv_stream : video_receive_streams_) |
304 receiver_call_->DestroyVideoReceiveStream(video_recv_stream); | 349 receiver_call_->DestroyVideoReceiveStream(video_recv_stream); |
305 | 350 |
306 if (audio_send_stream_) | 351 if (audio_send_stream_) |
307 sender_call_->DestroyAudioSendStream(audio_send_stream_); | 352 sender_call_->DestroyAudioSendStream(audio_send_stream_); |
308 audio_send_stream_ = nullptr; | 353 audio_send_stream_ = nullptr; |
309 for (AudioReceiveStream* audio_recv_stream : audio_receive_streams_) | 354 for (AudioReceiveStream* audio_recv_stream : audio_receive_streams_) |
310 receiver_call_->DestroyAudioReceiveStream(audio_recv_stream); | 355 receiver_call_->DestroyAudioReceiveStream(audio_recv_stream); |
| 356 |
| 357 for (FlexfecReceiveStream* flexfec_recv_stream : flexfec_receive_streams_) |
| 358 receiver_call_->DestroyFlexfecReceiveStream(flexfec_recv_stream); |
| 359 |
311 video_receive_streams_.clear(); | 360 video_receive_streams_.clear(); |
312 | |
313 allocated_decoders_.clear(); | 361 allocated_decoders_.clear(); |
314 } | 362 } |
315 | 363 |
316 void CallTest::CreateVoiceEngines() { | 364 void CallTest::CreateVoiceEngines() { |
317 CreateFakeAudioDevices(); | 365 CreateFakeAudioDevices(); |
318 voe_send_.voice_engine = VoiceEngine::Create(); | 366 voe_send_.voice_engine = VoiceEngine::Create(); |
319 voe_send_.base = VoEBase::GetInterface(voe_send_.voice_engine); | 367 voe_send_.base = VoEBase::GetInterface(voe_send_.voice_engine); |
320 EXPECT_EQ(0, voe_send_.base->Init(fake_send_audio_device_.get(), nullptr, | 368 EXPECT_EQ(0, voe_send_.base->Init(fake_send_audio_device_.get(), nullptr, |
321 decoder_factory_)); | 369 decoder_factory_)); |
322 VoEBase::ChannelConfig config; | 370 VoEBase::ChannelConfig config; |
(...skipping 30 matching lines...) Expand all Loading... |
353 const int CallTest::kDefaultHeight; | 401 const int CallTest::kDefaultHeight; |
354 const int CallTest::kDefaultFramerate; | 402 const int CallTest::kDefaultFramerate; |
355 const int CallTest::kDefaultTimeoutMs = 30 * 1000; | 403 const int CallTest::kDefaultTimeoutMs = 30 * 1000; |
356 const int CallTest::kLongTimeoutMs = 120 * 1000; | 404 const int CallTest::kLongTimeoutMs = 120 * 1000; |
357 const uint8_t CallTest::kVideoSendPayloadType = 100; | 405 const uint8_t CallTest::kVideoSendPayloadType = 100; |
358 const uint8_t CallTest::kFakeVideoSendPayloadType = 125; | 406 const uint8_t CallTest::kFakeVideoSendPayloadType = 125; |
359 const uint8_t CallTest::kSendRtxPayloadType = 98; | 407 const uint8_t CallTest::kSendRtxPayloadType = 98; |
360 const uint8_t CallTest::kRedPayloadType = 118; | 408 const uint8_t CallTest::kRedPayloadType = 118; |
361 const uint8_t CallTest::kRtxRedPayloadType = 99; | 409 const uint8_t CallTest::kRtxRedPayloadType = 99; |
362 const uint8_t CallTest::kUlpfecPayloadType = 119; | 410 const uint8_t CallTest::kUlpfecPayloadType = 119; |
| 411 const uint8_t CallTest::kFlexfecPayloadType = 120; |
363 const uint8_t CallTest::kAudioSendPayloadType = 103; | 412 const uint8_t CallTest::kAudioSendPayloadType = 103; |
364 const uint32_t CallTest::kSendRtxSsrcs[kNumSsrcs] = {0xBADCAFD, 0xBADCAFE, | 413 const uint32_t CallTest::kSendRtxSsrcs[kNumSsrcs] = {0xBADCAFD, 0xBADCAFE, |
365 0xBADCAFF}; | 414 0xBADCAFF}; |
366 const uint32_t CallTest::kVideoSendSsrcs[kNumSsrcs] = {0xC0FFED, 0xC0FFEE, | 415 const uint32_t CallTest::kVideoSendSsrcs[kNumSsrcs] = {0xC0FFED, 0xC0FFEE, |
367 0xC0FFEF}; | 416 0xC0FFEF}; |
368 const uint32_t CallTest::kAudioSendSsrc = 0xDEADBEEF; | 417 const uint32_t CallTest::kAudioSendSsrc = 0xDEADBEEF; |
| 418 const uint32_t CallTest::kFlexfecSendSsrc = 0xBADBEEF; |
369 const uint32_t CallTest::kReceiverLocalVideoSsrc = 0x123456; | 419 const uint32_t CallTest::kReceiverLocalVideoSsrc = 0x123456; |
370 const uint32_t CallTest::kReceiverLocalAudioSsrc = 0x1234567; | 420 const uint32_t CallTest::kReceiverLocalAudioSsrc = 0x1234567; |
371 const int CallTest::kNackRtpHistoryMs = 1000; | 421 const int CallTest::kNackRtpHistoryMs = 1000; |
372 | 422 |
373 BaseTest::BaseTest(unsigned int timeout_ms) : RtpRtcpObserver(timeout_ms) { | 423 BaseTest::BaseTest(unsigned int timeout_ms) : RtpRtcpObserver(timeout_ms) { |
374 } | 424 } |
375 | 425 |
376 BaseTest::~BaseTest() { | 426 BaseTest::~BaseTest() { |
377 } | 427 } |
378 | 428 |
(...skipping 19 matching lines...) Expand all Loading... |
398 } | 448 } |
399 | 449 |
400 size_t BaseTest::GetNumVideoStreams() const { | 450 size_t BaseTest::GetNumVideoStreams() const { |
401 return 1; | 451 return 1; |
402 } | 452 } |
403 | 453 |
404 size_t BaseTest::GetNumAudioStreams() const { | 454 size_t BaseTest::GetNumAudioStreams() const { |
405 return 0; | 455 return 0; |
406 } | 456 } |
407 | 457 |
| 458 size_t BaseTest::GetNumFlexfecStreams() const { |
| 459 return 0; |
| 460 } |
| 461 |
408 void BaseTest::ModifyVideoConfigs( | 462 void BaseTest::ModifyVideoConfigs( |
409 VideoSendStream::Config* send_config, | 463 VideoSendStream::Config* send_config, |
410 std::vector<VideoReceiveStream::Config>* receive_configs, | 464 std::vector<VideoReceiveStream::Config>* receive_configs, |
411 VideoEncoderConfig* encoder_config) {} | 465 VideoEncoderConfig* encoder_config) {} |
412 | 466 |
413 void BaseTest::ModifyVideoCaptureStartResolution(int* width, | 467 void BaseTest::ModifyVideoCaptureStartResolution(int* width, |
414 int* heigt, | 468 int* heigt, |
415 int* frame_rate) {} | 469 int* frame_rate) {} |
416 | 470 |
417 void BaseTest::OnVideoStreamsCreated( | 471 void BaseTest::OnVideoStreamsCreated( |
418 VideoSendStream* send_stream, | 472 VideoSendStream* send_stream, |
419 const std::vector<VideoReceiveStream*>& receive_streams) {} | 473 const std::vector<VideoReceiveStream*>& receive_streams) {} |
420 | 474 |
421 void BaseTest::ModifyAudioConfigs( | 475 void BaseTest::ModifyAudioConfigs( |
422 AudioSendStream::Config* send_config, | 476 AudioSendStream::Config* send_config, |
423 std::vector<AudioReceiveStream::Config>* receive_configs) {} | 477 std::vector<AudioReceiveStream::Config>* receive_configs) {} |
424 | 478 |
425 void BaseTest::OnAudioStreamsCreated( | 479 void BaseTest::OnAudioStreamsCreated( |
426 AudioSendStream* send_stream, | 480 AudioSendStream* send_stream, |
427 const std::vector<AudioReceiveStream*>& receive_streams) {} | 481 const std::vector<AudioReceiveStream*>& receive_streams) {} |
428 | 482 |
| 483 void BaseTest::ModifyFlexfecConfigs( |
| 484 std::vector<FlexfecReceiveStream::Config>* receive_configs) {} |
| 485 |
| 486 void BaseTest::OnFlexfecStreamsCreated( |
| 487 const std::vector<FlexfecReceiveStream*>& receive_streams) {} |
| 488 |
429 void BaseTest::OnFrameGeneratorCapturerCreated( | 489 void BaseTest::OnFrameGeneratorCapturerCreated( |
430 FrameGeneratorCapturer* frame_generator_capturer) { | 490 FrameGeneratorCapturer* frame_generator_capturer) { |
431 } | 491 } |
432 | 492 |
433 SendTest::SendTest(unsigned int timeout_ms) : BaseTest(timeout_ms) { | 493 SendTest::SendTest(unsigned int timeout_ms) : BaseTest(timeout_ms) { |
434 } | 494 } |
435 | 495 |
436 bool SendTest::ShouldCreateReceivers() const { | 496 bool SendTest::ShouldCreateReceivers() const { |
437 return false; | 497 return false; |
438 } | 498 } |
439 | 499 |
440 EndToEndTest::EndToEndTest(unsigned int timeout_ms) : BaseTest(timeout_ms) { | 500 EndToEndTest::EndToEndTest(unsigned int timeout_ms) : BaseTest(timeout_ms) { |
441 } | 501 } |
442 | 502 |
443 bool EndToEndTest::ShouldCreateReceivers() const { | 503 bool EndToEndTest::ShouldCreateReceivers() const { |
444 return true; | 504 return true; |
445 } | 505 } |
446 | 506 |
447 } // namespace test | 507 } // namespace test |
448 } // namespace webrtc | 508 } // namespace webrtc |
OLD | NEW |