Introduce SimulatedNetworkReceiverInterface.

Introduce SimulatedNetworkReceiverInterface and switch DirectTransport
on this interface. Also switch part of related users on
DefaultNetworkSimulationConfig.

This two changes united into single CL to prevent work duplication.
Most changes were done because of stop including fake_network_pipe.h
into direct_transport.h, so splitting this into 2 CLs will require
first fix all imports of fake_network_pipe.h and then replace them
on new API imports again.

Bug: webrtc:9630
Change-Id: I87d4a6ff1bab72d04a9871a40441f4fbe028f4e6
Reviewed-on: https://webrtc-review.googlesource.com/94762
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24336}
diff --git a/call/call_perf_tests.cc b/call/call_perf_tests.cc
index 54e01b1..00cfada 100644
--- a/call/call_perf_tests.cc
+++ b/call/call_perf_tests.cc
@@ -15,6 +15,7 @@
 
 #include "absl/memory/memory.h"
 #include "api/audio_codecs/builtin_audio_encoder_factory.h"
+#include "api/test/simulated_network.h"
 #include "api/video/video_bitrate_allocation.h"
 #include "api/video_codecs/video_encoder_config.h"
 #include "call/call.h"
@@ -60,7 +61,7 @@
 
   void TestMinTransmitBitrate(bool pad_to_min_bitrate);
 
-  void TestCaptureNtpTime(const FakeNetworkPipe::Config& net_config,
+  void TestCaptureNtpTime(const DefaultNetworkSimulationConfig& net_config,
                           int threshold_ms,
                           int start_time_ms,
                           int run_time_ms);
@@ -148,7 +149,7 @@
   const uint32_t kAudioSendSsrc = 1234;
   const uint32_t kAudioRecvSsrc = 5678;
 
-  FakeNetworkPipe::Config audio_net_config;
+  DefaultNetworkSimulationConfig audio_net_config;
   audio_net_config.queue_delay_ms = 500;
   audio_net_config.loss_percent = 5;
 
@@ -207,13 +208,13 @@
     video_send_transport = absl::make_unique<test::PacketTransport>(
         &task_queue_, sender_call_.get(), &observer,
         test::PacketTransport::kSender, video_pt_map,
-        FakeNetworkPipe::Config());
+        DefaultNetworkSimulationConfig());
     video_send_transport->SetReceiver(receiver_call_->Receiver());
 
     receive_transport = absl::make_unique<test::PacketTransport>(
         &task_queue_, receiver_call_.get(), &observer,
         test::PacketTransport::kReceiver, payload_type_map_,
-        FakeNetworkPipe::Config());
+        DefaultNetworkSimulationConfig());
     receive_transport->SetReceiver(sender_call_->Receiver());
 
     CreateSendConfig(1, 0, 0, video_send_transport.get());
@@ -323,14 +324,15 @@
                      DriftingClock::PercentsSlower(30.0f), "_video_faster");
 }
 
-void CallPerfTest::TestCaptureNtpTime(const FakeNetworkPipe::Config& net_config,
-                                      int threshold_ms,
-                                      int start_time_ms,
-                                      int run_time_ms) {
+void CallPerfTest::TestCaptureNtpTime(
+    const DefaultNetworkSimulationConfig& 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 FakeNetworkPipe::Config& net_config,
+    CaptureNtpTimeObserver(const DefaultNetworkSimulationConfig& net_config,
                            int threshold_ms,
                            int start_time_ms,
                            int run_time_ms)
@@ -441,7 +443,7 @@
     }
 
     rtc::CriticalSection crit_;
-    const FakeNetworkPipe::Config net_config_;
+    const DefaultNetworkSimulationConfig net_config_;
     Clock* const clock_;
     int threshold_ms_;
     int start_time_ms_;
@@ -461,7 +463,7 @@
 // Flaky tests, disabled on Mac due to webrtc:8291.
 #if !(defined(WEBRTC_MAC))
 TEST_F(CallPerfTest, CaptureNtpTimeWithNetworkDelay) {
-  FakeNetworkPipe::Config net_config;
+  DefaultNetworkSimulationConfig net_config;
   net_config.queue_delay_ms = 100;
   // TODO(wu): lower the threshold as the calculation/estimatation becomes more
   // accurate.
@@ -472,7 +474,7 @@
 }
 
 TEST_F(CallPerfTest, CaptureNtpTimeWithNetworkJitter) {
-  FakeNetworkPipe::Config net_config;
+  DefaultNetworkSimulationConfig 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
@@ -828,8 +830,8 @@
           max_bwe_(max_bwe) {}
 
    protected:
-    FakeNetworkPipe::Config GetFakeNetworkPipeConfig() {
-      FakeNetworkPipe::Config pipe_config;
+    DefaultNetworkSimulationConfig GetFakeNetworkPipeConfig() {
+      DefaultNetworkSimulationConfig pipe_config;
       pipe_config.link_capacity_kbps = test_bitrate_from_;
       return pipe_config;
     }
@@ -856,7 +858,7 @@
                ? test_bitrate <= test_bitrate_to_
                : test_bitrate >= test_bitrate_to_;
            test_bitrate += test_bitrate_step_) {
-        FakeNetworkPipe::Config pipe_config;
+        DefaultNetworkSimulationConfig pipe_config;
         pipe_config.link_capacity_kbps = test_bitrate;
         send_transport_->SetConfig(pipe_config);
         receive_transport_->SetConfig(pipe_config);