Move static configuration around. The "waiting for frame timeouts" are not very useful in this receiver-side configuration, since emitted keyframe requests will not be acted upon. So there will be no reason to experiment with these values => hide them in anon namespaces in .cc files, rather than having them configurable in the `Config` structs. Bug: b/423646186 Change-Id: Icf6bac2290669266687c03adda5076793422fb4c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/421720 Reviewed-by: Åsa Persson <asapersson@webrtc.org> Commit-Queue: Rasmus Brandt <brandtr@webrtc.org> Cr-Commit-Position: refs/heads/main@{#46074}
diff --git a/video/timing/simulator/rendering_simulator.cc b/video/timing/simulator/rendering_simulator.cc index d9d455b..80a3339 100644 --- a/video/timing/simulator/rendering_simulator.cc +++ b/video/timing/simulator/rendering_simulator.cc
@@ -183,9 +183,6 @@ tracker_(env, RenderingTracker::Config{ .ssrc = ssrc, - .max_wait_for_keyframe = - RenderingSimulator::kMaxWaitForKeyframe, - .max_wait_for_frame = RenderingSimulator::kMaxWaitForFrame, .render_delay = RenderingSimulator::kRenderDelay}, config.video_timing_factory(env), &collector_),
diff --git a/video/timing/simulator/rendering_simulator.h b/video/timing/simulator/rendering_simulator.h index bf776b3..8b13bbd 100644 --- a/video/timing/simulator/rendering_simulator.h +++ b/video/timing/simulator/rendering_simulator.h
@@ -134,11 +134,8 @@ std::vector<Stream> streams; }; - // Component configuration. + // Static configuration. static constexpr TimeDelta kRenderDelay = TimeDelta::Millis(10); - // TODO: b/423646186 - Hard code these in `RenderingTracker` instead. - static constexpr TimeDelta kMaxWaitForKeyframe = TimeDelta::Seconds(10); - static constexpr TimeDelta kMaxWaitForFrame = TimeDelta::Seconds(10); explicit RenderingSimulator(Config config); ~RenderingSimulator();
diff --git a/video/timing/simulator/rendering_tracker.cc b/video/timing/simulator/rendering_tracker.cc index e59ec30..86ccb85 100644 --- a/video/timing/simulator/rendering_tracker.cc +++ b/video/timing/simulator/rendering_tracker.cc
@@ -35,6 +35,9 @@ namespace { +constexpr TimeDelta kMaxWaitForKeyframe = TimeDelta::Seconds(10); +constexpr TimeDelta kMaxWaitForFrame = TimeDelta::Seconds(10); + // TODO: b/423646186 - Consider adding some variability to the decode time, and // update VCMTiming accordingly. VideoFrame SimulateDecode(const EncodedFrame& encoded_frame) { @@ -65,8 +68,8 @@ video_timing_.get(), /*stats_proxy=*/this, /*receiver=*/this, - config.max_wait_for_keyframe, - config.max_wait_for_frame, + kMaxWaitForKeyframe, + kMaxWaitForFrame, std::make_unique<TaskQueueFrameDecodeScheduler>(&env_.clock(), simulator_queue_), env_.field_trials()), @@ -79,8 +82,6 @@ RTC_DCHECK_RUN_ON(&sequence_checker_); // Validation. RTC_DCHECK_NE(config.ssrc, 0u); - RTC_DCHECK(config.max_wait_for_keyframe.IsFinite()); - RTC_DCHECK(config.max_wait_for_frame.IsFinite()); RTC_DCHECK(config.render_delay.IsFinite()); // Setup. ResetVideoStreamBufferControllerObserverStats();
diff --git a/video/timing/simulator/rendering_tracker.h b/video/timing/simulator/rendering_tracker.h index 8e34cb5..6639101 100644 --- a/video/timing/simulator/rendering_tracker.h +++ b/video/timing/simulator/rendering_tracker.h
@@ -61,10 +61,6 @@ // All members of the config should be explicitly set by the user. struct Config { uint32_t ssrc = 0; - // Time to wait for a keyframe, before timing out. - TimeDelta max_wait_for_keyframe = TimeDelta::MinusInfinity(); - // Time to wait for a delta frame, before timing out. - TimeDelta max_wait_for_frame = TimeDelta::MinusInfinity(); // Fixed render delay term added to the render timestamps. TimeDelta render_delay = TimeDelta::MinusInfinity(); };
diff --git a/video/timing/simulator/rendering_tracker_unittest.cc b/video/timing/simulator/rendering_tracker_unittest.cc index 3ce1de1..8d012e1 100644 --- a/video/timing/simulator/rendering_tracker_unittest.cc +++ b/video/timing/simulator/rendering_tracker_unittest.cc
@@ -65,8 +65,6 @@ env_, RenderingTracker::Config{ .ssrc = EncodedFrameBuilderGenerator::kSsrc, - .max_wait_for_keyframe = TimeDelta::Millis(200), - .max_wait_for_frame = TimeDelta::Millis(3000), .render_delay = TimeDelta::Millis(10)}, std::make_unique<VCMTiming>(&env_.clock(), env_.field_trials()), &rendering_tracker_events_);