FrameCadenceAdapter: remove unused field trials.

The feature is mature enough that we don't need these kill switches
and field trials anymore.

Bug: chromium:40200151
Change-Id: I0344a42c8637034226925bc95f1eda10c69df977
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/396801
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#44959}
diff --git a/experiments/field_trials.py b/experiments/field_trials.py
index cbbf023..6548069 100755
--- a/experiments/field_trials.py
+++ b/experiments/field_trials.py
@@ -95,9 +95,6 @@
     FieldTrial('WebRTC-EnableDtlsPqc',
                404763475,
                date(2026,6,1)),
-    FieldTrial('WebRTC-FrameCadenceAdapter-UseVideoFrameTimestamp',
-               42226256,
-               date(2024, 10, 1)),
     FieldTrial('WebRTC-IPv6NetworkResolutionFixes',
                42224598,
                date(2024, 4, 1)),
@@ -206,9 +203,6 @@
     FieldTrial('WebRTC-VideoEncoderSettings',
                40252667,
                date(2024, 4, 1)),
-    FieldTrial('WebRTC-ZeroHertzQueueOverload',
-               42225879,
-               date(2024, 7, 1)),
     FieldTrial('WebRTC-Video-H26xPacketBuffer',
                41480904,
                date(2024, 6, 1)),
diff --git a/video/frame_cadence_adapter.cc b/video/frame_cadence_adapter.cc
index 2f02f5e..63feaee 100644
--- a/video/frame_cadence_adapter.cc
+++ b/video/frame_cadence_adapter.cc
@@ -108,8 +108,7 @@
                        Clock* clock,
                        FrameCadenceAdapterInterface::Callback* callback,
                        double max_fps,
-                       std::atomic<int>& frames_scheduled_for_processing,
-                       bool zero_hertz_queue_overload);
+                       std::atomic<int>& frames_scheduled_for_processing);
   ~ZeroHertzAdapterMode() override { refresh_frame_requester_.Stop(); }
 
   // Reconfigures according to parameters.
@@ -227,9 +226,6 @@
   // `queue_`.
   const std::atomic<int>& frames_scheduled_for_processing_;
 
-  // Can be used as kill-switch for the queue overload mechanism.
-  const bool zero_hertz_queue_overload_enabled_;
-
   // How much the incoming frame sequence is delayed by.
   const TimeDelta frame_delay_ = TimeDelta::Seconds(1) / max_fps_;
 
@@ -393,12 +389,6 @@
   Clock* const clock_;
   TaskQueueBase* const queue_;
 
-  // Kill-switch for the queue overload mechanism in zero-hertz mode.
-  const bool frame_cadence_adapter_zero_hertz_queue_overload_enabled_;
-
-  // Field trial for using timestamp from video frames, rather than clock when
-  // calculating input frame rate.
-  const bool use_video_frame_timestamp_;
   // Used for verifying that timestamps are monotonically increasing.
   std::optional<Timestamp> last_incoming_frame_timestamp_;
 
@@ -445,14 +435,12 @@
     Clock* clock,
     FrameCadenceAdapterInterface::Callback* callback,
     double max_fps,
-    std::atomic<int>& frames_scheduled_for_processing,
-    bool zero_hertz_queue_overload_enabled)
+    std::atomic<int>& frames_scheduled_for_processing)
     : queue_(queue),
       clock_(clock),
       callback_(callback),
       max_fps_(max_fps),
-      frames_scheduled_for_processing_(frames_scheduled_for_processing),
-      zero_hertz_queue_overload_enabled_(zero_hertz_queue_overload_enabled) {
+      frames_scheduled_for_processing_(frames_scheduled_for_processing) {
   sequence_checker_.Detach();
   MaybeStartRefreshFrameRequester();
 }
@@ -719,10 +707,6 @@
   callback_->OnFrame(/*post_time=*/encode_start_time, queue_overload_count_ > 0,
                      frame);
 
-  // WebRTC-ZeroHertzQueueOverload kill-switch.
-  if (!zero_hertz_queue_overload_enabled_)
-    return;
-
   // `queue_overload_count_` determines for how many future frames the
   // `queue_overload` flag will be set and it is only increased if:
   // o We are not already in an overload state.
@@ -855,10 +839,6 @@
     const FieldTrialsView& field_trials)
     : clock_(clock),
       queue_(queue),
-      frame_cadence_adapter_zero_hertz_queue_overload_enabled_(
-          !field_trials.IsDisabled("WebRTC-ZeroHertzQueueOverload")),
-      use_video_frame_timestamp_(field_trials.IsEnabled(
-          "WebRTC-FrameCadenceAdapter-UseVideoFrameTimestamp")),
       metronome_(metronome),
       worker_queue_(worker_queue) {}
 
@@ -1003,9 +983,7 @@
         << " last: " << last_incoming_frame_timestamp_.value().us();
   }
   last_incoming_frame_timestamp_ = Timestamp::Micros(frame.timestamp_us());
-  Timestamp update_frame_rate_timestamp =
-      use_video_frame_timestamp_ ? *last_incoming_frame_timestamp_ : post_time;
-  UpdateFrameRate(update_frame_rate_timestamp);
+  UpdateFrameRate(post_time);
 }
 
 bool FrameCadenceAdapterImpl::IsZeroHertzScreenshareEnabled() const {
@@ -1037,10 +1015,9 @@
     if (!was_zero_hertz_enabled || max_fps_has_changed) {
       RTC_LOG(LS_INFO) << "Zero hertz mode enabled (max_fps="
                        << source_constraints_->max_fps.value() << ")";
-      zero_hertz_adapter_.emplace(
-          queue_, clock_, callback_, source_constraints_->max_fps.value(),
-          frames_scheduled_for_processing_,
-          frame_cadence_adapter_zero_hertz_queue_overload_enabled_);
+      zero_hertz_adapter_.emplace(queue_, clock_, callback_,
+                                  source_constraints_->max_fps.value(),
+                                  frames_scheduled_for_processing_);
       zero_hertz_adapter_->UpdateVideoSourceRestrictions(
           restricted_max_frame_rate_);
     }