Switch usages of DefaultNetworkSimulationConfig to BuiltInNetworkBehaviorConfig

Bug: webrtc:9630
Change-Id: Ia0e0b5b4e1e3a8e687d1e7fe3bb600dbdda09efa
Reviewed-on: https://webrtc-review.googlesource.com/c/104561
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25045}
This commit is contained in:
Artem Titov 2018-10-08 12:28:56 +02:00 committed by Commit Bot
parent 3a74239091
commit 75e3647a76
36 changed files with 116 additions and 120 deletions

View File

@ -85,12 +85,12 @@ class VideoQualityTestFixtureInterface {
// Deprecated. DO NOT USE. Use config instead. This is not pipe actually,
// it is just configuration, that will be passed to default implementation
// of simulation layer.
DefaultNetworkSimulationConfig pipe;
BuiltInNetworkBehaviorConfig pipe;
// Config for default simulation implementation. Must be nullopt if
// `sender_network` and `receiver_network` in InjectionComponents are
// non-null. May be nullopt even if `sender_network` and `receiver_network`
// are null; in that case, a default config will be used.
absl::optional<DefaultNetworkSimulationConfig> config;
absl::optional<BuiltInNetworkBehaviorConfig> config;
struct SS { // Spatial scalability.
std::vector<VideoStream> streams; // If empty, one stream is assumed.
size_t selected_stream;

View File

@ -123,8 +123,8 @@ class NoBandwidthDropAfterDtx : public AudioBweTest {
return test::ResourcePath("voice_engine/audio_dtx16", "wav");
}
DefaultNetworkSimulationConfig GetNetworkPipeConfig() override {
DefaultNetworkSimulationConfig pipe_config;
BuiltInNetworkBehaviorConfig GetNetworkPipeConfig() override {
BuiltInNetworkBehaviorConfig pipe_config;
pipe_config.link_capacity_kbps = 50;
pipe_config.queue_length_packets = 1500;
pipe_config.queue_delay_ms = 300;

View File

@ -27,7 +27,7 @@ class AudioBweTest : public test::EndToEndTest {
protected:
virtual std::string AudioInputFile() = 0;
virtual DefaultNetworkSimulationConfig GetNetworkPipeConfig() = 0;
virtual BuiltInNetworkBehaviorConfig GetNetworkPipeConfig() = 0;
size_t GetNumVideoStreams() const override;
size_t GetNumAudioStreams() const override;

View File

@ -28,8 +28,8 @@ constexpr int kSampleRate = 48000;
AudioEndToEndTest::AudioEndToEndTest()
: EndToEndTest(CallTest::kDefaultTimeoutMs) {}
DefaultNetworkSimulationConfig AudioEndToEndTest::GetNetworkPipeConfig() const {
return DefaultNetworkSimulationConfig();
BuiltInNetworkBehaviorConfig AudioEndToEndTest::GetNetworkPipeConfig() const {
return BuiltInNetworkBehaviorConfig();
}
size_t AudioEndToEndTest::GetNumVideoStreams() const {

View File

@ -29,7 +29,7 @@ class AudioEndToEndTest : public test::EndToEndTest {
const AudioSendStream* send_stream() const { return send_stream_; }
const AudioReceiveStream* receive_stream() const { return receive_stream_; }
virtual DefaultNetworkSimulationConfig GetNetworkPipeConfig() const;
virtual BuiltInNetworkBehaviorConfig GetNetworkPipeConfig() const;
size_t GetNumVideoStreams() const override;
size_t GetNumAudioStreams() const override;

View File

@ -32,8 +32,8 @@ class NoLossTest : public AudioEndToEndTest {
NoLossTest() = default;
DefaultNetworkSimulationConfig GetNetworkPipeConfig() const override {
DefaultNetworkSimulationConfig pipe_config;
BuiltInNetworkBehaviorConfig GetNetworkPipeConfig() const override {
BuiltInNetworkBehaviorConfig pipe_config;
pipe_config.queue_delay_ms = kRttMs / 2;
return pipe_config;
}

View File

@ -89,8 +89,8 @@ class Mobile2GNetworkTest : public AudioQualityTest {
{{"maxaveragebitrate", "6000"}, {"ptime", "60"}, {"stereo", "1"}}});
}
DefaultNetworkSimulationConfig GetNetworkPipeConfig() const override {
DefaultNetworkSimulationConfig pipe_config;
BuiltInNetworkBehaviorConfig GetNetworkPipeConfig() const override {
BuiltInNetworkBehaviorConfig pipe_config;
pipe_config.link_capacity_kbps = 12;
pipe_config.queue_length_packets = 1500;
pipe_config.queue_delay_ms = 400;

View File

@ -111,14 +111,14 @@ class BitrateEstimatorTest : public test::CallTest {
&task_queue_,
absl::make_unique<FakeNetworkPipe>(
Clock::GetRealTimeClock(), absl::make_unique<SimulatedNetwork>(
DefaultNetworkSimulationConfig())),
BuiltInNetworkBehaviorConfig())),
sender_call_.get(), payload_type_map_));
send_transport_->SetReceiver(receiver_call_->Receiver());
receive_transport_.reset(new test::DirectTransport(
&task_queue_,
absl::make_unique<FakeNetworkPipe>(
Clock::GetRealTimeClock(), absl::make_unique<SimulatedNetwork>(
DefaultNetworkSimulationConfig())),
BuiltInNetworkBehaviorConfig())),
receiver_call_.get(), payload_type_map_));
receive_transport_->SetReceiver(sender_call_->Receiver());

View File

@ -64,7 +64,7 @@ class CallPerfTest : public test::CallTest {
void TestMinTransmitBitrate(bool pad_to_min_bitrate);
void TestCaptureNtpTime(const DefaultNetworkSimulationConfig& net_config,
void TestCaptureNtpTime(const BuiltInNetworkBehaviorConfig& net_config,
int threshold_ms,
int start_time_ms,
int run_time_ms);
@ -152,7 +152,7 @@ void CallPerfTest::TestAudioVideoSync(FecMode fec,
const uint32_t kAudioSendSsrc = 1234;
const uint32_t kAudioRecvSsrc = 5678;
DefaultNetworkSimulationConfig audio_net_config;
BuiltInNetworkBehaviorConfig audio_net_config;
audio_net_config.queue_delay_ms = 500;
audio_net_config.loss_percent = 5;
@ -217,7 +217,7 @@ void CallPerfTest::TestAudioVideoSync(FecMode fec,
test::PacketTransport::kSender, video_pt_map,
absl::make_unique<FakeNetworkPipe>(
Clock::GetRealTimeClock(), absl::make_unique<SimulatedNetwork>(
DefaultNetworkSimulationConfig())));
BuiltInNetworkBehaviorConfig())));
video_send_transport->SetReceiver(receiver_call_->Receiver());
receive_transport = absl::make_unique<test::PacketTransport>(
@ -225,7 +225,7 @@ void CallPerfTest::TestAudioVideoSync(FecMode fec,
test::PacketTransport::kReceiver, payload_type_map_,
absl::make_unique<FakeNetworkPipe>(
Clock::GetRealTimeClock(), absl::make_unique<SimulatedNetwork>(
DefaultNetworkSimulationConfig())));
BuiltInNetworkBehaviorConfig())));
receive_transport->SetReceiver(sender_call_->Receiver());
CreateSendConfig(1, 0, 0, video_send_transport.get());
@ -337,14 +337,14 @@ TEST_F(CallPerfTest, PlaysOutAudioAndVideoInSyncWithVideoFasterThanAudioDrift) {
}
void CallPerfTest::TestCaptureNtpTime(
const DefaultNetworkSimulationConfig& net_config,
const BuiltInNetworkBehaviorConfig& net_config,
int threshold_ms,
int start_time_ms,
int run_time_ms) {
class CaptureNtpTimeObserver : public test::EndToEndTest,
public rtc::VideoSinkInterface<VideoFrame> {
public:
CaptureNtpTimeObserver(const DefaultNetworkSimulationConfig& net_config,
CaptureNtpTimeObserver(const BuiltInNetworkBehaviorConfig& net_config,
int threshold_ms,
int start_time_ms,
int run_time_ms)
@ -461,7 +461,7 @@ void CallPerfTest::TestCaptureNtpTime(
}
rtc::CriticalSection crit_;
const DefaultNetworkSimulationConfig net_config_;
const BuiltInNetworkBehaviorConfig net_config_;
Clock* const clock_;
int threshold_ms_;
int start_time_ms_;
@ -481,7 +481,7 @@ void CallPerfTest::TestCaptureNtpTime(
// Flaky tests, disabled on Mac due to webrtc:8291.
#if !(defined(WEBRTC_MAC))
TEST_F(CallPerfTest, CaptureNtpTimeWithNetworkDelay) {
DefaultNetworkSimulationConfig net_config;
BuiltInNetworkBehaviorConfig net_config;
net_config.queue_delay_ms = 100;
// TODO(wu): lower the threshold as the calculation/estimatation becomes more
// accurate.
@ -492,7 +492,7 @@ TEST_F(CallPerfTest, CaptureNtpTimeWithNetworkDelay) {
}
TEST_F(CallPerfTest, CaptureNtpTimeWithNetworkJitter) {
DefaultNetworkSimulationConfig net_config;
BuiltInNetworkBehaviorConfig net_config;
net_config.queue_delay_ms = 100;
net_config.delay_standard_deviation_ms = 10;
// TODO(wu): lower the threshold as the calculation/estimatation becomes more
@ -865,8 +865,8 @@ void CallPerfTest::TestMinAudioVideoBitrate(
max_bwe_(max_bwe) {}
protected:
DefaultNetworkSimulationConfig GetFakeNetworkPipeConfig() {
DefaultNetworkSimulationConfig pipe_config;
BuiltInNetworkBehaviorConfig GetFakeNetworkPipeConfig() {
BuiltInNetworkBehaviorConfig pipe_config;
pipe_config.link_capacity_kbps = test_bitrate_from_;
return pipe_config;
}
@ -903,7 +903,7 @@ void CallPerfTest::TestMinAudioVideoBitrate(
? test_bitrate <= test_bitrate_to_
: test_bitrate >= test_bitrate_to_;
test_bitrate += test_bitrate_step_) {
DefaultNetworkSimulationConfig pipe_config;
BuiltInNetworkBehaviorConfig pipe_config;
pipe_config.link_capacity_kbps = test_bitrate;
send_simulated_network_->SetConfig(pipe_config);
receive_simulated_network_->SetConfig(pipe_config);

View File

@ -30,7 +30,7 @@ bool ParseConfigParam(std::string exp_name, int* field) {
return (sscanf(group.c_str(), "%d", field) == 1);
}
absl::optional<webrtc::DefaultNetworkSimulationConfig> ParseDegradationConfig(
absl::optional<webrtc::BuiltInNetworkBehaviorConfig> ParseDegradationConfig(
bool send) {
std::string exp_prefix = "WebRTCFakeNetwork";
if (send) {
@ -39,7 +39,7 @@ absl::optional<webrtc::DefaultNetworkSimulationConfig> ParseDegradationConfig(
exp_prefix += "Receive";
}
webrtc::DefaultNetworkSimulationConfig config;
webrtc::BuiltInNetworkBehaviorConfig config;
bool configured = false;
configured |=
ParseConfigParam(exp_prefix + "DelayMs", &config.queue_delay_ms);
@ -63,15 +63,15 @@ absl::optional<webrtc::DefaultNetworkSimulationConfig> ParseDegradationConfig(
configured |= ParseConfigParam(exp_prefix + "AvgBurstLossLength",
&config.avg_burst_loss_length);
return configured
? absl::optional<webrtc::DefaultNetworkSimulationConfig>(config)
? absl::optional<webrtc::BuiltInNetworkBehaviorConfig>(config)
: absl::nullopt;
}
} // namespace
Call* CallFactory::CreateCall(const Call::Config& config) {
absl::optional<webrtc::DefaultNetworkSimulationConfig>
send_degradation_config = ParseDegradationConfig(true);
absl::optional<webrtc::DefaultNetworkSimulationConfig>
absl::optional<webrtc::BuiltInNetworkBehaviorConfig> send_degradation_config =
ParseDegradationConfig(true);
absl::optional<webrtc::BuiltInNetworkBehaviorConfig>
receive_degradation_config = ParseDegradationConfig(false);
if (send_degradation_config || receive_degradation_config) {

View File

@ -17,8 +17,8 @@
namespace webrtc {
DegradedCall::DegradedCall(
std::unique_ptr<Call> call,
absl::optional<DefaultNetworkSimulationConfig> send_config,
absl::optional<DefaultNetworkSimulationConfig> receive_config)
absl::optional<BuiltInNetworkBehaviorConfig> send_config,
absl::optional<BuiltInNetworkBehaviorConfig> receive_config)
: clock_(Clock::GetRealTimeClock()),
call_(std::move(call)),
send_config_(send_config),

View File

@ -28,8 +28,8 @@ class DegradedCall : public Call, private Transport, private PacketReceiver {
public:
explicit DegradedCall(
std::unique_ptr<Call> call,
absl::optional<DefaultNetworkSimulationConfig> send_config,
absl::optional<DefaultNetworkSimulationConfig> receive_config);
absl::optional<BuiltInNetworkBehaviorConfig> send_config,
absl::optional<BuiltInNetworkBehaviorConfig> receive_config);
~DegradedCall() override;
// Implements Call.
@ -91,13 +91,13 @@ class DegradedCall : public Call, private Transport, private PacketReceiver {
Clock* const clock_;
const std::unique_ptr<Call> call_;
const absl::optional<DefaultNetworkSimulationConfig> send_config_;
const absl::optional<BuiltInNetworkBehaviorConfig> send_config_;
const std::unique_ptr<ProcessThread> send_process_thread_;
SimulatedNetwork* send_simulated_network_;
std::unique_ptr<FakeNetworkPipe> send_pipe_;
size_t num_send_streams_;
const absl::optional<DefaultNetworkSimulationConfig> receive_config_;
const absl::optional<BuiltInNetworkBehaviorConfig> receive_config_;
SimulatedNetwork* receive_simulated_network_;
std::unique_ptr<FakeNetworkPipe> receive_pipe_;
};

View File

@ -67,7 +67,7 @@ class RampUpTester : public test::EndToEndTest {
rtc::Event stop_event_;
Clock* const clock_;
DefaultNetworkSimulationConfig forward_transport_config_;
BuiltInNetworkBehaviorConfig forward_transport_config_;
const size_t num_video_streams_;
const size_t num_audio_streams_;
const size_t num_flexfec_streams_;

View File

@ -28,7 +28,7 @@ namespace webrtc {
// capacity introduced delay.
class SimulatedNetwork : public NetworkBehaviorInterface {
public:
using Config = DefaultNetworkSimulationConfig;
using Config = BuiltInNetworkBehaviorConfig;
explicit SimulatedNetwork(Config config, uint64_t random_seed = 1);
~SimulatedNetwork() override;

View File

@ -73,7 +73,7 @@ class FakeNetworkPipeTest : public ::testing::Test {
// Test the capacity link and verify we get as many packets as we expect.
TEST_F(FakeNetworkPipeTest, CapacityTest) {
DefaultNetworkSimulationConfig config;
BuiltInNetworkBehaviorConfig config;
config.queue_length_packets = 20;
config.link_capacity_kbps = 80;
MockReceiver receiver;
@ -113,7 +113,7 @@ TEST_F(FakeNetworkPipeTest, CapacityTest) {
// Test the extra network delay.
TEST_F(FakeNetworkPipeTest, ExtraDelayTest) {
DefaultNetworkSimulationConfig config;
BuiltInNetworkBehaviorConfig config;
config.queue_length_packets = 20;
config.queue_delay_ms = 100;
config.link_capacity_kbps = 80;
@ -149,7 +149,7 @@ TEST_F(FakeNetworkPipeTest, ExtraDelayTest) {
// Test the number of buffers and packets are dropped when sending too many
// packets too quickly.
TEST_F(FakeNetworkPipeTest, QueueLengthTest) {
DefaultNetworkSimulationConfig config;
BuiltInNetworkBehaviorConfig config;
config.queue_length_packets = 2;
config.link_capacity_kbps = 80;
MockReceiver receiver;
@ -173,7 +173,7 @@ TEST_F(FakeNetworkPipeTest, QueueLengthTest) {
// Test we get statistics as expected.
TEST_F(FakeNetworkPipeTest, StatisticsTest) {
DefaultNetworkSimulationConfig config;
BuiltInNetworkBehaviorConfig config;
config.queue_length_packets = 2;
config.queue_delay_ms = 20;
config.link_capacity_kbps = 80;
@ -205,7 +205,7 @@ TEST_F(FakeNetworkPipeTest, StatisticsTest) {
// Change the link capacity half-way through the test and verify that the
// delivery times change accordingly.
TEST_F(FakeNetworkPipeTest, ChangingCapacityWithEmptyPipeTest) {
DefaultNetworkSimulationConfig config;
BuiltInNetworkBehaviorConfig config;
config.queue_length_packets = 20;
config.link_capacity_kbps = 80;
MockReceiver receiver;
@ -266,7 +266,7 @@ TEST_F(FakeNetworkPipeTest, ChangingCapacityWithEmptyPipeTest) {
// Change the link capacity half-way through the test and verify that the
// delivery times change accordingly.
TEST_F(FakeNetworkPipeTest, ChangingCapacityWithPacketsInPipeTest) {
DefaultNetworkSimulationConfig config;
BuiltInNetworkBehaviorConfig config;
config.queue_length_packets = 20;
config.link_capacity_kbps = 80;
MockReceiver receiver;
@ -321,7 +321,7 @@ TEST_F(FakeNetworkPipeTest, ChangingCapacityWithPacketsInPipeTest) {
// At first disallow reordering and then allow reordering.
TEST_F(FakeNetworkPipeTest, DisallowReorderingThenAllowReordering) {
DefaultNetworkSimulationConfig config;
BuiltInNetworkBehaviorConfig config;
config.queue_length_packets = 1000;
config.link_capacity_kbps = 800;
config.queue_delay_ms = 100;
@ -374,7 +374,7 @@ TEST_F(FakeNetworkPipeTest, BurstLoss) {
const int kNumPackets = 10000;
const int kPacketSize = 10;
DefaultNetworkSimulationConfig config;
BuiltInNetworkBehaviorConfig config;
config.queue_length_packets = kNumPackets;
config.loss_percent = kLossPercent;
config.avg_burst_loss_length = kAvgBurstLength;
@ -409,7 +409,7 @@ TEST_F(FakeNetworkPipeTest, BurstLoss) {
}
TEST_F(FakeNetworkPipeTest, SetReceiver) {
DefaultNetworkSimulationConfig config;
BuiltInNetworkBehaviorConfig config;
config.link_capacity_kbps = 800;
MockReceiver receiver;
auto simulated_network = absl::make_unique<SimulatedNetwork>(config);

View File

@ -742,8 +742,8 @@ test::PacketTransport* BaseTest::CreateSendTransport(
task_queue, sender_call, this, test::PacketTransport::kSender,
CallTest::payload_type_map_,
absl::make_unique<FakeNetworkPipe>(
Clock::GetRealTimeClock(), absl::make_unique<SimulatedNetwork>(
DefaultNetworkSimulationConfig())));
Clock::GetRealTimeClock(),
absl::make_unique<SimulatedNetwork>(BuiltInNetworkBehaviorConfig())));
}
test::PacketTransport* BaseTest::CreateReceiveTransport(
@ -752,8 +752,8 @@ test::PacketTransport* BaseTest::CreateReceiveTransport(
task_queue, nullptr, this, test::PacketTransport::kReceiver,
CallTest::payload_type_map_,
absl::make_unique<FakeNetworkPipe>(
Clock::GetRealTimeClock(), absl::make_unique<SimulatedNetwork>(
DefaultNetworkSimulationConfig())));
Clock::GetRealTimeClock(),
absl::make_unique<SimulatedNetwork>(BuiltInNetworkBehaviorConfig())));
}
size_t BaseTest::GetNumVideoStreams() const {

View File

@ -160,9 +160,8 @@ TEST_F(BandwidthEndToEndTest, RembWithSendSideBwe) {
task_queue, nullptr, this, test::PacketTransport::kReceiver,
payload_type_map_,
absl::make_unique<FakeNetworkPipe>(
Clock::GetRealTimeClock(),
absl::make_unique<SimulatedNetwork>(
DefaultNetworkSimulationConfig())));
Clock::GetRealTimeClock(), absl::make_unique<SimulatedNetwork>(
BuiltInNetworkBehaviorConfig())));
return receive_transport_;
}

View File

@ -114,15 +114,15 @@ TEST_P(CallOperationEndToEndTest, RendersSingleDelayedFrame) {
sender_transport = absl::make_unique<test::DirectTransport>(
&task_queue_,
absl::make_unique<FakeNetworkPipe>(
Clock::GetRealTimeClock(), absl::make_unique<SimulatedNetwork>(
DefaultNetworkSimulationConfig())),
absl::make_unique<FakeNetworkPipe>(Clock::GetRealTimeClock(),
absl::make_unique<SimulatedNetwork>(
BuiltInNetworkBehaviorConfig())),
sender_call_.get(), payload_type_map_);
receiver_transport = absl::make_unique<test::DirectTransport>(
&task_queue_,
absl::make_unique<FakeNetworkPipe>(
Clock::GetRealTimeClock(), absl::make_unique<SimulatedNetwork>(
DefaultNetworkSimulationConfig())),
absl::make_unique<FakeNetworkPipe>(Clock::GetRealTimeClock(),
absl::make_unique<SimulatedNetwork>(
BuiltInNetworkBehaviorConfig())),
receiver_call_.get(), payload_type_map_);
sender_transport->SetReceiver(receiver_call_->Receiver());
receiver_transport->SetReceiver(sender_call_->Receiver());
@ -182,15 +182,15 @@ TEST_P(CallOperationEndToEndTest, TransmitsFirstFrame) {
sender_transport = absl::make_unique<test::DirectTransport>(
&task_queue_,
absl::make_unique<FakeNetworkPipe>(
Clock::GetRealTimeClock(), absl::make_unique<SimulatedNetwork>(
DefaultNetworkSimulationConfig())),
absl::make_unique<FakeNetworkPipe>(Clock::GetRealTimeClock(),
absl::make_unique<SimulatedNetwork>(
BuiltInNetworkBehaviorConfig())),
sender_call_.get(), payload_type_map_);
receiver_transport = absl::make_unique<test::DirectTransport>(
&task_queue_,
absl::make_unique<FakeNetworkPipe>(
Clock::GetRealTimeClock(), absl::make_unique<SimulatedNetwork>(
DefaultNetworkSimulationConfig())),
absl::make_unique<FakeNetworkPipe>(Clock::GetRealTimeClock(),
absl::make_unique<SimulatedNetwork>(
BuiltInNetworkBehaviorConfig())),
receiver_call_.get(), payload_type_map_);
sender_transport->SetReceiver(receiver_call_->Receiver());
receiver_transport->SetReceiver(sender_call_->Receiver());
@ -257,15 +257,15 @@ TEST_P(CallOperationEndToEndTest, ObserversEncodedFrames) {
sender_transport = absl::make_unique<test::DirectTransport>(
&task_queue_,
absl::make_unique<FakeNetworkPipe>(
Clock::GetRealTimeClock(), absl::make_unique<SimulatedNetwork>(
DefaultNetworkSimulationConfig())),
absl::make_unique<FakeNetworkPipe>(Clock::GetRealTimeClock(),
absl::make_unique<SimulatedNetwork>(
BuiltInNetworkBehaviorConfig())),
sender_call_.get(), payload_type_map_);
receiver_transport = absl::make_unique<test::DirectTransport>(
&task_queue_,
absl::make_unique<FakeNetworkPipe>(
Clock::GetRealTimeClock(), absl::make_unique<SimulatedNetwork>(
DefaultNetworkSimulationConfig())),
absl::make_unique<FakeNetworkPipe>(Clock::GetRealTimeClock(),
absl::make_unique<SimulatedNetwork>(
BuiltInNetworkBehaviorConfig())),
receiver_call_.get(), payload_type_map_);
sender_transport->SetReceiver(receiver_call_->Receiver());
receiver_transport->SetReceiver(sender_call_->Receiver());

View File

@ -170,7 +170,7 @@ class RtcpXrObserver : public test::EndToEndTest {
bool sent_rtcp_target_bitrate_ RTC_GUARDED_BY(&crit_);
bool sent_zero_rtcp_target_bitrate_ RTC_GUARDED_BY(&crit_);
int sent_rtcp_dlrr_;
DefaultNetworkSimulationConfig forward_transport_config_;
BuiltInNetworkBehaviorConfig forward_transport_config_;
SimulatedNetwork* send_simulated_network_;
};

View File

@ -234,7 +234,7 @@ class FlexfecRenderObserver : public test::EndToEndTest,
Call* sender_call) override {
// At low RTT (< kLowRttNackMs) -> NACK only, no FEC.
const int kNetworkDelayMs = 100;
DefaultNetworkSimulationConfig config;
BuiltInNetworkBehaviorConfig config;
config.queue_delay_ms = kNetworkDelayMs;
return new test::PacketTransport(
task_queue, sender_call, this, test::PacketTransport::kSender,
@ -421,7 +421,7 @@ TEST_F(FecEndToEndTest, ReceivedUlpfecPacketsNotNacked) {
// At low RTT (< kLowRttNackMs) -> NACK only, no FEC.
// Configure some network delay.
const int kNetworkDelayMs = 50;
DefaultNetworkSimulationConfig config;
BuiltInNetworkBehaviorConfig config;
config.queue_delay_ms = kNetworkDelayMs;
return new test::PacketTransport(
task_queue, sender_call, this, test::PacketTransport::kSender,

View File

@ -153,18 +153,16 @@ class MultiCodecReceiveTest : public test::CallTest {
&task_queue_, sender_call_.get(), &observer_,
test::PacketTransport::kSender, kPayloadTypeMap,
absl::make_unique<FakeNetworkPipe>(
Clock::GetRealTimeClock(),
absl::make_unique<SimulatedNetwork>(
DefaultNetworkSimulationConfig()))));
Clock::GetRealTimeClock(), absl::make_unique<SimulatedNetwork>(
BuiltInNetworkBehaviorConfig()))));
send_transport_->SetReceiver(receiver_call_->Receiver());
receive_transport_.reset(new test::PacketTransport(
&task_queue_, receiver_call_.get(), &observer_,
test::PacketTransport::kReceiver, kPayloadTypeMap,
absl::make_unique<FakeNetworkPipe>(
Clock::GetRealTimeClock(),
absl::make_unique<SimulatedNetwork>(
DefaultNetworkSimulationConfig()))));
Clock::GetRealTimeClock(), absl::make_unique<SimulatedNetwork>(
BuiltInNetworkBehaviorConfig()))));
receive_transport_->SetReceiver(sender_call_->Receiver());
});
}

View File

@ -143,9 +143,9 @@ test::DirectTransport* MultiStreamTester::CreateSendTransport(
Call* sender_call) {
return new test::DirectTransport(
task_queue,
absl::make_unique<FakeNetworkPipe>(Clock::GetRealTimeClock(),
absl::make_unique<SimulatedNetwork>(
DefaultNetworkSimulationConfig())),
absl::make_unique<FakeNetworkPipe>(
Clock::GetRealTimeClock(),
absl::make_unique<SimulatedNetwork>(BuiltInNetworkBehaviorConfig())),
sender_call, payload_type_map_);
}
@ -154,9 +154,9 @@ test::DirectTransport* MultiStreamTester::CreateReceiveTransport(
Call* receiver_call) {
return new test::DirectTransport(
task_queue,
absl::make_unique<FakeNetworkPipe>(Clock::GetRealTimeClock(),
absl::make_unique<SimulatedNetwork>(
DefaultNetworkSimulationConfig())),
absl::make_unique<FakeNetworkPipe>(
Clock::GetRealTimeClock(),
absl::make_unique<SimulatedNetwork>(BuiltInNetworkBehaviorConfig())),
receiver_call, payload_type_map_);
}
} // namespace webrtc

View File

@ -118,9 +118,9 @@ void NetworkStateEndToEndTest::VerifyNewVideoReceiveStreamsRespectNetworkState(
receiver_call_->SignalChannelNetworkState(network_to_bring_up, kNetworkUp);
sender_transport = absl::make_unique<test::DirectTransport>(
&task_queue_,
absl::make_unique<FakeNetworkPipe>(
Clock::GetRealTimeClock(), absl::make_unique<SimulatedNetwork>(
DefaultNetworkSimulationConfig())),
absl::make_unique<FakeNetworkPipe>(Clock::GetRealTimeClock(),
absl::make_unique<SimulatedNetwork>(
BuiltInNetworkBehaviorConfig())),
sender_call_.get(), payload_type_map_);
sender_transport->SetReceiver(receiver_call_->Receiver());
CreateSendConfig(1, 0, 0, sender_transport.get());

View File

@ -221,7 +221,7 @@ TEST_P(ProbingEndToEndTest, ProbeOnVideoEncoderReconfiguration) {
test::SingleThreadedTaskQueueForTesting* task_queue,
Call* sender_call) override {
auto network =
absl::make_unique<SimulatedNetwork>(DefaultNetworkSimulationConfig());
absl::make_unique<SimulatedNetwork>(BuiltInNetworkBehaviorConfig());
send_simulated_network_ = network.get();
return new test::PacketTransport(
task_queue, sender_call, this, test::PacketTransport::kSender,
@ -245,7 +245,7 @@ TEST_P(ProbingEndToEndTest, ProbeOnVideoEncoderReconfiguration) {
// bitrate).
if (stats.send_bandwidth_bps >= 250000 &&
stats.send_bandwidth_bps <= 350000) {
DefaultNetworkSimulationConfig config;
BuiltInNetworkBehaviorConfig config;
config.link_capacity_kbps = 200;
send_simulated_network_->SetConfig(config);
@ -260,7 +260,7 @@ TEST_P(ProbingEndToEndTest, ProbeOnVideoEncoderReconfiguration) {
break;
case 1:
if (stats.send_bandwidth_bps <= 210000) {
DefaultNetworkSimulationConfig config;
BuiltInNetworkBehaviorConfig config;
config.link_capacity_kbps = 5000;
send_simulated_network_->SetConfig(config);

View File

@ -96,7 +96,7 @@ class ReportedReceiveTimeTester : public test::EndToEndTest {
Call* sender_call) override {
auto pipe = absl::make_unique<FakeNetworkPipe>(
Clock::GetRealTimeClock(),
absl::make_unique<SimulatedNetwork>(DefaultNetworkSimulationConfig()));
absl::make_unique<SimulatedNetwork>(BuiltInNetworkBehaviorConfig()));
send_pipe_ = pipe.get();
return send_transport_ = new test::PacketTransport(
task_queue, sender_call, this, test::PacketTransport::kSender,

View File

@ -131,9 +131,8 @@ TEST_F(RetransmissionEndToEndTest, ReceivesNackAndRetransmitsAudio) {
task_queue, nullptr, this, test::PacketTransport::kReceiver,
payload_type_map_,
absl::make_unique<FakeNetworkPipe>(
Clock::GetRealTimeClock(),
absl::make_unique<SimulatedNetwork>(
DefaultNetworkSimulationConfig())));
Clock::GetRealTimeClock(), absl::make_unique<SimulatedNetwork>(
BuiltInNetworkBehaviorConfig())));
receive_transport_ = receive_transport;
return receive_transport;
}

View File

@ -282,13 +282,13 @@ void RtpRtcpEndToEndTest::TestRtpStatePreservation(
test::PacketTransport::kSender, payload_type_map_,
absl::make_unique<FakeNetworkPipe>(
Clock::GetRealTimeClock(), absl::make_unique<SimulatedNetwork>(
DefaultNetworkSimulationConfig())));
BuiltInNetworkBehaviorConfig())));
receive_transport = absl::make_unique<test::PacketTransport>(
&task_queue_, nullptr, &observer, test::PacketTransport::kReceiver,
payload_type_map_,
absl::make_unique<FakeNetworkPipe>(
Clock::GetRealTimeClock(), absl::make_unique<SimulatedNetwork>(
DefaultNetworkSimulationConfig())));
BuiltInNetworkBehaviorConfig())));
send_transport->SetReceiver(receiver_call_->Receiver());
receive_transport->SetReceiver(sender_call_->Receiver());
@ -474,7 +474,7 @@ TEST_F(RtpRtcpEndToEndTest, DISABLED_TestFlexfecRtpStatePreservation) {
task_queue_.SendTask([&]() {
CreateCalls();
DefaultNetworkSimulationConfig lossy_delayed_link;
BuiltInNetworkBehaviorConfig lossy_delayed_link;
lossy_delayed_link.loss_percent = 2;
lossy_delayed_link.queue_delay_ms = 50;
@ -486,7 +486,7 @@ TEST_F(RtpRtcpEndToEndTest, DISABLED_TestFlexfecRtpStatePreservation) {
absl::make_unique<SimulatedNetwork>(lossy_delayed_link)));
send_transport->SetReceiver(receiver_call_->Receiver());
DefaultNetworkSimulationConfig flawless_link;
BuiltInNetworkBehaviorConfig flawless_link;
receive_transport = absl::make_unique<test::PacketTransport>(
&task_queue_, nullptr, &observer, test::PacketTransport::kReceiver,
payload_type_map_,

View File

@ -82,15 +82,15 @@ TEST_F(SsrcEndToEndTest, UnknownRtpPacketGivesUnknownSsrcReturnCode) {
send_transport = absl::make_unique<test::DirectTransport>(
&task_queue_,
absl::make_unique<FakeNetworkPipe>(
Clock::GetRealTimeClock(), absl::make_unique<SimulatedNetwork>(
DefaultNetworkSimulationConfig())),
absl::make_unique<FakeNetworkPipe>(Clock::GetRealTimeClock(),
absl::make_unique<SimulatedNetwork>(
BuiltInNetworkBehaviorConfig())),
sender_call_.get(), payload_type_map_);
receive_transport = absl::make_unique<test::DirectTransport>(
&task_queue_,
absl::make_unique<FakeNetworkPipe>(
Clock::GetRealTimeClock(), absl::make_unique<SimulatedNetwork>(
DefaultNetworkSimulationConfig())),
absl::make_unique<FakeNetworkPipe>(Clock::GetRealTimeClock(),
absl::make_unique<SimulatedNetwork>(
BuiltInNetworkBehaviorConfig())),
receiver_call_.get(), payload_type_map_);
input_observer =
absl::make_unique<PacketInputObserver>(receiver_call_->Receiver());

View File

@ -231,7 +231,7 @@ TEST_F(StatsEndToEndTest, GetStats) {
test::PacketTransport* CreateSendTransport(
test::SingleThreadedTaskQueueForTesting* task_queue,
Call* sender_call) override {
DefaultNetworkSimulationConfig network_config;
BuiltInNetworkBehaviorConfig network_config;
network_config.loss_percent = 5;
return new test::PacketTransport(
task_queue, sender_call, this, test::PacketTransport::kSender,
@ -713,7 +713,7 @@ TEST_F(StatsEndToEndTest, CallReportsRttForSender) {
std::unique_ptr<test::DirectTransport> receiver_transport;
task_queue_.SendTask([this, &sender_transport, &receiver_transport]() {
DefaultNetworkSimulationConfig config;
BuiltInNetworkBehaviorConfig config;
config.queue_delay_ms = kSendDelayMs;
CreateCalls();
sender_transport = absl::make_unique<test::DirectTransport>(

View File

@ -55,7 +55,7 @@ TEST_P(TransportFeedbackEndToEndTest, AssignsTransportSequenceNumbers) {
absl::make_unique<FakeNetworkPipe>(
Clock::GetRealTimeClock(),
absl::make_unique<SimulatedNetwork>(
DefaultNetworkSimulationConfig())),
BuiltInNetworkBehaviorConfig())),
sender_call,
payload_type_map),
done_(false, false),

View File

@ -58,7 +58,7 @@ struct ParamsWithLogging : public VideoQualityTest::Params {
// Use these logging flags by default, for everything.
logging = {flags::RtcEventLogName(), flags::RtpDumpName(),
flags::EncodedFramePath()};
this->config = DefaultNetworkSimulationConfig();
this->config = BuiltInNetworkBehaviorConfig();
}
};

View File

@ -299,7 +299,7 @@ void PictureIdTest::SetupEncoder(VideoEncoderFactory* encoder_factory,
test::PacketTransport::kSender, payload_type_map_,
absl::make_unique<FakeNetworkPipe>(
Clock::GetRealTimeClock(), absl::make_unique<SimulatedNetwork>(
DefaultNetworkSimulationConfig()))));
BuiltInNetworkBehaviorConfig()))));
CreateSendConfig(kNumSimulcastStreams, 0, 0, send_transport_.get());
GetVideoSendConfig()->encoder_settings.encoder_factory = encoder_factory;

View File

@ -276,7 +276,7 @@ DEFINE_bool(help, false, "prints this message");
} // namespace flags
void Loopback() {
DefaultNetworkSimulationConfig pipe_config;
BuiltInNetworkBehaviorConfig pipe_config;
pipe_config.loss_percent = flags::LossPercent();
pipe_config.link_capacity_kbps = flags::LinkCapacityKbps();
pipe_config.queue_length_packets = flags::QueueSize();

View File

@ -475,7 +475,7 @@ void Loopback() {
screenshare_idx = 0;
}
DefaultNetworkSimulationConfig pipe_config;
BuiltInNetworkBehaviorConfig pipe_config;
pipe_config.loss_percent = flags::LossPercent();
pipe_config.avg_burst_loss_length = flags::AvgBurstLossLength();
pipe_config.link_capacity_kbps = flags::LinkCapacityKbps();

View File

@ -279,7 +279,7 @@ DEFINE_bool(help, false, "prints this message");
} // namespace flags
void Loopback() {
DefaultNetworkSimulationConfig pipe_config;
BuiltInNetworkBehaviorConfig pipe_config;
pipe_config.loss_percent = flags::LossPercent();
pipe_config.avg_burst_loss_length = flags::AvgBurstLossLength();
pipe_config.link_capacity_kbps = flags::LinkCapacityKbps();

View File

@ -541,7 +541,7 @@ class UlpfecObserver : public test::EndToEndTest {
// At low RTT (< kLowRttNackMs) -> NACK only, no FEC.
// Configure some network delay.
const int kNetworkDelayMs = 100;
DefaultNetworkSimulationConfig config;
BuiltInNetworkBehaviorConfig config;
config.loss_percent = 5;
config.queue_delay_ms = kNetworkDelayMs;
return new test::PacketTransport(
@ -731,7 +731,7 @@ class FlexfecObserver : public test::EndToEndTest {
// At low RTT (< kLowRttNackMs) -> NACK only, no FEC.
// Therefore we need some network delay.
const int kNetworkDelayMs = 100;
DefaultNetworkSimulationConfig config;
BuiltInNetworkBehaviorConfig config;
config.loss_percent = 5;
config.queue_delay_ms = kNetworkDelayMs;
return new test::PacketTransport(
@ -1481,7 +1481,7 @@ TEST_P(VideoSendStreamTest, PaddingIsPrimarilyRetransmissions) {
test::SingleThreadedTaskQueueForTesting* task_queue,
Call* sender_call) override {
const int kNetworkDelayMs = 50;
DefaultNetworkSimulationConfig config;
BuiltInNetworkBehaviorConfig config;
config.loss_percent = 10;
config.link_capacity_kbps = kCapacityKbps;
config.queue_delay_ms = kNetworkDelayMs;