blob: f322137a7f32fd92bc714393fbe509e59594b2fe [file] [log] [blame]
pbos@webrtc.org1d096902013-12-13 12:48:05 +00001/*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
asaperssonf8cdd182016-03-15 01:00:47 -070010
pbos@webrtc.org1d096902013-12-13 12:48:05 +000011#include <algorithm>
asaperssonf8cdd182016-03-15 01:00:47 -070012#include <limits>
kwibergb25345e2016-03-12 06:10:44 -080013#include <memory>
pbos@webrtc.org1d096902013-12-13 12:48:05 +000014#include <string>
15
Karl Wiberg918f50c2018-07-05 11:40:33 +020016#include "absl/memory/memory.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020017#include "api/audio_codecs/builtin_audio_encoder_factory.h"
Artem Titov46c4e602018-08-17 14:26:54 +020018#include "api/test/simulated_network.h"
Jiawei Ouc2ebe212018-11-08 10:02:56 -080019#include "api/video/builtin_video_bitrate_allocator_factory.h"
Erik Språngef75ebe2018-05-15 15:18:36 +020020#include "api/video/video_bitrate_allocation.h"
Niels Möller0a8f4352018-05-18 11:37:23 +020021#include "api/video_codecs/video_encoder_config.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020022#include "call/call.h"
Artem Titov4e199e92018-08-20 13:30:39 +020023#include "call/fake_network_pipe.h"
24#include "call/simulated_network.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020025#include "logging/rtc_event_log/rtc_event_log.h"
26#include "modules/audio_coding/include/audio_coding_module.h"
Artem Titov3faa8322018-03-07 14:44:00 +010027#include "modules/audio_device/include/test_audio_device.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020028#include "modules/audio_mixer/audio_mixer_impl.h"
29#include "modules/rtp_rtcp/include/rtp_header_parser.h"
Steve Anton10542f22019-01-11 09:11:00 -080030#include "rtc_base/bitrate_allocation_strategy.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020031#include "rtc_base/checks.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020032#include "rtc_base/thread_annotations.h"
Mirko Bonadei17f48782018-09-28 08:51:10 +020033#include "system_wrappers/include/metrics.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020034#include "test/call_test.h"
35#include "test/direct_transport.h"
36#include "test/drifting_clock.h"
37#include "test/encoder_settings.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020038#include "test/fake_encoder.h"
39#include "test/field_trial.h"
40#include "test/frame_generator.h"
41#include "test/frame_generator_capturer.h"
42#include "test/gtest.h"
Niels Möllerae4237e2018-10-05 11:28:38 +020043#include "test/null_transport.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020044#include "test/rtp_rtcp_observer.h"
45#include "test/single_threaded_task_queue.h"
Steve Anton10542f22019-01-11 09:11:00 -080046#include "test/testsupport/file_utils.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020047#include "test/testsupport/perf_test.h"
Niels Möllercbcbc222018-09-28 09:07:24 +020048#include "test/video_encoder_proxy_factory.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020049#include "video/transport_adapter.h"
pbos@webrtc.org1d096902013-12-13 12:48:05 +000050
danilchap9c6a0c72016-02-10 10:54:47 -080051using webrtc::test::DriftingClock;
danilchap9c6a0c72016-02-10 10:54:47 -080052
pbos@webrtc.org1d096902013-12-13 12:48:05 +000053namespace webrtc {
Elad Alond8d32482019-02-18 23:45:57 +010054namespace {
55enum : int { // The first valid value is 1.
56 kTransportSequenceNumberExtensionId = 1,
57};
58} // namespace
pbos@webrtc.org1d096902013-12-13 12:48:05 +000059
pbos@webrtc.org994d0b72014-06-27 08:47:52 +000060class CallPerfTest : public test::CallTest {
Elad Alond8d32482019-02-18 23:45:57 +010061 public:
62 CallPerfTest() {
63 RegisterRtpExtension(RtpExtension(RtpExtension::kTransportSequenceNumberUri,
64 kTransportSequenceNumberExtensionId));
65 }
66
asapersson@webrtc.orgbdc5ed22014-01-31 10:05:07 +000067 protected:
Yves Gerey665174f2018-06-19 15:03:05 +020068 enum class FecMode { kOn, kOff };
69 enum class CreateOrder { kAudioFirst, kVideoFirst };
Danil Chapovalovcde5d6b2016-02-15 11:14:58 +010070 void TestAudioVideoSync(FecMode fec,
71 CreateOrder create_first,
danilchap9c6a0c72016-02-10 10:54:47 -080072 float video_ntp_speed,
73 float video_rtp_speed,
Edward Lemur947f3fe2017-12-28 15:50:33 +010074 float audio_rtp_speed,
75 const std::string& test_label);
stefan@webrtc.org01581da2014-09-04 06:48:14 +000076
pbos@webrtc.org3349ae02014-03-13 12:52:27 +000077 void TestMinTransmitBitrate(bool pad_to_min_bitrate);
78
Artem Titov75e36472018-10-08 12:28:56 +020079 void TestCaptureNtpTime(const BuiltInNetworkBehaviorConfig& net_config,
wu@webrtc.orgcd701192014-04-24 22:10:24 +000080 int threshold_ms,
81 int start_time_ms,
82 int run_time_ms);
Alex Narestd0e196b2017-11-22 17:22:35 +010083 void TestMinAudioVideoBitrate(bool use_bitrate_allocation_strategy,
84 int test_bitrate_from,
85 int test_bitrate_to,
86 int test_bitrate_step,
87 int min_bwe,
88 int start_bwe,
89 int max_bwe);
pbos@webrtc.org1d096902013-12-13 12:48:05 +000090};
91
asaperssonf8cdd182016-03-15 01:00:47 -070092class VideoRtcpAndSyncObserver : public test::RtpRtcpObserver,
nisse7ade7b32016-03-23 04:48:10 -070093 public rtc::VideoSinkInterface<VideoFrame> {
pbos@webrtc.org1d096902013-12-13 12:48:05 +000094 static const int kInSyncThresholdMs = 50;
95 static const int kStartupTimeMs = 2000;
96 static const int kMinRunTimeMs = 30000;
97
98 public:
Edward Lemur947f3fe2017-12-28 15:50:33 +010099 explicit VideoRtcpAndSyncObserver(Clock* clock, const std::string& test_label)
asaperssonf8cdd182016-03-15 01:00:47 -0700100 : test::RtpRtcpObserver(CallPerfTest::kLongTimeoutMs),
101 clock_(clock),
Edward Lemur947f3fe2017-12-28 15:50:33 +0100102 test_label_(test_label),
pbos@webrtc.org1d096902013-12-13 12:48:05 +0000103 creation_time_ms_(clock_->TimeInMilliseconds()),
asaperssonf8cdd182016-03-15 01:00:47 -0700104 first_time_in_sync_(-1),
105 receive_stream_(nullptr) {}
pbos@webrtc.org1d096902013-12-13 12:48:05 +0000106
nisseeb83a1a2016-03-21 01:27:56 -0700107 void OnFrame(const VideoFrame& video_frame) override {
asaperssonf8cdd182016-03-15 01:00:47 -0700108 VideoReceiveStream::Stats stats;
109 {
110 rtc::CritScope lock(&crit_);
111 if (receive_stream_)
112 stats = receive_stream_->GetStats();
113 }
114 if (stats.sync_offset_ms == std::numeric_limits<int>::max())
115 return;
116
pbos@webrtc.org1d096902013-12-13 12:48:05 +0000117 int64_t now_ms = clock_->TimeInMilliseconds();
pbos@webrtc.org1d096902013-12-13 12:48:05 +0000118 int64_t time_since_creation = now_ms - creation_time_ms_;
119 // During the first couple of seconds audio and video can falsely be
120 // estimated as being synchronized. We don't want to trigger on those.
121 if (time_since_creation < kStartupTimeMs)
122 return;
asaperssonf8cdd182016-03-15 01:00:47 -0700123 if (std::abs(stats.sync_offset_ms) < kInSyncThresholdMs) {
pbos@webrtc.org1d096902013-12-13 12:48:05 +0000124 if (first_time_in_sync_ == -1) {
125 first_time_in_sync_ = now_ms;
Edward Lemur947f3fe2017-12-28 15:50:33 +0100126 webrtc::test::PrintResult("sync_convergence_time", test_label_,
127 "synchronization", time_since_creation, "ms",
pbos@webrtc.org1d096902013-12-13 12:48:05 +0000128 false);
129 }
130 if (time_since_creation > kMinRunTimeMs)
Peter Boström5811a392015-12-10 13:02:50 +0100131 observation_complete_.Set();
pbos@webrtc.org1d096902013-12-13 12:48:05 +0000132 }
Danil Chapovalov371b43b2016-06-16 09:58:44 +0200133 if (first_time_in_sync_ != -1)
134 sync_offset_ms_list_.push_back(stats.sync_offset_ms);
pbos@webrtc.org1d096902013-12-13 12:48:05 +0000135 }
136
asaperssonf8cdd182016-03-15 01:00:47 -0700137 void set_receive_stream(VideoReceiveStream* receive_stream) {
138 rtc::CritScope lock(&crit_);
139 receive_stream_ = receive_stream;
140 }
141
danilchap46b89b92016-06-03 09:27:37 -0700142 void PrintResults() {
Edward Lemur947f3fe2017-12-28 15:50:33 +0100143 test::PrintResultList("stream_offset", test_label_, "synchronization",
Edward Lemur2f061682017-11-24 13:40:01 +0100144 sync_offset_ms_list_, "ms", false);
danilchap46b89b92016-06-03 09:27:37 -0700145 }
146
pbos@webrtc.org1d096902013-12-13 12:48:05 +0000147 private:
pbos@webrtc.orgde1429e2014-04-28 13:00:21 +0000148 Clock* const clock_;
Edward Lemur947f3fe2017-12-28 15:50:33 +0100149 std::string test_label_;
stefanf116bd02015-10-27 08:29:42 -0700150 const int64_t creation_time_ms_;
pbos@webrtc.org1d096902013-12-13 12:48:05 +0000151 int64_t first_time_in_sync_;
asaperssonf8cdd182016-03-15 01:00:47 -0700152 rtc::CriticalSection crit_;
danilchapa37de392017-09-09 04:17:22 -0700153 VideoReceiveStream* receive_stream_ RTC_GUARDED_BY(crit_);
Edward Lemur2f061682017-11-24 13:40:01 +0100154 std::vector<double> sync_offset_ms_list_;
pbos@webrtc.org1d096902013-12-13 12:48:05 +0000155};
156
Danil Chapovalovcde5d6b2016-02-15 11:14:58 +0100157void CallPerfTest::TestAudioVideoSync(FecMode fec,
158 CreateOrder create_first,
danilchap9c6a0c72016-02-10 10:54:47 -0800159 float video_ntp_speed,
160 float video_rtp_speed,
Edward Lemur947f3fe2017-12-28 15:50:33 +0100161 float audio_rtp_speed,
162 const std::string& test_label) {
pbos8fc7fa72015-07-15 08:02:58 -0700163 const char* kSyncGroup = "av_sync";
Stefan Holmerb86d4e42015-12-07 10:26:18 +0100164 const uint32_t kAudioSendSsrc = 1234;
165 const uint32_t kAudioRecvSsrc = 5678;
pbos@webrtc.org994d0b72014-06-27 08:47:52 +0000166
Artem Titov75e36472018-10-08 12:28:56 +0200167 BuiltInNetworkBehaviorConfig audio_net_config;
mflodman3d7db262016-04-29 00:57:13 -0700168 audio_net_config.queue_delay_ms = 500;
169 audio_net_config.loss_percent = 5;
minyue20c84cc2017-04-10 16:57:57 -0700170
Edward Lemur947f3fe2017-12-28 15:50:33 +0100171 VideoRtcpAndSyncObserver observer(Clock::GetRealTimeClock(), test_label);
eladalon413ee9a2017-08-22 04:02:52 -0700172
minyue20c84cc2017-04-10 16:57:57 -0700173 std::map<uint8_t, MediaType> audio_pt_map;
174 std::map<uint8_t, MediaType> video_pt_map;
minyue20c84cc2017-04-10 16:57:57 -0700175
eladalon413ee9a2017-08-22 04:02:52 -0700176 std::unique_ptr<test::PacketTransport> audio_send_transport;
177 std::unique_ptr<test::PacketTransport> video_send_transport;
178 std::unique_ptr<test::PacketTransport> receive_transport;
Niels Möllerae4237e2018-10-05 11:28:38 +0200179 test::NullTransport rtcp_send_transport;
mflodman3d7db262016-04-29 00:57:13 -0700180
eladalon413ee9a2017-08-22 04:02:52 -0700181 AudioSendStream* audio_send_stream;
Stefan Holmerb86d4e42015-12-07 10:26:18 +0100182 AudioReceiveStream* audio_receive_stream;
eladalon413ee9a2017-08-22 04:02:52 -0700183 std::unique_ptr<DriftingClock> drifting_clock;
pbos8fc7fa72015-07-15 08:02:58 -0700184
eladalon413ee9a2017-08-22 04:02:52 -0700185 task_queue_.SendTask([&]() {
186 metrics::Reset();
Artem Titov3faa8322018-03-07 14:44:00 +0100187 rtc::scoped_refptr<TestAudioDeviceModule> fake_audio_device =
188 TestAudioDeviceModule::CreateTestAudioDeviceModule(
189 TestAudioDeviceModule::CreatePulsedNoiseCapturer(256, 48000),
190 TestAudioDeviceModule::CreateDiscardRenderer(48000),
191 audio_rtp_speed);
Fredrik Solenbergd3195342017-11-21 20:33:05 +0100192 EXPECT_EQ(0, fake_audio_device->Init());
pbos@webrtc.org994d0b72014-06-27 08:47:52 +0000193
eladalon413ee9a2017-08-22 04:02:52 -0700194 AudioState::Config send_audio_state_config;
eladalon413ee9a2017-08-22 04:02:52 -0700195 send_audio_state_config.audio_mixer = AudioMixerImpl::Create();
Ivo Creusen62337e52018-01-09 14:17:33 +0100196 send_audio_state_config.audio_processing =
197 AudioProcessingBuilder().Create();
Fredrik Solenberg2a877972017-12-15 16:42:15 +0100198 send_audio_state_config.audio_device_module = fake_audio_device;
Sebastian Jansson8e6602f2018-07-13 10:43:20 +0200199 Call::Config sender_config(send_event_log_.get());
pbos@webrtc.org1d096902013-12-13 12:48:05 +0000200
Fredrik Solenbergd3195342017-11-21 20:33:05 +0100201 auto audio_state = AudioState::Create(send_audio_state_config);
202 fake_audio_device->RegisterAudioCallback(audio_state->audio_transport());
203 sender_config.audio_state = audio_state;
Sebastian Jansson8e6602f2018-07-13 10:43:20 +0200204 Call::Config receiver_config(recv_event_log_.get());
Fredrik Solenbergd3195342017-11-21 20:33:05 +0100205 receiver_config.audio_state = audio_state;
eladalon413ee9a2017-08-22 04:02:52 -0700206 CreateCalls(sender_config, receiver_config);
207
208 std::copy_if(std::begin(payload_type_map_), std::end(payload_type_map_),
209 std::inserter(audio_pt_map, audio_pt_map.end()),
210 [](const std::pair<const uint8_t, MediaType>& pair) {
211 return pair.second == MediaType::AUDIO;
212 });
213 std::copy_if(std::begin(payload_type_map_), std::end(payload_type_map_),
214 std::inserter(video_pt_map, video_pt_map.end()),
215 [](const std::pair<const uint8_t, MediaType>& pair) {
216 return pair.second == MediaType::VIDEO;
217 });
218
Karl Wiberg918f50c2018-07-05 11:40:33 +0200219 audio_send_transport = absl::make_unique<test::PacketTransport>(
eladalon413ee9a2017-08-22 04:02:52 -0700220 &task_queue_, sender_call_.get(), &observer,
Artem Titov4e199e92018-08-20 13:30:39 +0200221 test::PacketTransport::kSender, audio_pt_map,
222 absl::make_unique<FakeNetworkPipe>(
223 Clock::GetRealTimeClock(),
224 absl::make_unique<SimulatedNetwork>(audio_net_config)));
eladalon413ee9a2017-08-22 04:02:52 -0700225 audio_send_transport->SetReceiver(receiver_call_->Receiver());
226
Karl Wiberg918f50c2018-07-05 11:40:33 +0200227 video_send_transport = absl::make_unique<test::PacketTransport>(
eladalon413ee9a2017-08-22 04:02:52 -0700228 &task_queue_, sender_call_.get(), &observer,
229 test::PacketTransport::kSender, video_pt_map,
Artem Titov4e199e92018-08-20 13:30:39 +0200230 absl::make_unique<FakeNetworkPipe>(
231 Clock::GetRealTimeClock(), absl::make_unique<SimulatedNetwork>(
Artem Titov75e36472018-10-08 12:28:56 +0200232 BuiltInNetworkBehaviorConfig())));
eladalon413ee9a2017-08-22 04:02:52 -0700233 video_send_transport->SetReceiver(receiver_call_->Receiver());
234
Karl Wiberg918f50c2018-07-05 11:40:33 +0200235 receive_transport = absl::make_unique<test::PacketTransport>(
eladalon413ee9a2017-08-22 04:02:52 -0700236 &task_queue_, receiver_call_.get(), &observer,
237 test::PacketTransport::kReceiver, payload_type_map_,
Artem Titov4e199e92018-08-20 13:30:39 +0200238 absl::make_unique<FakeNetworkPipe>(
239 Clock::GetRealTimeClock(), absl::make_unique<SimulatedNetwork>(
Artem Titov75e36472018-10-08 12:28:56 +0200240 BuiltInNetworkBehaviorConfig())));
eladalon413ee9a2017-08-22 04:02:52 -0700241 receive_transport->SetReceiver(sender_call_->Receiver());
242
243 CreateSendConfig(1, 0, 0, video_send_transport.get());
244 CreateMatchingReceiveConfigs(receive_transport.get());
245
Niels Möller7d76a312018-10-26 12:57:07 +0200246 AudioSendStream::Config audio_send_config(audio_send_transport.get(),
247 /*media_transport=*/nullptr);
eladalon413ee9a2017-08-22 04:02:52 -0700248 audio_send_config.rtp.ssrc = kAudioSendSsrc;
Oskar Sundbomfedc00c2017-11-16 10:55:08 +0100249 audio_send_config.send_codec_spec = AudioSendStream::Config::SendCodecSpec(
250 kAudioSendPayloadType, {"ISAC", 16000, 1});
eladalon413ee9a2017-08-22 04:02:52 -0700251 audio_send_config.encoder_factory = CreateBuiltinAudioEncoderFactory();
252 audio_send_stream = sender_call_->CreateAudioSendStream(audio_send_config);
253
Sebastian Janssonf33905d2018-07-13 09:49:00 +0200254 GetVideoSendConfig()->rtp.nack.rtp_history_ms = kNackRtpHistoryMs;
eladalon413ee9a2017-08-22 04:02:52 -0700255 if (fec == FecMode::kOn) {
Sebastian Janssonf33905d2018-07-13 09:49:00 +0200256 GetVideoSendConfig()->rtp.ulpfec.red_payload_type = kRedPayloadType;
257 GetVideoSendConfig()->rtp.ulpfec.ulpfec_payload_type = kUlpfecPayloadType;
nisse3b3622f2017-09-26 02:49:21 -0700258 video_receive_configs_[0].rtp.red_payload_type = kRedPayloadType;
259 video_receive_configs_[0].rtp.ulpfec_payload_type = kUlpfecPayloadType;
eladalon413ee9a2017-08-22 04:02:52 -0700260 }
261 video_receive_configs_[0].rtp.nack.rtp_history_ms = 1000;
262 video_receive_configs_[0].renderer = &observer;
263 video_receive_configs_[0].sync_group = kSyncGroup;
264
265 AudioReceiveStream::Config audio_recv_config;
266 audio_recv_config.rtp.remote_ssrc = kAudioSendSsrc;
267 audio_recv_config.rtp.local_ssrc = kAudioRecvSsrc;
Niels Möllerae4237e2018-10-05 11:28:38 +0200268 audio_recv_config.rtcp_send_transport = &rtcp_send_transport;
eladalon413ee9a2017-08-22 04:02:52 -0700269 audio_recv_config.sync_group = kSyncGroup;
Niels Möller2784a032018-03-28 14:16:04 +0200270 audio_recv_config.decoder_factory = audio_decoder_factory_;
eladalon413ee9a2017-08-22 04:02:52 -0700271 audio_recv_config.decoder_map = {
272 {kAudioSendPayloadType, {"ISAC", 16000, 1}}};
273
274 if (create_first == CreateOrder::kAudioFirst) {
275 audio_receive_stream =
276 receiver_call_->CreateAudioReceiveStream(audio_recv_config);
277 CreateVideoStreams();
278 } else {
279 CreateVideoStreams();
280 audio_receive_stream =
281 receiver_call_->CreateAudioReceiveStream(audio_recv_config);
282 }
283 EXPECT_EQ(1u, video_receive_streams_.size());
284 observer.set_receive_stream(video_receive_streams_[0]);
Karl Wiberg918f50c2018-07-05 11:40:33 +0200285 drifting_clock = absl::make_unique<DriftingClock>(clock_, video_ntp_speed);
eladalon413ee9a2017-08-22 04:02:52 -0700286 CreateFrameGeneratorCapturerWithDrift(drifting_clock.get(), video_rtp_speed,
287 kDefaultFramerate, kDefaultWidth,
288 kDefaultHeight);
289
290 Start();
291
292 audio_send_stream->Start();
293 audio_receive_stream->Start();
294 });
pbos@webrtc.org1d096902013-12-13 12:48:05 +0000295
Peter Boström5811a392015-12-10 13:02:50 +0100296 EXPECT_TRUE(observer.Wait())
pbos@webrtc.org1d096902013-12-13 12:48:05 +0000297 << "Timed out while waiting for audio and video to be synchronized.";
298
eladalon413ee9a2017-08-22 04:02:52 -0700299 task_queue_.SendTask([&]() {
300 audio_send_stream->Stop();
301 audio_receive_stream->Stop();
pbos@webrtc.org1d096902013-12-13 12:48:05 +0000302
eladalon413ee9a2017-08-22 04:02:52 -0700303 Stop();
pbos@webrtc.org1d096902013-12-13 12:48:05 +0000304
eladalon413ee9a2017-08-22 04:02:52 -0700305 DestroyStreams();
Stefan Holmerb86d4e42015-12-07 10:26:18 +0100306
eladalon413ee9a2017-08-22 04:02:52 -0700307 video_send_transport.reset();
308 audio_send_transport.reset();
309 receive_transport.reset();
Stefan Holmerb86d4e42015-12-07 10:26:18 +0100310
eladalon413ee9a2017-08-22 04:02:52 -0700311 sender_call_->DestroyAudioSendStream(audio_send_stream);
312 receiver_call_->DestroyAudioReceiveStream(audio_receive_stream);
pbos@webrtc.org994d0b72014-06-27 08:47:52 +0000313
eladalon413ee9a2017-08-22 04:02:52 -0700314 DestroyCalls();
eladalon413ee9a2017-08-22 04:02:52 -0700315 });
asaperssonf8cdd182016-03-15 01:00:47 -0700316
danilchap46b89b92016-06-03 09:27:37 -0700317 observer.PrintResults();
ilnik5328b9e2017-02-21 05:20:28 -0800318
319 // In quick test synchronization may not be achieved in time.
sprange5d3a3e2017-03-01 06:20:56 -0800320 if (!field_trial::IsEnabled("WebRTC-QuickPerfTest")) {
ilnik5328b9e2017-02-21 05:20:28 -0800321 EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.AVSyncOffsetInMs"));
322 }
pbos@webrtc.org1d096902013-12-13 12:48:05 +0000323}
asapersson@webrtc.orgbdc5ed22014-01-31 10:05:07 +0000324
Niels Möller9a750612018-08-09 11:04:32 +0200325TEST_F(CallPerfTest, PlaysOutAudioAndVideoInSyncWithoutClockDrift) {
326 TestAudioVideoSync(FecMode::kOff, CreateOrder::kAudioFirst,
327 DriftingClock::kNoDrift, DriftingClock::kNoDrift,
328 DriftingClock::kNoDrift, "_video_no_drift");
329}
330
danilchapac287ee2016-02-29 12:17:04 -0800331TEST_F(CallPerfTest, PlaysOutAudioAndVideoInSyncWithVideoNtpDrift) {
Danil Chapovalovcde5d6b2016-02-15 11:14:58 +0100332 TestAudioVideoSync(FecMode::kOff, CreateOrder::kAudioFirst,
333 DriftingClock::PercentsFaster(10.0f),
Edward Lemur947f3fe2017-12-28 15:50:33 +0100334 DriftingClock::kNoDrift, DriftingClock::kNoDrift,
335 "_video_ntp_drift");
danilchap9c6a0c72016-02-10 10:54:47 -0800336}
337
danilchap9c6a0c72016-02-10 10:54:47 -0800338TEST_F(CallPerfTest, PlaysOutAudioAndVideoInSyncWithAudioFasterThanVideoDrift) {
Danil Chapovalovcde5d6b2016-02-15 11:14:58 +0100339 TestAudioVideoSync(FecMode::kOff, CreateOrder::kAudioFirst,
340 DriftingClock::kNoDrift,
danilchap9c6a0c72016-02-10 10:54:47 -0800341 DriftingClock::PercentsSlower(30.0f),
Edward Lemur947f3fe2017-12-28 15:50:33 +0100342 DriftingClock::PercentsFaster(30.0f), "_audio_faster");
danilchap9c6a0c72016-02-10 10:54:47 -0800343}
344
345TEST_F(CallPerfTest, PlaysOutAudioAndVideoInSyncWithVideoFasterThanAudioDrift) {
Danil Chapovalovcde5d6b2016-02-15 11:14:58 +0100346 TestAudioVideoSync(FecMode::kOn, CreateOrder::kVideoFirst,
347 DriftingClock::kNoDrift,
danilchap9c6a0c72016-02-10 10:54:47 -0800348 DriftingClock::PercentsFaster(30.0f),
Edward Lemur947f3fe2017-12-28 15:50:33 +0100349 DriftingClock::PercentsSlower(30.0f), "_video_faster");
stefan@webrtc.org01581da2014-09-04 06:48:14 +0000350}
351
Artem Titov46c4e602018-08-17 14:26:54 +0200352void CallPerfTest::TestCaptureNtpTime(
Artem Titov75e36472018-10-08 12:28:56 +0200353 const BuiltInNetworkBehaviorConfig& net_config,
Artem Titov46c4e602018-08-17 14:26:54 +0200354 int threshold_ms,
355 int start_time_ms,
356 int run_time_ms) {
pbos@webrtc.org994d0b72014-06-27 08:47:52 +0000357 class CaptureNtpTimeObserver : public test::EndToEndTest,
nisse7ade7b32016-03-23 04:48:10 -0700358 public rtc::VideoSinkInterface<VideoFrame> {
pbos@webrtc.org994d0b72014-06-27 08:47:52 +0000359 public:
Artem Titov75e36472018-10-08 12:28:56 +0200360 CaptureNtpTimeObserver(const BuiltInNetworkBehaviorConfig& net_config,
stefane74eef12016-01-08 06:47:13 -0800361 int threshold_ms,
362 int start_time_ms,
363 int run_time_ms)
stefanf116bd02015-10-27 08:29:42 -0700364 : EndToEndTest(kLongTimeoutMs),
stefane74eef12016-01-08 06:47:13 -0800365 net_config_(net_config),
pbos@webrtc.org994d0b72014-06-27 08:47:52 +0000366 clock_(Clock::GetRealTimeClock()),
367 threshold_ms_(threshold_ms),
368 start_time_ms_(start_time_ms),
369 run_time_ms_(run_time_ms),
370 creation_time_ms_(clock_->TimeInMilliseconds()),
pbos@webrtc.org2b4ce3a2015-03-23 13:12:24 +0000371 capturer_(nullptr),
pbos@webrtc.org994d0b72014-06-27 08:47:52 +0000372 rtp_start_timestamp_set_(false),
373 rtp_start_timestamp_(0) {}
wu@webrtc.orgcd701192014-04-24 22:10:24 +0000374
pbos@webrtc.org994d0b72014-06-27 08:47:52 +0000375 private:
eladalon413ee9a2017-08-22 04:02:52 -0700376 test::PacketTransport* CreateSendTransport(
377 test::SingleThreadedTaskQueueForTesting* task_queue,
378 Call* sender_call) override {
Artem Titov4e199e92018-08-20 13:30:39 +0200379 return new test::PacketTransport(
380 task_queue, sender_call, this, test::PacketTransport::kSender,
381 payload_type_map_,
382 absl::make_unique<FakeNetworkPipe>(
383 Clock::GetRealTimeClock(),
384 absl::make_unique<SimulatedNetwork>(net_config_)));
stefane74eef12016-01-08 06:47:13 -0800385 }
386
eladalon413ee9a2017-08-22 04:02:52 -0700387 test::PacketTransport* CreateReceiveTransport(
388 test::SingleThreadedTaskQueueForTesting* task_queue) override {
Artem Titov4e199e92018-08-20 13:30:39 +0200389 return new test::PacketTransport(
390 task_queue, nullptr, this, test::PacketTransport::kReceiver,
391 payload_type_map_,
392 absl::make_unique<FakeNetworkPipe>(
393 Clock::GetRealTimeClock(),
394 absl::make_unique<SimulatedNetwork>(net_config_)));
Stefan Holmerea8c0f62016-01-13 08:58:38 +0100395 }
396
nisseeb83a1a2016-03-21 01:27:56 -0700397 void OnFrame(const VideoFrame& video_frame) override {
stefanf116bd02015-10-27 08:29:42 -0700398 rtc::CritScope lock(&crit_);
pbos@webrtc.org994d0b72014-06-27 08:47:52 +0000399 if (video_frame.ntp_time_ms() <= 0) {
400 // Haven't got enough RTCP SR in order to calculate the capture ntp
401 // time.
402 return;
403 }
wu@webrtc.orgcd701192014-04-24 22:10:24 +0000404
pbos@webrtc.org994d0b72014-06-27 08:47:52 +0000405 int64_t now_ms = clock_->TimeInMilliseconds();
406 int64_t time_since_creation = now_ms - creation_time_ms_;
407 if (time_since_creation < start_time_ms_) {
408 // Wait for |start_time_ms_| before start measuring.
409 return;
410 }
wu@webrtc.orgcd701192014-04-24 22:10:24 +0000411
pbos@webrtc.org994d0b72014-06-27 08:47:52 +0000412 if (time_since_creation > run_time_ms_) {
Peter Boström5811a392015-12-10 13:02:50 +0100413 observation_complete_.Set();
pbos@webrtc.org994d0b72014-06-27 08:47:52 +0000414 }
wu@webrtc.orgcd701192014-04-24 22:10:24 +0000415
pbos@webrtc.org994d0b72014-06-27 08:47:52 +0000416 FrameCaptureTimeList::iterator iter =
417 capture_time_list_.find(video_frame.timestamp());
418 EXPECT_TRUE(iter != capture_time_list_.end());
wu@webrtc.orgcd701192014-04-24 22:10:24 +0000419
pbos@webrtc.org994d0b72014-06-27 08:47:52 +0000420 // The real capture time has been wrapped to uint32_t before converted
421 // to rtp timestamp in the sender side. So here we convert the estimated
422 // capture time to a uint32_t 90k timestamp also for comparing.
423 uint32_t estimated_capture_timestamp =
424 90 * static_cast<uint32_t>(video_frame.ntp_time_ms());
425 uint32_t real_capture_timestamp = iter->second;
426 int time_offset_ms = real_capture_timestamp - estimated_capture_timestamp;
427 time_offset_ms = time_offset_ms / 90;
danilchap46b89b92016-06-03 09:27:37 -0700428 time_offset_ms_list_.push_back(time_offset_ms);
wu@webrtc.orgcd701192014-04-24 22:10:24 +0000429
pbos@webrtc.org994d0b72014-06-27 08:47:52 +0000430 EXPECT_TRUE(std::abs(time_offset_ms) < threshold_ms_);
431 }
wu@webrtc.orgcd701192014-04-24 22:10:24 +0000432
nisseef8b61e2016-04-29 06:09:15 -0700433 Action OnSendRtp(const uint8_t* packet, size_t length) override {
stefanf116bd02015-10-27 08:29:42 -0700434 rtc::CritScope lock(&crit_);
pbos@webrtc.org994d0b72014-06-27 08:47:52 +0000435 RTPHeader header;
pbos@webrtc.org62bafae2014-07-08 12:10:51 +0000436 EXPECT_TRUE(parser_->Parse(packet, length, &header));
pbos@webrtc.org994d0b72014-06-27 08:47:52 +0000437
438 if (!rtp_start_timestamp_set_) {
439 // Calculate the rtp timestamp offset in order to calculate the real
440 // capture time.
441 uint32_t first_capture_timestamp =
442 90 * static_cast<uint32_t>(capturer_->first_frame_capture_time());
443 rtp_start_timestamp_ = header.timestamp - first_capture_timestamp;
444 rtp_start_timestamp_set_ = true;
445 }
446
447 uint32_t capture_timestamp = header.timestamp - rtp_start_timestamp_;
448 capture_time_list_.insert(
449 capture_time_list_.end(),
450 std::make_pair(header.timestamp, capture_timestamp));
451 return SEND_PACKET;
452 }
453
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +0000454 void OnFrameGeneratorCapturerCreated(
455 test::FrameGeneratorCapturer* frame_generator_capturer) override {
pbos@webrtc.org994d0b72014-06-27 08:47:52 +0000456 capturer_ = frame_generator_capturer;
457 }
458
stefanff483612015-12-21 03:14:00 -0800459 void ModifyVideoConfigs(
460 VideoSendStream::Config* send_config,
461 std::vector<VideoReceiveStream::Config>* receive_configs,
462 VideoEncoderConfig* encoder_config) override {
pbos@webrtc.orgbe9d2a42014-06-30 13:19:09 +0000463 (*receive_configs)[0].renderer = this;
pbos@webrtc.org994d0b72014-06-27 08:47:52 +0000464 // Enable the receiver side rtt calculation.
pbos@webrtc.orgbe9d2a42014-06-30 13:19:09 +0000465 (*receive_configs)[0].rtp.rtcp_xr.receiver_reference_time_report = true;
pbos@webrtc.org994d0b72014-06-27 08:47:52 +0000466 }
467
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +0000468 void PerformTest() override {
Peter Boström5811a392015-12-10 13:02:50 +0100469 EXPECT_TRUE(Wait()) << "Timed out while waiting for "
470 "estimated capture NTP time to be "
471 "within bounds.";
danilchap46b89b92016-06-03 09:27:37 -0700472 test::PrintResultList("capture_ntp_time", "", "real - estimated",
Edward Lemur2f061682017-11-24 13:40:01 +0100473 time_offset_ms_list_, "ms", true);
pbos@webrtc.org994d0b72014-06-27 08:47:52 +0000474 }
475
stefanf116bd02015-10-27 08:29:42 -0700476 rtc::CriticalSection crit_;
Artem Titov75e36472018-10-08 12:28:56 +0200477 const BuiltInNetworkBehaviorConfig net_config_;
stefanf116bd02015-10-27 08:29:42 -0700478 Clock* const clock_;
pbos@webrtc.org994d0b72014-06-27 08:47:52 +0000479 int threshold_ms_;
480 int start_time_ms_;
481 int run_time_ms_;
482 int64_t creation_time_ms_;
483 test::FrameGeneratorCapturer* capturer_;
484 bool rtp_start_timestamp_set_;
485 uint32_t rtp_start_timestamp_;
486 typedef std::map<uint32_t, uint32_t> FrameCaptureTimeList;
danilchapa37de392017-09-09 04:17:22 -0700487 FrameCaptureTimeList capture_time_list_ RTC_GUARDED_BY(&crit_);
Edward Lemur2f061682017-11-24 13:40:01 +0100488 std::vector<double> time_offset_ms_list_;
stefane74eef12016-01-08 06:47:13 -0800489 } test(net_config, threshold_ms, start_time_ms, run_time_ms);
pbos@webrtc.org994d0b72014-06-27 08:47:52 +0000490
stefane74eef12016-01-08 06:47:13 -0800491 RunBaseTest(&test);
wu@webrtc.orgcd701192014-04-24 22:10:24 +0000492}
493
Alex Loikoaf228ee2018-11-22 11:53:18 +0100494// Flaky tests, disabled on Mac and Windows due to webrtc:8291.
495#if !(defined(WEBRTC_MAC) || defined(WEBRTC_WIN))
wu@webrtc.org9aa7d8d2014-05-29 05:03:52 +0000496TEST_F(CallPerfTest, CaptureNtpTimeWithNetworkDelay) {
Artem Titov75e36472018-10-08 12:28:56 +0200497 BuiltInNetworkBehaviorConfig net_config;
wu@webrtc.orgcd701192014-04-24 22:10:24 +0000498 net_config.queue_delay_ms = 100;
499 // TODO(wu): lower the threshold as the calculation/estimatation becomes more
500 // accurate.
wu@webrtc.org9aa7d8d2014-05-29 05:03:52 +0000501 const int kThresholdMs = 100;
wu@webrtc.orgcd701192014-04-24 22:10:24 +0000502 const int kStartTimeMs = 10000;
503 const int kRunTimeMs = 20000;
504 TestCaptureNtpTime(net_config, kThresholdMs, kStartTimeMs, kRunTimeMs);
505}
506
wu@webrtc.org0224c202014-05-05 17:42:43 +0000507TEST_F(CallPerfTest, CaptureNtpTimeWithNetworkJitter) {
Artem Titov75e36472018-10-08 12:28:56 +0200508 BuiltInNetworkBehaviorConfig net_config;
wu@webrtc.org0224c202014-05-05 17:42:43 +0000509 net_config.queue_delay_ms = 100;
wu@webrtc.orgcd701192014-04-24 22:10:24 +0000510 net_config.delay_standard_deviation_ms = 10;
511 // TODO(wu): lower the threshold as the calculation/estimatation becomes more
512 // accurate.
wu@webrtc.org0224c202014-05-05 17:42:43 +0000513 const int kThresholdMs = 100;
wu@webrtc.orgcd701192014-04-24 22:10:24 +0000514 const int kStartTimeMs = 10000;
515 const int kRunTimeMs = 20000;
516 TestCaptureNtpTime(net_config, kThresholdMs, kStartTimeMs, kRunTimeMs);
517}
Alex Loiko5aea38c2017-09-27 13:10:28 +0200518#endif
kthelgasonfa5fdce2017-02-27 00:15:31 -0800519
perkj803d97f2016-11-01 11:45:46 -0700520TEST_F(CallPerfTest, ReceivesCpuOveruseAndUnderuse) {
sprangc5d62e22017-04-02 23:53:04 -0700521 // Minimal normal usage at the start, then 30s overuse to allow filter to
522 // settle, and then 80s underuse to allow plenty of time for rampup again.
523 test::ScopedFieldTrials fake_overuse_settings(
524 "WebRTC-ForceSimulatedOveruseIntervalMs/1-30000-80000/");
525
perkj803d97f2016-11-01 11:45:46 -0700526 class LoadObserver : public test::SendTest,
527 public test::FrameGeneratorCapturer::SinkWantsObserver {
asapersson@webrtc.orgbdc5ed22014-01-31 10:05:07 +0000528 public:
Åsa Persson8c1bf952018-09-13 10:42:19 +0200529 LoadObserver() : SendTest(kLongTimeoutMs), test_phase_(TestPhase::kInit) {}
asapersson@webrtc.orgbdc5ed22014-01-31 10:05:07 +0000530
perkj803d97f2016-11-01 11:45:46 -0700531 void OnFrameGeneratorCapturerCreated(
532 test::FrameGeneratorCapturer* frame_generator_capturer) override {
533 frame_generator_capturer->SetSinkWantsObserver(this);
kthelgasonfa5fdce2017-02-27 00:15:31 -0800534 // Set a high initial resolution to be sure that we can scale down.
535 frame_generator_capturer->ChangeResolution(1920, 1080);
perkj803d97f2016-11-01 11:45:46 -0700536 }
537
538 // OnSinkWantsChanged is called when FrameGeneratorCapturer::AddOrUpdateSink
539 // is called.
sprangc5d62e22017-04-02 23:53:04 -0700540 // TODO(sprang): Add integration test for maintain-framerate mode?
perkj803d97f2016-11-01 11:45:46 -0700541 void OnSinkWantsChanged(rtc::VideoSinkInterface<VideoFrame>* sink,
542 const rtc::VideoSinkWants& wants) override {
Åsa Persson8c1bf952018-09-13 10:42:19 +0200543 // At kStart expect CPU overuse. Then expect CPU underuse when the encoder
perkj803d97f2016-11-01 11:45:46 -0700544 // delay has been decreased.
sprangc5d62e22017-04-02 23:53:04 -0700545 switch (test_phase_) {
Åsa Persson8c1bf952018-09-13 10:42:19 +0200546 case TestPhase::kInit:
547 // Max framerate should be set initially.
548 if (wants.max_framerate_fps != std::numeric_limits<int>::max() &&
549 wants.max_pixel_count == std::numeric_limits<int>::max()) {
550 test_phase_ = TestPhase::kStart;
551 } else {
552 ADD_FAILURE() << "Got unexpected adaptation request, max res = "
553 << wants.max_pixel_count << ", target res = "
554 << wants.target_pixel_count.value_or(-1)
555 << ", max fps = " << wants.max_framerate_fps;
556 }
557 break;
sprangc5d62e22017-04-02 23:53:04 -0700558 case TestPhase::kStart:
559 if (wants.max_pixel_count < std::numeric_limits<int>::max()) {
mflodmancc3d4422017-08-03 08:27:51 -0700560 // On adapting down, VideoStreamEncoder::VideoSourceProxy will set
561 // only the max pixel count, leaving the target unset.
sprangc5d62e22017-04-02 23:53:04 -0700562 test_phase_ = TestPhase::kAdaptedDown;
563 } else {
564 ADD_FAILURE() << "Got unexpected adaptation request, max res = "
565 << wants.max_pixel_count << ", target res = "
566 << wants.target_pixel_count.value_or(-1)
567 << ", max fps = " << wants.max_framerate_fps;
568 }
569 break;
570 case TestPhase::kAdaptedDown:
571 // On adapting up, the adaptation counter will again be at zero, and
572 // so all constraints will be reset.
573 if (wants.max_pixel_count == std::numeric_limits<int>::max() &&
574 !wants.target_pixel_count) {
575 test_phase_ = TestPhase::kAdaptedUp;
576 observation_complete_.Set();
577 } else {
578 ADD_FAILURE() << "Got unexpected adaptation request, max res = "
579 << wants.max_pixel_count << ", target res = "
580 << wants.target_pixel_count.value_or(-1)
581 << ", max fps = " << wants.max_framerate_fps;
582 }
583 break;
584 case TestPhase::kAdaptedUp:
585 ADD_FAILURE() << "Got unexpected adaptation request, max res = "
586 << wants.max_pixel_count << ", target res = "
587 << wants.target_pixel_count.value_or(-1)
588 << ", max fps = " << wants.max_framerate_fps;
perkj803d97f2016-11-01 11:45:46 -0700589 }
asapersson@webrtc.orgbdc5ed22014-01-31 10:05:07 +0000590 }
asapersson@webrtc.orgbdc5ed22014-01-31 10:05:07 +0000591
stefanff483612015-12-21 03:14:00 -0800592 void ModifyVideoConfigs(
593 VideoSendStream::Config* send_config,
594 std::vector<VideoReceiveStream::Config>* receive_configs,
Yves Gerey665174f2018-06-19 15:03:05 +0200595 VideoEncoderConfig* encoder_config) override {}
asapersson@webrtc.org049e4ec2014-11-20 10:19:46 +0000596
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +0000597 void PerformTest() override {
Peter Boström5811a392015-12-10 13:02:50 +0100598 EXPECT_TRUE(Wait()) << "Timed out before receiving an overuse callback.";
pbos@webrtc.org994d0b72014-06-27 08:47:52 +0000599 }
asapersson@webrtc.org049e4ec2014-11-20 10:19:46 +0000600
Åsa Persson8c1bf952018-09-13 10:42:19 +0200601 enum class TestPhase {
602 kInit,
603 kStart,
604 kAdaptedDown,
605 kAdaptedUp
606 } test_phase_;
perkj803d97f2016-11-01 11:45:46 -0700607 } test;
pbos@webrtc.org994d0b72014-06-27 08:47:52 +0000608
stefane74eef12016-01-08 06:47:13 -0800609 RunBaseTest(&test);
asapersson@webrtc.orgbdc5ed22014-01-31 10:05:07 +0000610}
pbos@webrtc.org3349ae02014-03-13 12:52:27 +0000611
612void CallPerfTest::TestMinTransmitBitrate(bool pad_to_min_bitrate) {
613 static const int kMaxEncodeBitrateKbps = 30;
pbos@webrtc.org709e2972014-03-19 10:59:52 +0000614 static const int kMinTransmitBitrateBps = 150000;
pbos@webrtc.org3349ae02014-03-13 12:52:27 +0000615 static const int kMinAcceptableTransmitBitrate = 130;
616 static const int kMaxAcceptableTransmitBitrate = 170;
617 static const int kNumBitrateObservationsInRange = 100;
sprang867fb522015-08-03 04:38:41 -0700618 static const int kAcceptableBitrateErrorMargin = 15; // +- 7
stefanf116bd02015-10-27 08:29:42 -0700619 class BitrateObserver : public test::EndToEndTest {
pbos@webrtc.org3349ae02014-03-13 12:52:27 +0000620 public:
621 explicit BitrateObserver(bool using_min_transmit_bitrate)
pbos@webrtc.org994d0b72014-06-27 08:47:52 +0000622 : EndToEndTest(kLongTimeoutMs),
pbos@webrtc.org2b4ce3a2015-03-23 13:12:24 +0000623 send_stream_(nullptr),
Danil Chapovalov371b43b2016-06-16 09:58:44 +0200624 converged_(false),
pbos@webrtc.org994d0b72014-06-27 08:47:52 +0000625 pad_to_min_bitrate_(using_min_transmit_bitrate),
Danil Chapovalov371b43b2016-06-16 09:58:44 +0200626 min_acceptable_bitrate_(using_min_transmit_bitrate
627 ? kMinAcceptableTransmitBitrate
628 : (kMaxEncodeBitrateKbps -
629 kAcceptableBitrateErrorMargin / 2)),
630 max_acceptable_bitrate_(using_min_transmit_bitrate
631 ? kMaxAcceptableTransmitBitrate
632 : (kMaxEncodeBitrateKbps +
633 kAcceptableBitrateErrorMargin / 2)),
pbos@webrtc.org3349ae02014-03-13 12:52:27 +0000634 num_bitrate_observations_in_range_(0) {}
635
pbos@webrtc.org994d0b72014-06-27 08:47:52 +0000636 private:
stefanf116bd02015-10-27 08:29:42 -0700637 // TODO(holmer): Run this with a timer instead of once per packet.
638 Action OnSendRtp(const uint8_t* packet, size_t length) override {
pbos@webrtc.org3349ae02014-03-13 12:52:27 +0000639 VideoSendStream::Stats stats = send_stream_->GetStats();
Benjamin Wright41f9f2c2019-03-13 18:03:29 -0700640 if (!stats.substreams.empty()) {
kwibergaf476c72016-11-28 15:21:39 -0800641 RTC_DCHECK_EQ(1, stats.substreams.size());
stefan@webrtc.org0bae1fa2014-11-05 14:05:29 +0000642 int bitrate_kbps =
643 stats.substreams.begin()->second.total_bitrate_bps / 1000;
Danil Chapovalov371b43b2016-06-16 09:58:44 +0200644 if (bitrate_kbps > min_acceptable_bitrate_ &&
645 bitrate_kbps < max_acceptable_bitrate_) {
646 converged_ = true;
647 ++num_bitrate_observations_in_range_;
pbos@webrtc.org3349ae02014-03-13 12:52:27 +0000648 if (num_bitrate_observations_in_range_ ==
649 kNumBitrateObservationsInRange)
Peter Boström5811a392015-12-10 13:02:50 +0100650 observation_complete_.Set();
pbos@webrtc.org3349ae02014-03-13 12:52:27 +0000651 }
Danil Chapovalov371b43b2016-06-16 09:58:44 +0200652 if (converged_)
653 bitrate_kbps_list_.push_back(bitrate_kbps);
pbos@webrtc.org3349ae02014-03-13 12:52:27 +0000654 }
stefanf116bd02015-10-27 08:29:42 -0700655 return SEND_PACKET;
pbos@webrtc.org3349ae02014-03-13 12:52:27 +0000656 }
657
stefanff483612015-12-21 03:14:00 -0800658 void OnVideoStreamsCreated(
pbos@webrtc.orgbe9d2a42014-06-30 13:19:09 +0000659 VideoSendStream* send_stream,
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +0000660 const std::vector<VideoReceiveStream*>& receive_streams) override {
pbos@webrtc.org994d0b72014-06-27 08:47:52 +0000661 send_stream_ = send_stream;
662 }
663
stefanff483612015-12-21 03:14:00 -0800664 void ModifyVideoConfigs(
665 VideoSendStream::Config* send_config,
666 std::vector<VideoReceiveStream::Config>* receive_configs,
667 VideoEncoderConfig* encoder_config) override {
pbos@webrtc.org994d0b72014-06-27 08:47:52 +0000668 if (pad_to_min_bitrate_) {
pbos@webrtc.orgad3b5a52014-10-24 09:23:21 +0000669 encoder_config->min_transmit_bitrate_bps = kMinTransmitBitrateBps;
pbos@webrtc.org994d0b72014-06-27 08:47:52 +0000670 } else {
henrikg91d6ede2015-09-17 00:24:34 -0700671 RTC_DCHECK_EQ(0, encoder_config->min_transmit_bitrate_bps);
pbos@webrtc.org994d0b72014-06-27 08:47:52 +0000672 }
673 }
674
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +0000675 void PerformTest() override {
Peter Boström5811a392015-12-10 13:02:50 +0100676 EXPECT_TRUE(Wait()) << "Timeout while waiting for send-bitrate stats.";
danilchap46b89b92016-06-03 09:27:37 -0700677 test::PrintResultList(
678 "bitrate_stats_",
679 (pad_to_min_bitrate_ ? "min_transmit_bitrate"
680 : "without_min_transmit_bitrate"),
Edward Lemur2f061682017-11-24 13:40:01 +0100681 "bitrate_kbps", bitrate_kbps_list_, "kbps", false);
pbos@webrtc.org994d0b72014-06-27 08:47:52 +0000682 }
683
pbos@webrtc.org3349ae02014-03-13 12:52:27 +0000684 VideoSendStream* send_stream_;
Danil Chapovalov371b43b2016-06-16 09:58:44 +0200685 bool converged_;
pbos@webrtc.org994d0b72014-06-27 08:47:52 +0000686 const bool pad_to_min_bitrate_;
Danil Chapovalov371b43b2016-06-16 09:58:44 +0200687 const int min_acceptable_bitrate_;
688 const int max_acceptable_bitrate_;
pbos@webrtc.org3349ae02014-03-13 12:52:27 +0000689 int num_bitrate_observations_in_range_;
Edward Lemur2f061682017-11-24 13:40:01 +0100690 std::vector<double> bitrate_kbps_list_;
pbos@webrtc.org994d0b72014-06-27 08:47:52 +0000691 } test(pad_to_min_bitrate);
pbos@webrtc.org3349ae02014-03-13 12:52:27 +0000692
Niels Möller4db138e2018-04-19 09:04:13 +0200693 fake_encoder_max_bitrate_ = kMaxEncodeBitrateKbps;
stefane74eef12016-01-08 06:47:13 -0800694 RunBaseTest(&test);
pbos@webrtc.org3349ae02014-03-13 12:52:27 +0000695}
696
Yves Gerey665174f2018-06-19 15:03:05 +0200697TEST_F(CallPerfTest, PadsToMinTransmitBitrate) {
698 TestMinTransmitBitrate(true);
699}
pbos@webrtc.org3349ae02014-03-13 12:52:27 +0000700
701TEST_F(CallPerfTest, NoPadWithoutMinTransmitBitrate) {
702 TestMinTransmitBitrate(false);
703}
704
Taylor Brandstetter85904f42018-02-16 10:11:49 -0800705// TODO(bugs.webrtc.org/8878)
706#if defined(WEBRTC_MAC)
707#define MAYBE_KeepsHighBitrateWhenReconfiguringSender \
708 DISABLED_KeepsHighBitrateWhenReconfiguringSender
709#else
710#define MAYBE_KeepsHighBitrateWhenReconfiguringSender \
711 KeepsHighBitrateWhenReconfiguringSender
712#endif
713TEST_F(CallPerfTest, MAYBE_KeepsHighBitrateWhenReconfiguringSender) {
pbos@webrtc.org32452b22014-10-22 12:15:24 +0000714 static const uint32_t kInitialBitrateKbps = 400;
715 static const uint32_t kReconfigureThresholdKbps = 600;
pbos@webrtc.org32452b22014-10-22 12:15:24 +0000716
perkjfa10b552016-10-02 23:45:26 -0700717 class VideoStreamFactory
718 : public VideoEncoderConfig::VideoStreamFactoryInterface {
719 public:
720 VideoStreamFactory() {}
721
722 private:
723 std::vector<VideoStream> CreateEncoderStreams(
724 int width,
725 int height,
726 const VideoEncoderConfig& encoder_config) override {
727 std::vector<VideoStream> streams =
728 test::CreateVideoStreams(width, height, encoder_config);
729 streams[0].min_bitrate_bps = 50000;
730 streams[0].target_bitrate_bps = streams[0].max_bitrate_bps = 2000000;
731 return streams;
732 }
733 };
734
pbos@webrtc.org32452b22014-10-22 12:15:24 +0000735 class BitrateObserver : public test::EndToEndTest, public test::FakeEncoder {
736 public:
737 BitrateObserver()
738 : EndToEndTest(kDefaultTimeoutMs),
739 FakeEncoder(Clock::GetRealTimeClock()),
sprang867fb522015-08-03 04:38:41 -0700740 encoder_inits_(0),
Erik Språng08127a92016-11-16 16:41:30 +0100741 last_set_bitrate_kbps_(0),
742 send_stream_(nullptr),
Niels Möller4db138e2018-04-19 09:04:13 +0200743 frame_generator_(nullptr),
Jiawei Ouc2ebe212018-11-08 10:02:56 -0800744 encoder_factory_(this),
745 bitrate_allocator_factory_(
746 CreateBuiltinVideoBitrateAllocatorFactory()) {}
pbos@webrtc.org32452b22014-10-22 12:15:24 +0000747
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +0000748 int32_t InitEncode(const VideoCodec* config,
749 int32_t number_of_cores,
750 size_t max_payload_size) override {
perkjfa10b552016-10-02 23:45:26 -0700751 ++encoder_inits_;
752 if (encoder_inits_ == 1) {
emircan05a55b52016-10-28 14:06:29 -0700753 // First time initialization. Frame size is known.
Per21d45d22016-10-30 21:37:57 +0100754 // |expected_bitrate| is affected by bandwidth estimation before the
755 // first frame arrives to the encoder.
Erik Språng08127a92016-11-16 16:41:30 +0100756 uint32_t expected_bitrate = last_set_bitrate_kbps_ > 0
757 ? last_set_bitrate_kbps_
758 : kInitialBitrateKbps;
Per21d45d22016-10-30 21:37:57 +0100759 EXPECT_EQ(expected_bitrate, config->startBitrate)
760 << "Encoder not initialized at expected bitrate.";
perkjfa10b552016-10-02 23:45:26 -0700761 EXPECT_EQ(kDefaultWidth, config->width);
762 EXPECT_EQ(kDefaultHeight, config->height);
Per21d45d22016-10-30 21:37:57 +0100763 } else if (encoder_inits_ == 2) {
perkjfa10b552016-10-02 23:45:26 -0700764 EXPECT_EQ(2 * kDefaultWidth, config->width);
765 EXPECT_EQ(2 * kDefaultHeight, config->height);
Erik Språng08127a92016-11-16 16:41:30 +0100766 EXPECT_GE(last_set_bitrate_kbps_, kReconfigureThresholdKbps);
philipel0676f222018-04-17 16:12:21 +0200767 EXPECT_GT(config->startBitrate, kReconfigureThresholdKbps)
pbos@webrtc.org32452b22014-10-22 12:15:24 +0000768 << "Encoder reconfigured with bitrate too far away from last set.";
Peter Boström5811a392015-12-10 13:02:50 +0100769 observation_complete_.Set();
pbos@webrtc.org32452b22014-10-22 12:15:24 +0000770 }
771 return FakeEncoder::InitEncode(config, number_of_cores, max_payload_size);
772 }
773
Erik Språng566124a2018-04-23 12:32:22 +0200774 int32_t SetRateAllocation(const VideoBitrateAllocation& rate_allocation,
Erik Språng08127a92016-11-16 16:41:30 +0100775 uint32_t framerate) override {
776 last_set_bitrate_kbps_ = rate_allocation.get_sum_kbps();
Per21d45d22016-10-30 21:37:57 +0100777 if (encoder_inits_ == 1 &&
Erik Språng08127a92016-11-16 16:41:30 +0100778 rate_allocation.get_sum_kbps() > kReconfigureThresholdKbps) {
Peter Boström5811a392015-12-10 13:02:50 +0100779 time_to_reconfigure_.Set();
pbos@webrtc.org32452b22014-10-22 12:15:24 +0000780 }
Erik Språng08127a92016-11-16 16:41:30 +0100781 return FakeEncoder::SetRateAllocation(rate_allocation, framerate);
pbos@webrtc.org32452b22014-10-22 12:15:24 +0000782 }
783
Niels Möllerde8e6e62018-11-13 15:10:33 +0100784 void ModifySenderBitrateConfig(
785 BitrateConstraints* bitrate_config) override {
786 bitrate_config->start_bitrate_bps = kInitialBitrateKbps * 1000;
pbos@webrtc.org32452b22014-10-22 12:15:24 +0000787 }
788
stefanff483612015-12-21 03:14:00 -0800789 void ModifyVideoConfigs(
790 VideoSendStream::Config* send_config,
791 std::vector<VideoReceiveStream::Config>* receive_configs,
792 VideoEncoderConfig* encoder_config) override {
Niels Möller4db138e2018-04-19 09:04:13 +0200793 send_config->encoder_settings.encoder_factory = &encoder_factory_;
Jiawei Ouc2ebe212018-11-08 10:02:56 -0800794 send_config->encoder_settings.bitrate_allocator_factory =
795 bitrate_allocator_factory_.get();
Per21d45d22016-10-30 21:37:57 +0100796 encoder_config->max_bitrate_bps = 2 * kReconfigureThresholdKbps * 1000;
perkjfa10b552016-10-02 23:45:26 -0700797 encoder_config->video_stream_factory =
798 new rtc::RefCountedObject<VideoStreamFactory>();
pbos@webrtc.org32452b22014-10-22 12:15:24 +0000799
perkj26091b12016-09-01 01:17:40 -0700800 encoder_config_ = encoder_config->Copy();
pbos@webrtc.org32452b22014-10-22 12:15:24 +0000801 }
802
stefanff483612015-12-21 03:14:00 -0800803 void OnVideoStreamsCreated(
pbos@webrtc.org32452b22014-10-22 12:15:24 +0000804 VideoSendStream* send_stream,
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +0000805 const std::vector<VideoReceiveStream*>& receive_streams) override {
pbos@webrtc.org32452b22014-10-22 12:15:24 +0000806 send_stream_ = send_stream;
807 }
808
perkjfa10b552016-10-02 23:45:26 -0700809 void OnFrameGeneratorCapturerCreated(
810 test::FrameGeneratorCapturer* frame_generator_capturer) override {
811 frame_generator_ = frame_generator_capturer;
812 }
813
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +0000814 void PerformTest() override {
Peter Boström5811a392015-12-10 13:02:50 +0100815 ASSERT_TRUE(time_to_reconfigure_.Wait(kDefaultTimeoutMs))
pbos@webrtc.org32452b22014-10-22 12:15:24 +0000816 << "Timed out before receiving an initial high bitrate.";
perkjfa10b552016-10-02 23:45:26 -0700817 frame_generator_->ChangeResolution(kDefaultWidth * 2, kDefaultHeight * 2);
perkj26091b12016-09-01 01:17:40 -0700818 send_stream_->ReconfigureVideoEncoder(encoder_config_.Copy());
Peter Boström5811a392015-12-10 13:02:50 +0100819 EXPECT_TRUE(Wait())
pbos@webrtc.org32452b22014-10-22 12:15:24 +0000820 << "Timed out while waiting for a couple of high bitrate estimates "
821 "after reconfiguring the send stream.";
822 }
823
824 private:
Peter Boström5811a392015-12-10 13:02:50 +0100825 rtc::Event time_to_reconfigure_;
pbos@webrtc.org32452b22014-10-22 12:15:24 +0000826 int encoder_inits_;
Erik Språng08127a92016-11-16 16:41:30 +0100827 uint32_t last_set_bitrate_kbps_;
pbos@webrtc.org32452b22014-10-22 12:15:24 +0000828 VideoSendStream* send_stream_;
perkjfa10b552016-10-02 23:45:26 -0700829 test::FrameGeneratorCapturer* frame_generator_;
Niels Möllercbcbc222018-09-28 09:07:24 +0200830 test::VideoEncoderProxyFactory encoder_factory_;
Jiawei Ouc2ebe212018-11-08 10:02:56 -0800831 std::unique_ptr<VideoBitrateAllocatorFactory> bitrate_allocator_factory_;
pbos@webrtc.org32452b22014-10-22 12:15:24 +0000832 VideoEncoderConfig encoder_config_;
833 } test;
834
stefane74eef12016-01-08 06:47:13 -0800835 RunBaseTest(&test);
pbos@webrtc.org32452b22014-10-22 12:15:24 +0000836}
837
Alex Narestd0e196b2017-11-22 17:22:35 +0100838// Discovers the minimal supported audio+video bitrate. The test bitrate is
839// considered supported if Rtt does not go above 400ms with the network
840// contrained to the test bitrate.
841//
842// |use_bitrate_allocation_strategy| use AudioPriorityBitrateAllocationStrategy
843// |test_bitrate_from test_bitrate_to| bitrate constraint range
844// |test_bitrate_step| bitrate constraint update step during the test
845// |min_bwe max_bwe| BWE range
846// |start_bwe| initial BWE
847void CallPerfTest::TestMinAudioVideoBitrate(
848 bool use_bitrate_allocation_strategy,
849 int test_bitrate_from,
850 int test_bitrate_to,
851 int test_bitrate_step,
852 int min_bwe,
853 int start_bwe,
854 int max_bwe) {
855 static const std::string kAudioTrackId = "audio_track_0";
856 static constexpr uint32_t kSufficientAudioBitrateBps = 16000;
857 static constexpr int kOpusMinBitrateBps = 6000;
858 static constexpr int kOpusBitrateFbBps = 32000;
859 static constexpr int kBitrateStabilizationMs = 10000;
860 static constexpr int kBitrateMeasurements = 10;
861 static constexpr int kBitrateMeasurementMs = 1000;
Ilya Nikolaevskiy0500b522019-01-22 11:12:51 +0100862 static constexpr int kShortDelayMs = 10;
Alex Narestd0e196b2017-11-22 17:22:35 +0100863 static constexpr int kMinGoodRttMs = 400;
864
865 class MinVideoAndAudioBitrateTester : public test::EndToEndTest {
866 public:
867 MinVideoAndAudioBitrateTester(bool use_bitrate_allocation_strategy,
868 int test_bitrate_from,
869 int test_bitrate_to,
870 int test_bitrate_step,
871 int min_bwe,
872 int start_bwe,
873 int max_bwe)
874 : EndToEndTest(),
875 allocation_strategy_(new rtc::AudioPriorityBitrateAllocationStrategy(
876 kAudioTrackId,
877 kSufficientAudioBitrateBps)),
878 use_bitrate_allocation_strategy_(use_bitrate_allocation_strategy),
879 test_bitrate_from_(test_bitrate_from),
880 test_bitrate_to_(test_bitrate_to),
881 test_bitrate_step_(test_bitrate_step),
882 min_bwe_(min_bwe),
883 start_bwe_(start_bwe),
884 max_bwe_(max_bwe) {}
885
886 protected:
Artem Titov75e36472018-10-08 12:28:56 +0200887 BuiltInNetworkBehaviorConfig GetFakeNetworkPipeConfig() {
888 BuiltInNetworkBehaviorConfig pipe_config;
Alex Narestd0e196b2017-11-22 17:22:35 +0100889 pipe_config.link_capacity_kbps = test_bitrate_from_;
890 return pipe_config;
891 }
892
893 test::PacketTransport* CreateSendTransport(
894 test::SingleThreadedTaskQueueForTesting* task_queue,
895 Call* sender_call) override {
Artem Titov631cafa2018-08-21 21:01:00 +0200896 auto network =
897 absl::make_unique<SimulatedNetwork>(GetFakeNetworkPipeConfig());
898 send_simulated_network_ = network.get();
899 return new test::PacketTransport(
900 task_queue, sender_call, this, test::PacketTransport::kSender,
901 test::CallTest::payload_type_map_,
902 absl::make_unique<FakeNetworkPipe>(Clock::GetRealTimeClock(),
903 std::move(network)));
Alex Narestd0e196b2017-11-22 17:22:35 +0100904 }
905
906 test::PacketTransport* CreateReceiveTransport(
907 test::SingleThreadedTaskQueueForTesting* task_queue) override {
Artem Titov631cafa2018-08-21 21:01:00 +0200908 auto network =
909 absl::make_unique<SimulatedNetwork>(GetFakeNetworkPipeConfig());
910 receive_simulated_network_ = network.get();
911 return new test::PacketTransport(
912 task_queue, nullptr, this, test::PacketTransport::kReceiver,
913 test::CallTest::payload_type_map_,
914 absl::make_unique<FakeNetworkPipe>(Clock::GetRealTimeClock(),
915 std::move(network)));
Alex Narestd0e196b2017-11-22 17:22:35 +0100916 }
917
918 void PerformTest() override {
Ilya Nikolaevskiy0500b522019-01-22 11:12:51 +0100919 // Quick test mode, just to exercise all the code paths without actually
920 // caring about performance measurements.
921 const bool quick_perf_test =
922 field_trial::IsEnabled("WebRTC-QuickPerfTest");
Alex Narestd0e196b2017-11-22 17:22:35 +0100923 int last_passed_test_bitrate = -1;
924 for (int test_bitrate = test_bitrate_from_;
925 test_bitrate_from_ < test_bitrate_to_
926 ? test_bitrate <= test_bitrate_to_
927 : test_bitrate >= test_bitrate_to_;
928 test_bitrate += test_bitrate_step_) {
Artem Titov75e36472018-10-08 12:28:56 +0200929 BuiltInNetworkBehaviorConfig pipe_config;
Alex Narestd0e196b2017-11-22 17:22:35 +0100930 pipe_config.link_capacity_kbps = test_bitrate;
Artem Titov631cafa2018-08-21 21:01:00 +0200931 send_simulated_network_->SetConfig(pipe_config);
932 receive_simulated_network_->SetConfig(pipe_config);
Alex Narestd0e196b2017-11-22 17:22:35 +0100933
934 rtc::ThreadManager::Instance()->CurrentThread()->SleepMs(
Ilya Nikolaevskiy0500b522019-01-22 11:12:51 +0100935 quick_perf_test ? kShortDelayMs : kBitrateStabilizationMs);
Alex Narestd0e196b2017-11-22 17:22:35 +0100936
937 int64_t avg_rtt = 0;
938 for (int i = 0; i < kBitrateMeasurements; i++) {
939 Call::Stats call_stats = sender_call_->GetStats();
940 avg_rtt += call_stats.rtt_ms;
941 rtc::ThreadManager::Instance()->CurrentThread()->SleepMs(
Ilya Nikolaevskiy0500b522019-01-22 11:12:51 +0100942 quick_perf_test ? kShortDelayMs : kBitrateMeasurementMs);
Alex Narestd0e196b2017-11-22 17:22:35 +0100943 }
944 avg_rtt = avg_rtt / kBitrateMeasurements;
945 if (avg_rtt > kMinGoodRttMs) {
946 break;
947 } else {
948 last_passed_test_bitrate = test_bitrate;
949 }
950 }
951 EXPECT_GT(last_passed_test_bitrate, -1)
952 << "Minimum supported bitrate out of the test scope";
Edward Lemur7f331fa2018-01-08 17:35:51 +0100953 webrtc::test::PrintResult(
954 "min_test_bitrate_",
955 use_bitrate_allocation_strategy_ ? "with_allocation_strategy"
956 : "no_allocation_strategy",
957 "min_bitrate", last_passed_test_bitrate, "kbps", false);
Alex Narestd0e196b2017-11-22 17:22:35 +0100958 }
959
960 void OnCallsCreated(Call* sender_call, Call* receiver_call) override {
961 sender_call_ = sender_call;
Sebastian Janssonfc8d26b2018-02-21 09:52:06 +0100962 BitrateConstraints bitrate_config;
Alex Narestd0e196b2017-11-22 17:22:35 +0100963 bitrate_config.min_bitrate_bps = min_bwe_;
964 bitrate_config.start_bitrate_bps = start_bwe_;
965 bitrate_config.max_bitrate_bps = max_bwe_;
Sebastian Jansson8f83b422018-02-21 13:07:13 +0100966 sender_call->GetTransportControllerSend()->SetSdpBitrateParameters(
967 bitrate_config);
Alex Narestd0e196b2017-11-22 17:22:35 +0100968 if (use_bitrate_allocation_strategy_) {
969 sender_call->SetBitrateAllocationStrategy(
970 std::move(allocation_strategy_));
971 }
972 }
973
974 size_t GetNumVideoStreams() const override { return 1; }
975
976 size_t GetNumAudioStreams() const override { return 1; }
977
978 void ModifyAudioConfigs(
979 AudioSendStream::Config* send_config,
980 std::vector<AudioReceiveStream::Config>* receive_configs) override {
981 if (use_bitrate_allocation_strategy_) {
982 send_config->track_id = kAudioTrackId;
983 send_config->min_bitrate_bps = kOpusMinBitrateBps;
984 send_config->max_bitrate_bps = kOpusBitrateFbBps;
985 } else {
986 send_config->send_codec_spec->target_bitrate_bps =
Danil Chapovalovb9b146c2018-06-15 12:28:07 +0200987 absl::optional<int>(kOpusBitrateFbBps);
Alex Narestd0e196b2017-11-22 17:22:35 +0100988 }
989 }
990
991 private:
992 std::unique_ptr<rtc::BitrateAllocationStrategy> allocation_strategy_;
993 const bool use_bitrate_allocation_strategy_;
994 const int test_bitrate_from_;
995 const int test_bitrate_to_;
996 const int test_bitrate_step_;
997 const int min_bwe_;
998 const int start_bwe_;
999 const int max_bwe_;
Artem Titov631cafa2018-08-21 21:01:00 +02001000 SimulatedNetwork* send_simulated_network_;
1001 SimulatedNetwork* receive_simulated_network_;
Alex Narestd0e196b2017-11-22 17:22:35 +01001002 Call* sender_call_;
1003 } test(use_bitrate_allocation_strategy, test_bitrate_from, test_bitrate_to,
1004 test_bitrate_step, min_bwe, start_bwe, max_bwe);
1005
1006 RunBaseTest(&test);
1007}
1008
Taylor Brandstetter85904f42018-02-16 10:11:49 -08001009// TODO(bugs.webrtc.org/8878)
1010#if defined(WEBRTC_MAC)
Yves Gerey665174f2018-06-19 15:03:05 +02001011#define MAYBE_MinVideoAndAudioBitrate DISABLED_MinVideoAndAudioBitrate
Taylor Brandstetter85904f42018-02-16 10:11:49 -08001012#else
Yves Gerey665174f2018-06-19 15:03:05 +02001013#define MAYBE_MinVideoAndAudioBitrate MinVideoAndAudioBitrate
Taylor Brandstetter85904f42018-02-16 10:11:49 -08001014#endif
1015TEST_F(CallPerfTest, MAYBE_MinVideoAndAudioBitrate) {
Alex Narestd0e196b2017-11-22 17:22:35 +01001016 TestMinAudioVideoBitrate(false, 110, 40, -10, 10000, 70000, 200000);
1017}
1018TEST_F(CallPerfTest, MinVideoAndAudioBitrateWStrategy) {
1019 TestMinAudioVideoBitrate(true, 110, 40, -10, 10000, 70000, 200000);
1020}
1021
pbos@webrtc.org1d096902013-12-13 12:48:05 +00001022} // namespace webrtc