Injecting Clock into video senders.

Bug: webrtc:10365
Change-Id: I1dc42345a95929970d4f390e04eff56ca0c6d60b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/125190
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26959}
diff --git a/call/rtp_video_sender.cc b/call/rtp_video_sender.cc
index 6c22120..e5098db 100644
--- a/call/rtp_video_sender.cc
+++ b/call/rtp_video_sender.cc
@@ -58,6 +58,7 @@
 using webrtc_internal_rtp_video_sender::RtpStreamSender;
 
 std::vector<RtpStreamSender> CreateRtpStreamSenders(
+    Clock* clock,
     const RtpConfig& rtp_config,
     int rtcp_report_interval_ms,
     Transport* send_transport,
@@ -79,6 +80,7 @@
   RTC_DCHECK_GT(rtp_config.ssrcs.size(), 0);
 
   RtpRtcp::Configuration configuration;
+  configuration.clock = clock;
   configuration.audio = false;
   configuration.clock = Clock::GetRealTimeClock();
   configuration.receiver_only = false;
@@ -147,6 +149,7 @@
 
 // TODO(brandtr): Update this function when we support multistream protection.
 std::unique_ptr<FlexfecSender> MaybeCreateFlexfecSender(
+    Clock* clock,
     const RtpConfig& rtp,
     const std::map<uint32_t, RtpState>& suspended_ssrcs) {
   if (rtp.flexfec.payload_type < 0) {
@@ -185,7 +188,7 @@
   return absl::make_unique<FlexfecSender>(
       rtp.flexfec.payload_type, rtp.flexfec.ssrc,
       rtp.flexfec.protected_media_ssrcs[0], rtp.mid, rtp.extensions,
-      RTPSender::FecExtensionSizes(), rtp_state, Clock::GetRealTimeClock());
+      RTPSender::FecExtensionSizes(), rtp_state, clock);
 }
 
 uint32_t CalculateOverheadRateBps(int packets_per_second,
@@ -205,6 +208,7 @@
 }  // namespace
 
 RtpVideoSender::RtpVideoSender(
+    Clock* clock,
     std::map<uint32_t, RtpState> suspended_ssrcs,
     const std::map<uint32_t, RtpPayloadState>& states,
     const RtpConfig& rtp_config,
@@ -224,9 +228,11 @@
       active_(false),
       module_process_thread_(nullptr),
       suspended_ssrcs_(std::move(suspended_ssrcs)),
-      flexfec_sender_(MaybeCreateFlexfecSender(rtp_config, suspended_ssrcs_)),
+      flexfec_sender_(
+          MaybeCreateFlexfecSender(clock, rtp_config, suspended_ssrcs_)),
       fec_controller_(std::move(fec_controller)),
-      rtp_streams_(CreateRtpStreamSenders(rtp_config,
+      rtp_streams_(CreateRtpStreamSenders(clock,
+                                          rtp_config,
                                           rtcp_report_interval_ms,
                                           send_transport,
                                           observers.intra_frame_callback,